SlideShare a Scribd company logo
1 of 114
0
Project Report
On
MULTIPLEX MANAGEMENT SYSTEM
Submitted in fulfillment of the
requirement for the award of the degree of
Master of Computer Applications
(Batch 2011 - 2014)
By
Savita Kumari
(1311710)
Under the Supervision
of
Mr. Munishwar Rai
M.M. Institute of Computer Technology & Business Management
Maharishi Markandeshwar University, Mullana (Ambala)
May 2014
1
CANDIDATE'S DECLARATION
I hereby declare that the work which is being presented in this
project entitled "Multiplex Management System" , in partial
fulfillment of the requirement for the award of the degree of MCA,
submitted at M.M.Institute of Computer Technology & Bussiness
Management, Maharishi Markandeshwar University, Mullana ,
Ambala is an authentic work done by me , during the period
03 Jan 2014 to 16 May 2014 under the guidance of Mr. Munishwar
Rai.
The work presented in this project report has not been submitted by
me for the award of any other degree of this or any other Institute or
University.
SAVITA KUMARI
(1311710)
This is to certify that the above declaration made by the candidate is
correct to best of my knowledge and belief.
Date: Mr. Munishwar Rai
Place: (Associate Professor)
2
ACKNOWLEDGEMENT
The satisfaction that accompanies that the successful completion of
any task would be incomplete without the mention of people whose
ceaseless cooperation made it possible, whose constant guidance and
encouragement crown all efforts with success.
My heartfelt gratitude goes to the principle, Dr. Dimple Juneja ,for
giving me this opportunity to work for the project and also for
constant encouragement.
Every possible effort is dedicated to my internal supervisor Mr.
Munishwar Rai ( Associate Professor ) for giving me a new
significance to our endowment regarding this project. I am highly
indebted for their gestures, invaluable suggested and boosting
confidence to make this successful.
I am thankful to the entire Team of Logic Erp who were a great
source of information and knowledge for me and for their endless
cooperation that they had showed to me.
With all these , I am highly thankful to my project guide and trainee
head Ms. Rajvinder Kaur at Logic Erp for the guidance, inspiration
and constructive suggestion that helped me in the preparation of this
project .
I dedicate my whole efforts and success in this project to my parents
and friends who assisted me with all kind of moral as well as
monetary support throughout my project work.
Savita Kumari
1311710
3
ABSTRACT
The main objective of this software is to reduce the work load of the
owner of the Multiplex.
To make it possible for the users to view the various Brands available
in the Mall and to check the Sale duration and amount on the
Brands if exist.
Using this software owner can easily check and evaluate everything
running in the Multiplex and users can get information's about the
Brands and Sale% .
The Multiplex Management System Software performs all the
operations and task online like :
 Booking and Cancellation of tickets.
 Screen and Movie Management.
 Handling database and track records.
 Managing employee databases.
 Showing various Malls and Brands.
 Listing the Sale duration and Sale% on Brands.
With all the above task it reduces the occurrence of error rates of the
multiplex system with a facility of listing all Brands of Multiplex and
Sale on them and hence making the Multiplex System more
successful.
4
LIST OF FIGURE
S.No. Figure Heading Page No.
1. 2.0 SDLC Phases 10
2. 3.3.1 Incremental Level 12
3. 4.1.2.1 0 Level DFD 24
4. 4.1.2.2 Level 1 DFD 25
5. 4.1.2.3 Context Level DFD 26
6. 4.2.2.1 ER Diagram 28
7. 4.1.0 System Analysis 29
8. 4.1.2.1 Login Home Page 30
9. 4.1.2.2 Login Page 30
10. 4.1.2.3 Admin Home Page 31
11. 4.1.2.4 Admin State form Page To Add States 31
12. 4.1.2.5 Admin City form To Add Cities 32
13. 4.1.2.6 Admin Multiplex Page To Add Multiplex 32
14. 4.1.2.7 Admin Multiplex Page To Add Movies 33
15. 4.1.2.8 Admin Page For Adding Movie 33
16. 4.1.2.9 Admin Page For Adding Movie Timings 34
17. 4.1.2.10 Admin Page for Gallery 34
18. 4.1.2.11 Admin Page For Editing the Image 35
29. 4.1.2.12 Admin Page for Adding Malls 35
20. 4.1.2.13 Admin Page for Adding Shopping Malls 36
21. 4.1.2.14 Admin Page for Adding Brands 36
22. 4.1.2.15 Admin Page for Displaying Sales 37
23. 4.1.2.16 User Registration Page 37
24. 4.1.2.17 Page For viewing Sale 38
25. 4.1.2.18 Page For viewing Brand 88
26. 4.1.2.18.1 Page For viewing Brand 39
27. 4.1.2.19 Seat Booking Section 39
28. 4.1.2.20 Manager's Page 40
5
LIST OF TABLES
S.No. Table Name Page No.
1. state_Master 17
2. city_Master 18
3. multiplex_Master 18
4. audi_Master 19
5. movie_Master 19
6. movie_Timing_Master 20
7. movie_Image_Master 20
8. user_Details 21
9. booking_Master 21
10. mallStateCity_Master 22
11. shopping_Complex_Master 22
12. brand_Master 23
13. sale_Master 23
6
LIST OF CONTENTS
CHAPTER CONTENT HEADER PAGE No.
List of Figures 4
List of Tables 5
Chapter 1 Company Profile 7
Chapter 2 Project Introduction 8
Chapter 3 SDLC Phases 11
Chapter 4 System Design 16
Chapter 5 User Interface 30
Chapter 6 Testing 109
Chapter 7 Maintainence & Implementation 111
Future Scope 113
Conclusion 113
Bibliography 114
7
COMPANY PROFILE
1.1 Company Profile
Logic is Microsoft certified, SAP certified, HP certified, India based
Custom Software Development Company providing IT services since
the year 1993. In the last 15 years , Company has achieved the
status of reputed Software Development Company by implementing
wide range of projects for reputed organization in following different
sectors:-
Retail, Apparels & Footwear, Pharmaceutical, FMCG (Fast Moving
Consumer Goods), Electronics & Telecommunication, Spa & Salon
and F & B (Food and Beverages).
Company's strength is maintaining good quality client satisfaction
supported by a talented pool of experienced professionals. It offers
dedicated services at all stages of the project right from the initial
stage to final delivery and maintenance.
1.2 Logic Services and Solutions:-
 ERP software or Business Solution Software.
 Implementation of ERP.
 Software development.
 Product Development.
 Software Training.
 ERP Training.
8
PROJECT INTRODUCTION
2.1 Introduction Of The Project
Multiplex Management System
A Multiplex is a movie theater complex with more than three screens.
The largest of these complexes are sometimes referred to as a
Megaplex. Definitions of what constitutes multiplex vs. a Megaplex is
related to the number of screens . Often the comparison is arbitrary .
For example , 12 to 16 screens may constitute a Multiplex , whereas
14 to 20 may be branded a Megaplex . To manage these all types
Multiplexes we are using Multiplex management system Software .
In Multiplexes , there are different types of Departments. To handle
the various departments in Multiplexes and Malls we can use this
multiplex management software.
2.2 Objective of Project
The main objective of this software is to reduce the work load of the
owner of the Multiplex. Using this software owner can easily check
and evaluate everything running in the Multiplex and with this the
user can also view online the Brands available in Malls and the
Sale% on the Brands if exist.
The Multiplex Management System Software performs all the
operations and task online like :
 Booking and Cancellation of tickets.
 Screen and Movie Management.
 Handling database and track records.
 Listing the Brands and Sale% on them.
 Managing employee databases.
9
With all the above task it reduces the occurrence of error rates of the
multiplex system and makes it easy to the user to view multiple offers
on brands online and hence making the Multiplex System more
successful.
2.2 Modules in the project:
1) User
i. Can view Malls and Brands.
ii. Can check Sale Duration and Sale% on Brands.
iii. Sign up to get registered.
iv. Login (logs in for ticket booking and cancellation)
2) Admin
a) Ticket Booking
i. Checks available Seats for user selection.
ii. Appointing Managers for Multiplex.
iii. Employee management at that time in the audi.
iv. Audi Management.
v. Movie management
b) Audi & Movie Management:
i. Managing Audi's with respect to movies.
ii. Dealing with show timing of movies.
c) Employee management:-
i. Managing employees.
d) Manager:-
i. Adding employees to the Multiplex.
ii. Viewing employees Attendance.
iii. Leave Approval
3. Organization of the project report in accordance with SDLC
i. Requirement Phase:- I gathered all the information required
for building this system. This involved studying the whole
present Multiplex systems and Malls, determining its
10
limitations and what all changes that are needed to be done in
order to improve it. A new system was then proposed on which
further phases were applied.
ii. Analysis Phase:- The requirements are then analyzed by
conducting a feasibility study in all respects i.e. - technical ,
economical & operational feasibility. Further analysis is done
by drawing Data-Flow Diagrams , Data Dictionary & ER-
Diagram. Finally the hardware & software requirements are
determined as per the needs of our system.
iii. Design Phase:- After successful analysis of the requirements,
the designing of the system begins. The Bottom-Up Approach is
used for the Object-Oriented Methodology. Modules and sub-
modules are then designed and a full system flow-chart is
made. After this the activity diagrams & Sequence diagrams are
designed.
iv. Implementation Phase:- The major functions of each modules
are determined and then pseudo codes for each of them are
then written to begin the implementation phase.
v. Testing Phase:- A methodology for testing is chosen and test
cases are built according to it. Steps of testing are then
specified.
vi. Maintenance Phase:- For future maintenance, installation
guide has been provided as well as troubleshooting tips are
given. Also the necessary Do’s & Don’ts have been specified.
11
Fig 2.0 SDLC Phases
SDLC PHASES
3.1 Requirement Analysis for Proposed System
 Here, I analyze that the user needs to view online the various
offers on Brands in the Mall .
 The ability to the admin/owner of the multiplex to appoint
managers to the multiplex.
 Retreiving information faster and accurate and updating for
authorized users.
12
3.2 Introduction to SRS
3.2.1 Model Description
A process model is chosen on the basis of the nature of the project,
its application, the tools and methods that are to be used as well as
the controls and the deliverables that are required . The model used
to build the " MULTIPLEX MANAGEMENT SYSTEM" is the
"Incremental Model".
Fig. 3.2.1
A series of mini-Waterfalls are performed, where all phases of the
Waterfall are completed for a small part of a system, before
proceeding to the next increment. This methodology is powerful,
precise and thorough. The phases that fall under this model are
as follows:
1. Requirement Analysis.
2. Design.
3. Implementation.
4. Testing.
5. Maintenance.
13
3.2.2 Architecture
Three-tier architecture is a client–server architecture in which
the user interface, functional process logic, computer data storage
and data access are developed and independent modules are made,
most often on separate platforms. Apart from the usual advantages
of modular software with well-defined interfaces, the three-tier
architecture is intended to allow any of the three tiers to be upgraded
or replaced independently in response to changes in requirements
or technology. Three-tier architecture has the following three tiers:
Presentation tier This is the topmost level of the application. The
presentation tier displays information related to Multiplexes, Malls
and Brands. It communicates with other tiers by outputting results
client tier and all other tiers in the network. (In simple terms, it is a
layer which users can access directly such as a web page, or an
operating systems GUI)
Application tier (business logic, logic tier, data access tier, or
middle tier)
The logical tier is pulled out from the presentation tier, as its own
layer, it controls an application’s functionality by performing detailed
processing.
Data tier
This tier consists of database servers. Here information is stored and
retrieved . This tier keeps data neutral and independent from
application servers or business logic. Giving data its own tier also
improves scalability and performance.
3.3 Certain specific requirements
3.3.1 Input & output of the project:
Inputs Of the Project
 Databases and records of employee.
14
 Movies and number of screens.
 Number of seats.
 Request for booking/cancellation.
 User registers.
 List of Multiplexes.
 List of Malls.
 List of Brands.
 Sale Details
Outputs Of the Project
 Databases and records of employees handled.
 Movies schedule and screens handled.
 Seats allotted.
 Booking and cancellation done.
 Registration performed.
 Brands in Malls can be viewed.
 Sale can be viewed.
3.3.2 Hardware & Software Requirement
Hardware Requirements:
 Processor: Intel dual core or above
 Processor Speed:1.0GHZ or above
 RAM: 1 GB RAM or above
 Hard Disk: 20 GB hard disk or above
Software Requirements:
 Language: ASP.net
 Platform-used: .net.
 Back-End Tool: Microsoft SQL server 2008
 Front-End Tool: Visual Studio 2012
15
3.4 FEASIBILITY STUDY
It is the measure of how beneficial or practical the development of an
Multiplex System will be, to an organization . It is a process , which
defines exactly what a project is, and what strategic issues need to
be considered to assess its feasibility, or likelihood of succeeding.
Ideally, it's the process of making rational decisions about a number
of enduring characteristics of the project.
It is an evaluation of a proposed design, to determine the difficulties
in carrying out the designated task. Generally, it precedes technical
development and project implementation. In other words, it is an
evaluation or analysis of the potential impact of the proposed project.
3.4.1 Technical feasibility:
It's the measure of the practicality of the specific technical solution. A
measure of the availability of technical resources and expertise.
Technical feasibility addresses major issues such as :-
 Is the proposed technology or solution is practical?
 Do we currently possess the necessary technology?
The "Multiplex Management System" is found to be technically
feasible, as the resources and technology required by it, is available.
3.4.2 Operational feasibility:
Its the measure of how well the solution of problems or a specific
solution will work in the organization.
A measure of how people feel about the system/project.
"Multiplex Management System" is operationally feasible as it can
be easily used by the users .
The users as well as management/admin will feel good while using
the system:
16
 The system provides the users to book/cancel movie tickets
online.
 It provides the users to view the sales on brands in various
Malls online.
 It provides adequate throughput and response time.
3.4.3 Economic feasibility:
Its the measure of the cost-effectiveness of the project, often called as
cost-benefit analysis.
"Multiplex Management System" is economically feasible, because
it reduces the expense as well as time in the manual system.
Following factors are studied for economic feasibility of project:
 Systems analysts' time.
 Cost of systems study.
 Estimated cost of hardware.
 Cost of packaged software/software development.
SOFTWARE DESIGN
4.1 SYSTEM DESIGN
System Design is a solution to the creation of a new system. This
phase is composed of several systems. It focuses on the detailed
implementation of the feasible system. It emphasis on translating
design specifications to performance specifications.
17
Fig 4.1.0
System Design has two phases:
 Architectural/Logical design.
 User Interface/Physical design.
4.1.1 Architectural Design:
In this phase , the analyst describes sources and destinations,
databases and procedures , all in a format that meets the user
requirements. The analyst also specifies the user needs and at a
level that virtually determines the flow of the system and the data
resources. This design is shown by the DFD's and Database design.
4.1.1 Database Designs:
Table 4.1.1.1 User_Details
18
4.1.1.2 Table state_Master
4.1.1.3 Table city_Master
19
4.1.1.4 Table multiplex_Master
4.1.1.5 Table movie_Master
20
4.1.1.6 Table movieTiming_Master
4.1.1.7 Table movieImage_Master
21
4.1.1.8 Table booking_Master
4.1.1.9 Table mallStateCity_Master
22
4.1.1.10 Table shopping_Complex_Master
4.1.1.11 Table brand_Master
23
4.1.1.12 Table sale_Master
4.1.13 Table audi_Master
24
4.1.2 DFD's
4.1.2.1 0 Level DFD
User
Multiplex
management
system
Registration
Ticket
Registered
Booked/Cancelled
Watched
Movie
Bookin
g
Malls
Shopping
Complex
Brands
25
4.1.2.2 Level 1 DFD
mallStateCity
Login
2
User details
Registration
1
Enter
Detai
ls Ticket Booking
/Cancellation
System
3
User Code
allotted
Ticket_Booking
Management
4
User Details
Manages Ticket
Booking //ca
5 Mall
Management
admin
26
4.1.2.3 Context Level DFD
27
28
4.1.3 E-R Diagram
29
4.1.2 User Interface Design:
This design is followed by the designing and the coding part. It
produces the working system by defining the design specifications,
which tells the programmers exactly what the candidate system must
do. The programmers write the necessary programs that accepts
input from the user, perform necessary processing on accepted data
30
through call and produce the required report on a hard copy or
displays it on screen.
4.1.2.1 Login Home Page
4.1.2.2 Login Page
31
4.1.2.3 Admin Home Page
4.1.2.4 Admin State form Page To Add States
32
4.1.2.5 Admin City form To Add Cities
4.1.2.6 Admin Multiplex Page To Add Multiplex
33
4.1.2.7 Admin Movie Page To Add Movies To Multiplex
4.1.2.8 Admin Page For Adding Movie
34
4.1.2.9 Admin Page For Adding Movie Timings
4.1.2.10 Admin Page for Gallery
35
4.1.2.11 Admin Page For Editing the Image
4.1.2.12 Admin Page for Adding Malls
36
4.1.2.13 Admin Page for Adding Shopping Malls
4.1.2.14 Admin Page for Adding Brands
37
4.1.2.15 Admin Page for Displaying Sales on Brands
4.1.2.16 User Registration Page
38
4.1.2.17 Page For viewing Sale
4.1.2.18 Page For viewing Brand
39
4.1.2.18.1 Page For viewing Brand
4.1.2.19 Seat Booking Section
40
4.1.2.20 Managers page for adding employee
5. (Coding Section ) Common Functions of DAL Layer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;
using BAL;
namespace DAL
{
public class CommonFunc
{
private SqlConnection _connectionString;
public SqlCommand cmd = new SqlCommand();
41
public CommonFunc(SqlConnection con)
{
_connectionString = con;
}
// FUNCTIONS FOR STATE
//submit function for state
public void SubmitState(state sc1)
{
cmd.Parameters.Add("@state_name", SqlDbType.VarChar, 50).Value
= sc1.State_Name;
if (sc1.State_Code == 0)
{
cmd.CommandText = "insert into state_Master values
(@state_name)";
}
else
{
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
cmd.CommandText = "update state_Master set
State_Name=@state_name where State_Code=@state_Code";
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
//bind function for state
public DataSet BindState()
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
state_Master ", _connectionString);
DataSet ds = new DataSet();
42
adp.Fill(ds);
return (ds);
}
//delete function for state
public void DelState(state sc1)
{
_connectionString.Open();
cmd.CommandText = "delete from state_Master where
State_Code=@Code ";
cmd.Parameters.Add("@code", SqlDbType.VarChar, 50).Value =
Convert.ToInt32(sc1.State_Code);
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
//function for gettingstate
public void GetState(state sc1)
{
cmd.CommandText = "select * from state_Master where
State_Code=@state_Code";
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.Parameters.Add("@state_Code", SqlDbType.VarChar, 50).Value
= sc1.State_Code;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.State_Name = Convert.ToString(dr["State_Name"]);
}
_connectionString.Close();
}
// function for state paging and searching
43
public ResponseResult<state> StateList(int pageNo, int pageSize,
string searchStr = "")
{
List<state> stateList = new List<state>();
state State = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY State_Code )AS rno, * from
state_Master where State_Name like '%" + searchStr + "%') as t where
rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" +
pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
state_Master where State_Name like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
State = new state();
State.State_Name = dr["State_Name"] + "";
stateList.Add(State);
}
}
_connectionString.Close();
44
ResponseResult<state> resultState = new ResponseResult<state>();
resultState.Records = stateList;
resultState.TotalRecords = totalRecords;
return resultState;
}
//FUNCTIONS FOR CITY
//submit function for inserting and updating city
public void SubmitCity(city sc1)
{
cmd.Parameters.Add("@city_name",SqlDbType.VarChar,50).Value
= sc1.City_Name;
cmd.Parameters.Add("@state_code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
if (sc1.City_Code == 0)
{
cmd.CommandText = "insert into
city_Master(City_Name,State_Code) values(@city_name,@state_code)";
}
else
{
cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.City_Code);
cmd.CommandText = "update city_Master set
City_Name=@city_name where City_Code=@city_Code";
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
}
//function for binding city
public DataSet BindCity()
{
45
SqlDataAdapter adp = new SqlDataAdapter("select
c.City_Name,c.City_Code ,S.State_Name from state_Master as S join
city_Master as c on c.State_Code=S.State_Code ", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//bind city and state accordingly
public DataSet BindCityState(citysc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select
City_Name,City_Code from city_Master where State_Code=@state_Code",
_connectionString);
adp.SelectCommand.Parameters.Add("@state_Code",
SqlDbType.Int).Value = sc1.State_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}
//function for gettingcity
public void GetCity(city sc1)
{
cmd.CommandText = "select * from city_Master where
City_Code=@city_Code";
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.Parameters.Add("@city_Code", SqlDbType.VarChar, 50).Value =
sc1.City_Code;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.City_Name = Convert.ToString(dr["City_Name"]);
46
}
_connectionString.Close();
}
//function for deleting city
public void DelCity(city sc1)
{
_connectionString.Open();
cmd.CommandText = "delete from city_Master where
City_Code=@Code ";
cmd.Parameters.Add("@code", SqlDbType.VarChar, 50).Value =
Convert.ToInt32(sc1.City_Code);
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
//function for city paging and searching
public ResponseResult<city> CityList(int pageNo, int pageSize, string
searchStr = "")
{
List<city> cityList = new List<city>();
city City = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY c.City_Code )AS rno,
c.City_Name,c.City_Code ,S.State_Name from state_Master as S join
city_Master as c on c.State_Code=S.State_Code where c.City_Name like '%"
+ searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND
rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
city_Master where City_Name like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
47
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
City = new city();
City.City_Name = dr["City_Name"] + "";
City.State_Name = dr["State_Name"] + "";
cityList.Add(City);
}
}
_connectionString.Close();
ResponseResult<city>resultCity= new ResponseResult<city>();
resultCity.Records = cityList;
resultCity.TotalRecords= totalRecords;
return resultCity;
}
//FUNCTIONS FOR AUDI'S
//function for adding audi
public void SetAudi(audi sc1)
{
cmd.Parameters.Add("@audi_no",SqlDbType.VarChar,50).Value =
sc1.Audi_No;
cmd.Parameters.Add("@platinum_seats", SqlDbType.VarChar,
50).Value = sc1.Platinum_Seats;
cmd.Parameters.Add("@gold_seats", SqlDbType.VarChar, 50).Value
= sc1.Gold_Seats;
48
cmd.Parameters.Add("@silver_seats",SqlDbType.VarChar,50).Value
= sc1.Silver_Seats;
cmd.Parameters.Add("@bronze_seats",SqlDbType.VarChar,
50).Value = sc1.Bronze_Seats;
if (sc1.Audi_Code == 0)
{
cmd.CommandText = "insert into
audi_Master(Audi_No,Platinum_Seats,Gold_Seats,Silver_Seats,Bronze_Seats
) values
(@audi_no,@platinum_seats,@gold_seats,@silver_seats,@bronze_seats)";
}
else
{
cmd.CommandText = "update audi_Master set
Audi_NO=@audi_no,Platinum_Seats=@platinum_seats,Gold_Seats=@gold_se
ats,Silver_Seats=@silver_seats,Bronze_Seats=@bronze_seats where
Audi_Code=@audi_Code";
cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Audi_Code);
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
}
//bind function for Audi
public DataSet BindAudi()
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
audi_Master ", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
49
//search function for audi
//delete function for audi
public void DeleteAudi(int Audi_Code)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
audi_Master where Audi_Code=@Audi_Code", _connectionString);
adp.SelectCommand.Parameters.Add("@Audi_Code",
SqlDbType.Int).Value = Convert.ToInt32(Audi_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//get function for audi
public void GetAudi(audi a1)
{
cmd.CommandText = ("select * from audi_Master where
Audi_Code=@Audi_Code");
cmd.Parameters.Add("@Audi_Code", SqlDbType.Int).Value =
a1.Audi_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
a1.Audi_No = Convert.ToString(dr["Audi_No"]);
a1.Platinum_Seats= Convert.ToString(dr["Platinum_Seats"]);
a1.Gold_Seats= Convert.ToString(dr["Gold_Seats"]);
a1.Silver_Seats = Convert.ToString(dr["Silver_Seats"]);
a1.Bronze_Seats = Convert.ToString(dr["Bronze_Seats"]);
}
_connectionString.Close();
}
//function for audi paging
50
public ResponseResult<audi>AudiList(int pageNo, int pageSize, string
searchStr = "")
{
List<audi> audiList = new List<audi>();
audi audii = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Audi_Code )AS rno, * from
audi_Master where Audi_No like '%" + searchStr + "%') as t where rno>((" +
pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")",
_connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
audi_Master", _connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
audii = new audi();
audii.Audi_No = dr["Audi_No"] + "";
audii.Platinum_Seats = dr["Platinum_Seats"] + "";
audii.Gold_Seats = dr["Gold_Seats"] + "";
audii.Silver_Seats = dr["Silver_Seats"] + "";
audii.Bronze_Seats= dr["Bronze_Seats"] + "";
audii.Audi_Code = Convert.ToInt32(dr["Audi_Code"] + "");
51
audiList.Add(audii);
}
}
_connectionString.Close();
ResponseResult<audi> resultAudi = new ResponseResult<audi>();
resultAudi.Records= audiList;
resultAudi.TotalRecords = totalRecords;
return resultAudi;
}
// FUNCTIONS FOR MOVIES
//submit or set function for movie
public void SetMovie(movie sc1)
{
try
{
if (sc1.Movies_Code == 0)
{
cmd.CommandText = "insert into movie_Master
values(@movie_Name,@movie_Image,@releasing_Date,@end_Date,@languag
e,@genres,@audi_Code,@multiplex_Code,@state_Code,@city_Code)";
}
else
{
cmd.CommandText = "update movie_Master set
Movie_Name=@movie_Name,Movie_Image=@movie_Image,Releasing_Date=@
releasing_Date,End_Date=@end_Date,Language=@language,Genres=@genre
s,Audi_Code=@audi_Code,Multiplex_Code=@multiplex_Code,State_Code=@s
tate_Code,City_Code=@city_Code where Movies_Code=@movie_Code";
cmd.Parameters.Add("@movie_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.Movies_Code);
}
cmd.Parameters.Add("@movie_Name", SqlDbType.VarChar,
50).Value = sc1.Movie_Name;
52
cmd.Parameters.Add("@movie_Image", SqlDbType.VarChar,
50).Value = sc1.Movie_Image;
cmd.Parameters.Add("@releasing_Date", SqlDbType.VarChar,
50).Value = sc1.Releasing_Date;
cmd.Parameters.Add("@end_Date", SqlDbType.VarChar,
50).Value = sc1.End_Date;
cmd.Parameters.Add("@language",SqlDbType.VarChar, 50).Value
= sc1.Language;
cmd.Parameters.Add("@genres", SqlDbType.VarChar, 50).Value =
sc1.Genres;
cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Audi_Code);
cmd.Parameters.Add("@multiplex_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.Multiplex_Code);
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.City_Code);
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
throw ex;
}
}
//code for binding movie
public DataSet BindMovie()
{
SqlDataAdapter adp = new SqlDataAdapter("select
mo.Movies_Code,mo.Movie_Name,mo.Movie_Image,mo.Releasing_Date,mo.E
nd_date,mo.Language,mo.Genres,a.Audi_No,m.Multiplex_Name,s.State_Na
53
me,c.City_Name from movie_Master as mo, audi_Master as a,state_Master
as s,city_Master as c,multiplex_Master as m where
mo.Audi_Code=a.Audi_Code and mo.State_Code=s.State_Code and
mo.City_Code=c.City_Code and mo.Multiplex_Code=m.Multiplex_Code",
_connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//delete code for movie
public void DelMovie(int Movie_Code)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
movie_Master where Movies_Code=@movie_Code", _connectionString);
adp.SelectCommand.Parameters.Add("@movie_Code",
SqlDbType.Int).Value = Convert.ToInt32(Movie_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
public void GetMovie(movie sc1)
{
cmd.CommandText = ("select * from movie_Master where
movie_Master.Movies_Code=@Movie_Code");
cmd.Parameters.Add("@movie_Code", SqlDbType.Int).Value =
sc1.Movies_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Movie_Name = Convert.ToString(dr["Movie_Name"]);
sc1.Movie_Image = Convert.ToString(dr["Movie_Image"]);
54
sc1.Releasing_Date = Convert.ToString(dr["Releasing_Date"]);
sc1.End_Date = Convert.ToString(dr["End_Date"]);
sc1.Language = Convert.ToString(dr["Language"]);
sc1.Genres = Convert.ToString(dr["Genres"]);
sc1.Audi_Code = Convert.ToInt32(dr["Audi_Code"]);
sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
}
_connectionString.Close();
}
//function for paging in movies
public ResponseResult<movie> MovieList(int pageNo, int pageSize,
string searchStr = "")
{
List<movie> movieList = new List<movie>();
movie Movie = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Movies_Code )AS rno, * from
movie_Master where Movie_Name like '%" + searchStr + "%') as t where
rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" +
pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
movie_Master where Movie_Name like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
55
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Movie = new movie();
Movie.Movie_Name = dr["Movie_Name"] + "";
Movie.Movie_Image = dr["Movie_Image"] + "";
Movie.Releasing_Date = dr["Releasing_Date"] + "";
Movie.End_Date = dr["End_Date"] + "";
Movie.Language = dr["Language"] + "";
Movie.Genres = dr["Genres"] + "";
Movie.Audi_No = Convert.ToString(dr["Audi_No"]);
Movie.Multiplex_Name =
Convert.ToString(dr["Multiplex_Name"] + "");
Movie.State_Name = Convert.ToString(dr["State_Name"] + "");
Movie.City_Name = Convert.ToString(dr["City_Name"] + "");
movieList.Add(Movie);
}
}
_connectionString.Close();
ResponseResult<movie>resultMovie = new
ResponseResult<movie>();
resultMovie.Records= movieList;
resultMovie.TotalRecords = totalRecords;
return resultMovie;
}
//functions for multiplex
//bind multiplex function
public DataSet BindMultiplex()
{
56
SqlDataAdapter adp = new SqlDataAdapter("select
Multiplex_Code,Multiplex_Name,State_Name,City_Name from
state_Master,city_Master join multiplex_Master on
multiplex_Master.State_Code=state_Master.State_Code and
multiplex_Master.City_Code=city_Master.City_Code ", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//get function for multiplex
public void GetMultiplex(multiplex sc1)
{
cmd.CommandText = ("select * from multiplex_master where
multiplex_Master.Multiplex_Code=@multiplex_Code");
cmd.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value =
sc1.Multiplex_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Multiplex_Name = Convert.ToString(dr["Multiplex_Name"]);
}
_connectionString.Close();
}
//delete function for multiplex
public void DelMultiplex(int Multiplex_Code)
{
57
SqlDataAdapter adp = new SqlDataAdapter("delete from
multiplex_Master where Multiplex_Code=@multiplex_Code",
_connectionString);
adp.SelectCommand.Parameters.Add("@multiplex_Code",
SqlDbType.Int).Value = Convert.ToInt32(Multiplex_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//paging and searching for multiplex
public ResponseResult<multiplex> MultiplexList(int pageNo, int
pageSize, string searchStr = "")
{
List<multiplex> multiplexList = new List<multiplex>();
multiplex Multiplexx = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Multiplex_Code )AS
rno,m.Multiplex_Code,s.State_Name,c.City_Name,m.Multiplex_Name from
multiplex_Master as m join city_Master as c on m.City_Code =c.City_Code
join state_Master as s on s.State_Code=m.State_Code where
Multiplex_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-
1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")",
_connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
multiplex_Master where Multiplex_Name like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
58
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Multiplexx = new multiplex();
Multiplexx.Multiplex_Code =
Convert.ToInt32(dr["Multiplex_Code"]);
Multiplexx.State_Name = Convert.ToString(dr["State_Name"]);
Multiplexx.City_Name = Convert.ToString(dr["City_Name"]);
Multiplexx.Multiplex_Name =
Convert.ToString(dr["Multiplex_Name"] + "");
multiplexList.Add(Multiplexx);
}
}
_connectionString.Close();
ResponseResult<multiplex> resultMultiplex = new
ResponseResult<multiplex>();
resultMultiplex.Records = multiplexList;
resultMultiplex.TotalRecords = totalRecords;
return resultMultiplex;
}
//bind function for multiplex and city
public DataSet BindCityMultiplex(multiplex sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
multiplex_Master where City_Code=@city_Code", _connectionString);
adp.SelectCommand.Parameters.Add("@city_Code",
SqlDbType.Int).Value = sc1.City_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
59
return ds;
}
//set function for multiplex
public void SetMultiplex(multiplex sc1)
{
try
{
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.City_Code);
cmd.Parameters.Add("@multiplex_Name",SqlDbType.VarChar,
50).Value = sc1.Multiplex_Name;
if (sc1.Multiplex_Code == 0)
{
cmd.CommandText = "insert into multiplex_Master
(State_Code,City_Code,Multiplex_Name)
values(@state_Code,@city_Code,@multiplex_Name)";
}
else
{
cmd.CommandText = "update multiplex_Master set
State_Code=@state_Code,City_Code=@city_Code,
Multiplex_Name=@multiplex_Name where
Multiplex_Code=@multiplex_Code";
cmd.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value
= Convert.ToInt32(sc1.Multiplex_Code);
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
60
catch (Exception ex)
{
throw ex;
}
}
//functions for images
public void GetImages(image im)
{
cmd.CommandText = ("select * from movieImage_Master");
cmd.Parameters.Add("@image_Code",SqlDbType.Int).Value =
im.Image_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
im.Movie_Name = Convert.ToString(dr["Movie_Name"]);
im.Image_Path = Convert.ToString(dr["Image_Path"]);
}
_connectionString.Close();
}
//function for setting image
public void SetImage(image im)
{
try
{
if (im.Image_Code == 0)
{
cmd.CommandText = "insert into movieImage_Master
values(@movie_Name,@image_Path)";
}
else
61
{
cmd.CommandText = "update movieImage_Master set
Movie_Name=@movie_Name,Image_Path=@image_Pathwhere
Image_Code=@image_Code";
cmd.Parameters.Add("@image_Code", SqlDbType.Int).Value =
Convert.ToInt32(im.Image_Code);
}
cmd.Parameters.Add("@movie_Name", SqlDbType.VarChar,
50).Value = im.Movie_Name;
cmd.Parameters.Add("@image_Path",SqlDbType.VarChar,
50).Value = im.Image_Path;
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
throw ex;
}
}
//functions for movie timings
//bind movie timings function
public DataSet BindMovieTimings()
{
SqlDataAdapter adp = new SqlDataAdapter("select
mo.MovieTimings_Code,mo.Date,mo.Show_Timings,a.Audi_No,m.Movie_Na
me from movieTiming_Master as mo join audi_Master as a on
mo.Audi_Code =a.Audi_Code join movie_Master as m on
m.Movies_Code=mo.Movies_Code ", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
62
//bind movies audi wise function
public DataSet BindAudiMovie(movie sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
movie_Master where Audi_Code=@audi_Code",_connectionString);
adp.SelectCommand.Parameters.Add("@audi_Code",
SqlDbType.Int).Value = sc1.Audi_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}
//get function for movie timings
public void GetMovieTimings(movietiming sc1)
{
cmd.CommandText = ("select * from movieTiming_Master where
movieTiming_Master.MovieTimings_Code=@movieTimings_Code ");
cmd.Parameters.Add("@movieTimings_Code", SqlDbType.Int).Value
= sc1.MovieTimings_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.MovieTimings_Code =
Convert.ToInt32(dr["MovieTimings_Code"]);
sc1.Date = Convert.ToString(dr["Date"]);
sc1.Show_Timings= Convert.ToString(dr["Show_Timings"]);
sc1.Movies_Code = Convert.ToInt32(dr["Movies_Code"]);
sc1.Audi_Code = Convert.ToInt32(dr["Audi_Code"]);
}
_connectionString.Close();
}
63
//delete function for movie timings
public void DelMovieTimings(int MovieTimings_Code)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
movieTiming_Master where MovieTimings_Code=@movieTimings_Code",
_connectionString);
adp.SelectCommand.Parameters.Add("@movieTimings_Code",
SqlDbType.Int).Value = Convert.ToInt32(MovieTimings_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//paging and searching for MovieTimings
public ResponseResult<movietiming> MovieTimingsList(int pageNo, int
pageSize, string searchStr = "")
{
List<movietiming> movieTimingsList = new List<movietiming>();
movietiming MovieTimingss= null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY MovieTimings_Code )AS rno,
mo.MovieTimings_Code,mo.Date,mo.Show_Timings,a.Audi_No,m.Movie_Na
me from movieTiming_Master as mo join audi_Master as a on
mo.Audi_Code =a.Audi_Code join movie_Master as m on
m.Movies_Code=mo.Movies_Code where Date like '%" + searchStr + "%') as
t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo +
")*" + pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
movieTiming_Master where Date like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
64
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
MovieTimingss = new movietiming();
MovieTimingss.MovieTimings_Code =
Convert.ToInt32(dr["MovieTimings_Code"] + "");
MovieTimingss.Date = dr["Date"] + "";
MovieTimingss.Show_Timings = dr["Show_Timings"] + "";
MovieTimingss.Audi_No = Convert.ToString(dr["Audi_No"] + "");
MovieTimingss.Movie_Name =
Convert.ToString(dr["Movie_Name"]);
movieTimingsList.Add(MovieTimingss);
}
}
ResponseResult<movietiming> resultMovieTiming = new
ResponseResult<movietiming>();
resultMovieTiming.Records = movieTimingsList;
resultMovieTiming.TotalRecords= totalRecords;
_connectionString.Close();
return resultMovieTiming;
}
//set function for MovieTimings
public void SetMovieTimings(movietiming sc1)
{
try
{
65
if (sc1.MovieTimings_Code == 0)
{
cmd.CommandText = "insert into movieTiming_Master
(Date,Show_Timings,Audi_Code,Movies_Code)
values(@date,@show_Timings,@audi_Code,@movies_Code)";
}
else
{
cmd.CommandText = "update movieTiming_Master set
Date=@date,Show_Timings=@show_Timings,Audi_Code=@audi_Code,Movies
_Code=@movies_Code where MovieTimings_Code=@movieTimings_Code";
cmd.Parameters.Add("@movieTimings_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.MovieTimings_Code);
}
cmd.Parameters.Add("@date", SqlDbType.VarChar, 50).Value =
Convert.ToString(sc1.Date);
cmd.Parameters.Add("@show_Timings", SqlDbType.VarChar,
50).Value = Convert.ToString(sc1.Show_Timings);
cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Audi_Code);
cmd.Parameters.Add("@movies_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Movies_Code);
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
}
//search movie function
66
public void SearchMovie(movie sc1)
{
cmd.CommandText = ("select Movie_Name,Audi_No,Show_Timings
from audi_Master join movie_Master on
movie_Master.Audi_Code=audi_Master.Audi_Code where
movie_Master.Movies_Code=@Movies_Code");
cmd.Parameters.Add("@Movies_Code", SqlDbType.Int).Value =
Convert.ToString(sc1.Movies_Code);
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Audi_No = Convert.ToString((dr["Audi_No"]));
}
_connectionString.Close();
}
//function for filtering movie according to date
public DataSet FilterMovie(movie sc1, multiplex sc)
{
SqlDataAdapter adp = new SqlDataAdapter("select
m.movie_name,m.Movies_Code from movie_Master as m join
multiplex_master as mu on m.Multiplex_Code = mu.Multiplex_Code where
m.Multiplex_Code=@multiplex_Code and m.End_Date>=@date ",
_connectionString);
adp.SelectCommand.Parameters.Add("@multiplex_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc.Multiplex_Code);
adp.SelectCommand.Parameters.Add("@date", SqlDbType.VarChar,
50).Value = sc1.Date;
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
67
}
//function for gettingaudi as per movie
public void FilterAudi(movie sc)
{
cmd.CommandText = "select a.audi_no,a.Audi_Code from
audi_Master as a join movie_master as m on a.Audi_Code = m.Audi_Code
where m.Movies_Code=@movies_Code";
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.Parameters.Add("@movies_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc.Movies_Code);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc.Audi_No = Convert.ToString(dr["Audi_No"]);
}
_connectionString.Close();
}
//function for gettingshow timings of selected movie
public DataSet FilterTimings(movietiming sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select
s.show_Timings,s.MovieTimings_Code from movieTiming_Master as s join
movie_master as m on s.Movies_Code = m.Movies_Code where
s.Movies_Code=@movie_Code ", _connectionString);
adp.SelectCommand.Parameters.Add("@movie_Code",
SqlDbType.Int).Value = sc1.Movies_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}
//code for booking table
68
public void SubmitBooking(booking sc1)
{
try
{
cmd.CommandText = "insert into
booking_Master(User_Code,State_Code,City_Code,Multiplex_Code,Date,Movi
eTiming_Code,Movies_Code,Audi_Code,Platinum_Seat,Gold_Seat,Silver_Sea
t,Bronze_Seat,Seats,Total_Price)
values(@User_Code,@State_Code,@City_Code,@Multiplex_Code,@Date,@Mov
ieTiming_Code,@Movie_Code,@Audi_Code,@Platinum_Seat,@Gold_Seat,@Sil
ver_Seat,@Bronze_Seat,@Seats,@total_Price)";
cmd.Parameters.Add("@User_Code", SqlDbType.Int).Value =
sc1.User_Code;
cmd.Parameters.Add("@State_Code", SqlDbType.Int).Value =
sc1.State_Code;
cmd.Parameters.Add("@City_Code", SqlDbType.Int).Value =
sc1.City_Code;
cmd.Parameters.Add("@Multiplex_Code", SqlDbType.Int).Value =
sc1.Multiplex_Code;
cmd.Parameters.Add("@Date",SqlDbType.VarChar,50).Value =
sc1.Date;
cmd.Parameters.Add("@Movie_Code",SqlDbType.VarChar,
50).Value = sc1.Movies_Code;
cmd.Parameters.Add("@MovieTiming_Code", SqlDbType.VarChar,
50).Value = sc1.MovieTiming_Code;
cmd.Parameters.Add("@Audi_Code",SqlDbType.Int).Value =
sc1.Audi_Code;
cmd.Parameters.Add("@Platinum_Seat", SqlDbType.VarChar,
50).Value = sc1.Platinum_Seat;
cmd.Parameters.Add("@Gold_Seat", SqlDbType.VarChar,
50).Value = sc1.Gold_Seat;
cmd.Parameters.Add("@Silver_Seat", SqlDbType.VarChar,
50).Value = sc1.Silver_Seat;
69
cmd.Parameters.Add("@Bronze_Seat",SqlDbType.VarChar,
50).Value = sc1.Bronze_Seat;
cmd.Parameters.Add("@Seats", SqlDbType.VarChar, 50).Value =
sc1.Seats;
cmd.Parameters.Add("@total_Price", SqlDbType.Int).Value =
sc1.Total_Price;
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
cmd.Dispose();
}
catch (Exception ex)
{
throw ex;
}
}
//function for user registration
public void SubmitUser(userDetails sc1)
{
try
{
cmd.CommandText = "insert into
User_Details(User_Name,Email_Id,Password,D_o_b,Mobile_No)
values(@User_Name,@Email_Id,@Password,@DOB,@Phone_No)";
cmd.Parameters.Add("@User_Name", SqlDbType.VarChar,
50).Value = sc1.User_Name;
cmd.Parameters.Add("@Email_Id", SqlDbType.VarChar, 50).Value
= sc1.Email_id;
cmd.Parameters.Add("@Password", SqlDbType.VarChar,
50).Value = sc1.Password;
cmd.Parameters.Add("@DOB", SqlDbType.VarChar, 50).Value =
sc1.D_o_b;
70
cmd.Parameters.Add("@Phone_No",SqlDbType.VarChar,
50).Value = sc1.Mobile_No;
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
// cmd.Dispose();
}
catch (Exception ex)
{
throw ex;
}
}
//function for changing password
public void ChangePassword(userDetails sc1)
{
try
{
cmd.CommandText = "update User_Details set
Password=@password where Email_id=@email_id";
cmd.Parameters.Add("@password", SqlDbType.VarChar,
50).Value = Convert.ToString(sc1.Password);
cmd.Parameters.Add("@email_id",SqlDbType.VarChar,50).Value
= Convert.ToString(sc1.Email_id);
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
71
}
//paging for viewing brand imagesby user
public ResponseResult<brand> BrandViewList(int pageNo, int
pageSize, string searchStr = "")
{
List<brand> brandviewList = new List<brand>();
brand Brandvieww = null;
int totalImages;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Brand_Code )AS
rno,Brand_Code,Brand_Name,Brand_Image from brand_Master ) as t where
rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" +
pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
brand_Master", _connectionString);
totalImages = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Brandvieww = new brand();
Brandvieww.Brand_Code = Convert.ToInt32(dr["Brand_Code"]);
Brandvieww.Brand_Name =
Convert.ToString(dr["Brand_Name"]);
Brandvieww.Brand_Image =
Convert.ToString(dr["Brand_Image"]);
brandviewList.Add(Brandvieww);
72
}
}
_connectionString.Close();
ResponseResult<brand> resultBrandView = new
ResponseResult<brand>();
resultBrandView.Records= brandviewList;
resultBrandView.TotalRecords = totalImages;
return resultBrandView;
}
//function for gettingall the booked seats in string
public booking SplitSeats(booking sc1)
{
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.CommandText = "select
Platinum_seat,Gold_Seat,Silver_Seat,Bronze_Seat from booking_Master
where State_Code=@state_Code and City_Code=@city_Code and
Multiplex_Code=@multiplex_Code and Movies_Code=@movie_Code and
Date=@date and MovieTiming_Code=@movieTiming_Code and
Audi_Code=@audi_Code ";
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
sc1.State_Code;
cmd.Parameters.Add("@city_Code", SqlDbType.Int).Value =
sc1.City_Code;
cmd.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value =
sc1.Multiplex_Code;
cmd.Parameters.Add("@movie_Code", SqlDbType.Int).Value =
sc1.Movies_Code;
cmd.Parameters.Add("@movieTiming_Code", SqlDbType.Int).Value =
sc1.MovieTiming_Code;
cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value =
sc1.Audi_Code;
73
cmd.Parameters.Add("@date", SqlDbType.VarChar, 50).Value =
sc1.Date;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
sc1.Platinum_Seat = "";
sc1.Gold_Seat = "";
sc1.Silver_Seat = "";
sc1.Bronze_Seat = "";
while (dr.Read())
{
sc1.Platinum_Seat = sc1.Platinum_Seat + "," +
Convert.ToString(dr["Platinum_Seat"]);
sc1.Gold_Seat = sc1.Gold_Seat + "," +
Convert.ToString(dr["Gold_Seat"]);
sc1.Silver_Seat = sc1.Silver_Seat + "," +
Convert.ToString(dr["Silver_Seat"]);
sc1.Bronze_Seat = sc1.Bronze_Seat + "," +
Convert.ToString(dr["Bronze_Seat"]);
}
}
_connectionString.Close();
return sc1;
}
//function for cancellation of booking
public void CancelBooking(booking sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
booking_Master where State_Code=@state_Code and City_Code=@city_Code
and Multiplex_Code=@multiplex_Code and Date=@Date and
Movies_Code=@movies_Code and MovieTimings_Code=@movieTimings_Code
and Audi_Code=@audi_Code", _connectionString);
74
adp.SelectCommand.Parameters.Add("@state_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code);
adp.SelectCommand.Parameters.Add("@city_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code);
adp.SelectCommand.Parameters.Add("@multiplex_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.Multiplex_Code);
adp.SelectCommand.Parameters.Add("@date", SqlDbType.VarChar,
50).Value = Convert.ToString(sc1.Date);
adp.SelectCommand.Parameters.Add("@movies_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.Movies_Code);
adp.SelectCommand.Parameters.Add("@movieTimings_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.MovieTiming_Code);
adp.SelectCommand.Parameters.Add("@audi_Code",SqlDbType.Int).Value=C
onvert.ToInt32(sc1.Audi_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//functions for Mall
//bind Mall function
public DataSet BindMall()
{
SqlDataAdapter adp = new SqlDataAdapter("select
m.Mall_Code,m.Mall_Name,s.State_Name,c.City_Name from
mallStateCity_Master as m join state_Master as s on
m.State_Code=s.State_Code join city_Master as c on
m.City_Code=c.City_Code ", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//get function for Mall
public void GetMall(mallStateCity sc1)
{
75
cmd.CommandText = ("select * from mallStateCity_master where
mallStateCity_Master.Mall_Code=@mall_Code");
cmd.Parameters.Add("@mall_Code",SqlDbType.Int).Value =
sc1.Mall_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Mall_Name = Convert.ToString(dr["Mall_Name"]);
}
_connectionString.Close();
}
//delete function for Mall
public void DelMall(int Mall_Code)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
mallStateCity_Master where Mall_Code=@mall_Code", _connectionString);
adp.SelectCommand.Parameters.Add("@mall_Code",
SqlDbType.Int).Value = Convert.ToInt32(Mall_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//paging and searching for Mall
public ResponseResult<mallStateCity> MallList(int pageNo, int
pageSize, string searchStr = "")
{
List<mallStateCity> mallList = new List<mallStateCity>();
mallStateCity Malll = null;
76
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Mall_Code )AS
rno,m.Mall_Code,s.State_Name,c.City_Name,m.Mall_Name from
mallStateCity_Master as m join city_Master as c on m.City_Code
=c.City_Code join state_Master as s on s.State_Code=m.State_Code where
Mall_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" +
pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")",
_connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
mallStateCity_Master where Mall_Name like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Malll = new mallStateCity();
Malll.Mall_Code = Convert.ToInt32(dr["Mall_Code"]);
Malll.State_Name = Convert.ToString(dr["State_Name"]);
Malll.City_Name = Convert.ToString(dr["City_Name"]);
Malll.Mall_Name = Convert.ToString(dr["Mall_Name"] + "");
mallList.Add(Malll);
}
77
}
_connectionString.Close();
ResponseResult<mallStateCity> resultMall = new
ResponseResult<mallStateCity>();
resultMall.Records = mallList;
resultMall.TotalRecords = totalRecords;
return resultMall;
}
//bind function for mall and city
public DataSet BindCityMall(mallStateCity sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
mallStateCity_Master where City_Code=@city_Code",_connectionString);
adp.SelectCommand.Parameters.Add("@city_Code",
SqlDbType.Int).Value = sc1.City_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}
//set function for Mall
public void SetMall(mallStateCity sc1)
{
try
{
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.City_Code);
cmd.Parameters.Add("@mall_Name", SqlDbType.VarChar,
50).Value = sc1.Mall_Name;
if (sc1.Mall_Code == 0)
{
78
cmd.CommandText = "insert into mallStateCity_Master
(State_Code,City_Code,Mall_Name)
values(@state_Code,@city_Code,@mall_Name)";
}
else
{
cmd.CommandText = "update mallStateCity_Master set
State_Code=@state_Code,City_Code=@city_Code, Mall_Name=@mall_Name
where Mall_Code=@mall_Code";
cmd.Parameters.Add("@mall_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Mall_Code);
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
}
//functions for shopping Complex
//bind shopping Complex function
public DataSet BindShopping_Complex()
{
SqlDataAdapter adp = new SqlDataAdapter("select
sh.Shopping_Complex_Code,sh.Shopping_Complex_Name,sh.Shopping_Co
mplex_Image,s.State_Name,c.City_Name,m.Mall_Name from
shopping_Complex_Master as sh join state_Master as s on
sh.State_Code=s.State_Code join city_Master as c on
sh.City_Code=c.City_Code join mallStateCity_Master as m on
sh.Mall_Code=m.Mall_Code",_connectionString);
79
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//get function for Shopping_Complex
public void GetShopping_Complex(shopping_Complex sc1)
{
cmd.CommandText = ("select * from shopping_Complex_master
where
shopping_Complex_Master,Shopping_Complex_Code=@shopping_Complex_
Code");
cmd.Parameters.Add("@shopping_Complex_Code",
SqlDbType.Int).Value = sc1.Shopping_Complex_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Shopping_Complex_Code =
Convert.ToInt32(dr["Shopping_Complex_Code"]);
sc1.Shopping_Complex_Name =
Convert.ToString(dr["Shopping_Complex_Name"]);
sc1.Shopping_Complex_Image =
Convert.ToString(dr["Shopping_Complex_Image"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]);
}
_connectionString.Close();
}
//delete function for Shopping Complex
public void DelShopping_Complex(int Shopping_Complex_Code)
80
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
shopping_Complex_Master where
Shopping_Complex_Code=@shopping_Complex_Code", _connectionString);
adp.SelectCommand.Parameters.Add("@shopping_Complex_Code",
SqlDbType.Int).Value = Convert.ToInt32(Shopping_Complex_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//paging and searching for Shopping Complex
public ResponseResult<shopping_Complex> Shopping_ComplexList(int
pageNo, int pageSize, string searchStr = "")
{
List<shopping_Complex> shopping_ComplexList = new
List<shopping_Complex>();
shopping_Complex Shopping_Complexx = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Shopping_Complex_Code )AS
rno,sh.Shopping_Complex_Code,sh.Shopping_Complex_Name,sh.Shopping_
Complex_Image,s.State_Name,c.City_Name,m.Mall_Name from
shopping_Complex_Master as sh join city_Master as c on sh.City_Code
=c.City_Code join state_Master as s on s.State_Code=sh.State_Code join
mallStateCity_Master as m on m.Mall_Code=sh.Mall_Code where
Shopping_Complex_Name like '%" + searchStr + "%') as t where rno>((" +
pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")",
_connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
shopping_Complex_Master where Shopping_Complex_Name like '%" +
searchStr + "%'", _connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
81
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Shopping_Complexx = new shopping_Complex();
Shopping_Complexx.Shopping_Complex_Code =
Convert.ToInt32(dr["Shopping_Complex_Code"]);
Shopping_Complexx.Shopping_Complex_Name =
Convert.ToString(dr["Shopping_Complex_Name"]);
Shopping_Complexx.Shopping_Complex_Image =
Convert.ToString(dr["Shopping_Complex_Image"]);
Shopping_Complexx.State_Name =
Convert.ToString(dr["State_Name"]);
Shopping_Complexx.City_Name =
Convert.ToString(dr["City_Name"]);
Shopping_Complexx.Mall_Name =
Convert.ToString(dr["Mall_Name"] + "");
shopping_ComplexList.Add(Shopping_Complexx);
}
}
_connectionString.Close();
ResponseResult<shopping_Complex> resultShopping_Complex =
new ResponseResult<shopping_Complex>();
resultShopping_Complex.Records= shopping_ComplexList;
resultShopping_Complex.TotalRecords = totalRecords;
return resultShopping_Complex;
}
82
//bind function for Shopping complex and mall
public DataSet BindMallShopping_Complex(shopping_Complex sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
shopping_Complex_Master where Mall_Code=@mall_Code",
_connectionString);
adp.SelectCommand.Parameters.Add("@mall_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.Mall_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}
//set function for Shopping Complex
public void SetShopping_Complex(shopping_Complex sc1)
{
try
{
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.City_Code);
cmd.Parameters.Add("@mall_Code",SqlDbType.Int).Value=Convert.ToInt32(s
c1.Mall_Code);
cmd.Parameters.Add("@shopping_Complex_Name",
SqlDbType.VarChar,50).Value = sc1.Shopping_Complex_Name;
cmd.Parameters.Add("@shopping_Complex_Image",
SqlDbType.VarChar,50).Value = sc1.Shopping_Complex_Image;
if (sc1.Shopping_Complex_Code == 0)
{
cmd.CommandText = "insert into shopping_Complex_Master
(State_Code,City_Code,Mall_Code,Shopping_Complex_Name,Shopping_Com
plex_Image)
83
values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Name,@s
hopping_Complex_Image)";
}
else
{
cmd.CommandText = "update shopping_Complex_Master set
State_Code=@state_Code,City_Code=@city_Code,
Mall_Code=@mall_Code,Shopping_Complex_Name=@shopping_Complex_Na
me,Shopping_Complex_Image=@shopping_Complex_Image where
Shopping_Complex_Code=@shopping_Complex_Code";
cmd.Parameters.Add("@shopping_Complex_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.Shopping_Complex_Code);
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
}
//functions for brand
//bind Brand function
public DataSet BindBrand()
{
SqlDataAdapter adp = new SqlDataAdapter("select
b.Brand_Code,b.Brand_Name,b.Brand_Image,sh.Shopping_Complex_Name,
s.State_Name,c.City_Name,m.Mall_Name from Brand_Master as b join
state_Master as s on b.State_Code=s.State_Code join city_Master as c on
b.City_Code=c.City_Code join mallStateCity_Master as m on
b.Mall_Code=m.Mall_Code join shopping_Complex_Master as sh on
84
b.Shopping_Complex_Code=sh.Shopping_Complex_Code",
_connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//get function for Brand
public void GetBrand(brand sc1)
{
cmd.CommandText = ("select * from brand_master where
brand_Master.Brand_Code=@brand_Code");
cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value =
sc1.Brand_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Brand_Code = Convert.ToInt32(dr["Brand_Code"]);
sc1.Brand_Name = Convert.ToString(dr["Brand_Name"]);
sc1.Brand_Image = Convert.ToString(dr["Brand_Image"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]);
sc1.Shopping_Complex_Code =
Convert.ToInt32(dr["Shopping_Complex_Code"]);
}
_connectionString.Close();
}
//delete function for Brand
public void DelBrand(int Brand_Code)
{
85
SqlDataAdapter adp = new SqlDataAdapter("delete from
brand_Master where Brand_Code=@brand_Code", _connectionString);
adp.SelectCommand.Parameters.Add("@brand_Code",
SqlDbType.Int).Value = Convert.ToInt32(Brand_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//paging and searching for Brand
public ResponseResult<brand> BrandList(int pageNo, int pageSize,
string searchStr = "")
{
List<brand> brandList = new List<brand>();
brand Brandd = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Brand_Code )AS
rno,b.Brand_Code,b.Brand_Name,b.Brand_Image,sh.Shopping_Complex_Na
me,s.State_Name,c.City_Name,m.Mall_Name from brand_Master as b join
city_Master as c on b.City_Code =c.City_Code join state_Master as s on
b.State_Code=s.State_Code join mallStateCity_Master as m on
m.Mall_Code=b.Mall_Code join shopping_Complex_Master as sh on
sh.Shopping_Complex_Code=b.Shopping_Complex_Code where
Brand_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*"
+ pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")",
_connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
brand_Master where Brand_Name like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
86
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Brandd = new brand();
Brandd.Brand_Code = Convert.ToInt32(dr["Brand_Code"]);
Brandd.Brand_Name = Convert.ToString(dr["Brand_Name"]);
Brandd.Brand_Image = Convert.ToString(dr["Brand_Image"]);
Brandd.State_Name = Convert.ToString(dr["State_Name"]);
Brandd.City_Name = Convert.ToString(dr["City_Name"]);
Brandd.Mall_Name = Convert.ToString(dr["Mall_Name"] + "");
Brandd.Shopping_Complex_Name =
Convert.ToString(dr["Shopping_Complex_Name"]);
brandList.Add(Brandd);
}
}
_connectionString.Close();
ResponseResult<brand> resultBrand = new
ResponseResult<brand>();
resultBrand.Records = brandList;
resultBrand.TotalRecords= totalRecords;
return resultBrand;
}
//bind function for Shopping complex and brand
public DataSet BindShopping_ComplexBrand(brand sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
brand_Master where Shopping_Complex_Code=@shopping_Complex_Code",
_connectionString);
87
adp.SelectCommand.Parameters.Add("@shopping_Complex_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.Shopping_Complex_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}
//set function for Shopping Complex
public void SetBrand(brand sc1)
{
try
{
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.City_Code);
cmd.Parameters.Add("@mall_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Mall_Code);
cmd.Parameters.Add("@shopping_Complex_Code",SqlDbType.Int).Value=Co
nvert.ToInt32(sc1.Shopping_Complex_Code);
cmd.Parameters.Add("@brand_Name", SqlDbType.VarChar,
50).Value = sc1.Brand_Name;
cmd.Parameters.Add("@brand_Image", SqlDbType.VarChar,
50).Value = sc1.Brand_Image;
if (sc1.Brand_Code == 0)
{
cmd.CommandText = "insert into brand_Master
(State_Code,City_Code,Mall_Code,Shopping_Complex_Code,Brand_Name,Br
and_Image)
values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Code,@br
and_Name,@brand_Image)";
}
else
{
88
cmd.CommandText = "update brand_Master set
State_Code=@state_Code,City_Code=@city_Code,
Mall_Code=@mall_Code,Shopping_Complex_Code=@shopping_Complex_Cod
e,Brand_Name=@brand_Name,Brand_Image=@brand_Image where
Brand_Code=@brand_Code";
cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Brand_Code);
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
}
//functions for sale
//bind Sale function
public DataSet BindSale()
{
SqlDataAdapter adp = new SqlDataAdapter("select
sa.Sale_Code,sa.Sale_Percent,sa.Start_Date,sa.End_Date,b.Brand_Name,sh.
Shopping_Complex_Name,s.State_Name,c.City_Name,m.Mall_Name from
sale_Master as sa join state_Master as s on sa.State_Code=s.State_Code
join city_Master as c on sa.City_Code=c.City_Code join
mallStateCity_Master as m on sa.Mall_Code=m.Mall_Code join
shopping_Complex_Master as sh on
sa.Shopping_Complex_Code=sh.Shopping_Complex_Code join
brand_Master as b on sa.Brand_Code=b.Brand_Code", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
89
return (ds);
}
//get function for Sale
public void GetSale(sale sc1)
{
cmd.CommandText = ("select * from sale_master where
sale_Master.Sale_Code=@sale_Code");
cmd.Parameters.Add("@sale_Code",SqlDbType.Int).Value =
sc1.Sale_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Sale_Code = Convert.ToInt32(dr["Sale_Code"]);
sc1.Sale_Percent = Convert.ToString(dr["Sale_Percent"]);
sc1.Start_Date = Convert.ToString(dr["Start_Date"]);
sc1.End_Date = Convert.ToString(dr["End_Date"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]);
sc1.Shopping_Complex_Code =
Convert.ToInt32(dr["Shopping_Complex_Code"]);
sc1.Brand_Code = Convert.ToInt32(dr["Brand_Code"]);
}
_connectionString.Close();
}
//delete function for Sale
public void DelSale(int Sale_Code)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
sale_Master where Sale_Code=@sale_Code", _connectionString);
90
adp.SelectCommand.Parameters.Add("@sale_Code",
SqlDbType.Int).Value = Convert.ToInt32(Sale_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
//paging and searching for Sale
public ResponseResult<sale> SaleList(int pageNo, int pageSize, string
searchStr = "")
{
List<sale> saleList = new List<sale>();
sale Salee = null;
int totalRecords;
_connectionString.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Sale_Code )AS
rno,sa.Sale_Code,sa.Sale_Percent,sa.Start_Date,sa.End_Date,b.Brand_Nam
e,sh.Shopping_Complex_Name,s.State_Name,c.City_Name,m.Mall_Name
from sale_Master as sa join city_Master as c on sa.City_Code =c.City_Code
join state_Master as s on sa.State_Code=s.State_Code join
mallStateCity_Master as m on m.Mall_Code=sa.Mall_Code join
shopping_Complex_Master as sh on
sh.Shopping_Complex_Code=sa.Shopping_Complex_Code join
brand_Master as b on sa.Brand_Code=b.Brand_Code where Sale_Percent
like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize +
") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
sale_Master where Sale_Percent like '%" + searchStr + "%'",
_connectionString);
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
91
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Salee = new sale();
Salee.Sale_Code = Convert.ToInt32(dr["Sale_Code"]);
Salee.Sale_Percent = Convert.ToString(dr["Sale_Percent"]);
Salee.Start_Date = Convert.ToString(dr["Start_Date"]);
Salee.End_Date = Convert.ToString(dr["End_Date"]);
Salee.State_Name = Convert.ToString(dr["State_Name"]);
Salee.City_Name = Convert.ToString(dr["City_Name"]);
Salee.Mall_Name = Convert.ToString(dr["Mall_Name"] + "");
Salee.Shopping_Complex_Name =
Convert.ToString(dr["Shopping_Complex_Name"]);
Salee.Brand_Name = Convert.ToString(dr["Brand_Name"]);
saleList.Add(Salee);
}
}
_connectionString.Close();
ResponseResult<sale> resultSale = new ResponseResult<sale>();
resultSale.Records = saleList;
resultSale.TotalRecords = totalRecords;
return resultSale;
}
//bind function for brand and sale
public DataSet BindBrandSale(sale sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
sale_Master where Brand_Code=@brand_Code", _connectionString);
92
adp.SelectCommand.Parameters.Add("@brand_Code",
SqlDbType.Int).Value = sc1.Brand_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}
//set function for Shopping Complex
public void SetSale(sale sc1)
{
try
{
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.State_Code);
cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value =
Convert.ToInt32(sc1.City_Code);
cmd.Parameters.Add("@mall_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Mall_Code);
cmd.Parameters.Add("@shopping_Complex_Code",
SqlDbType.Int).Value = Convert.ToInt32(sc1.Shopping_Complex_Code);
cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Brand_Code);
cmd.Parameters.Add("@sale_Percent", SqlDbType.VarChar,
50).Value = Convert.ToString(sc1.Sale_Percent);
cmd.Parameters.Add("@start_Date",SqlDbType.VarChar,
50).Value = Convert.ToString(sc1.Start_Date);
cmd.Parameters.Add("@end_Date", SqlDbType.VarChar,
50).Value = Convert.ToString(sc1.End_Date);
if (sc1.Sale_Code == 0)
{
cmd.CommandText = "insert into sale_Master
(State_Code,City_Code,Mall_Code,Shopping_Complex_Code,Brand_Code,Sal
e_Percent,Start_Date,End_Date)
93
values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Code,@br
and_Code,@sale_Percent,@start_Date,@end_Date)";
}
else
{
cmd.CommandText = "update brand_Master set
State_Code=@state_Code,City_Code=@city_Code,
Mall_Code=@mall_Code,Shopping_Complex_Code=@shopping_Complex_Cod
e,Brand_Code=@brand_Code,Sale_Percent=@sale_Percent,Start_Date=@star
t_Date,End_Date=@end_Date where Sale_Code=@sale_Code";
cmd.Parameters.Add("@sale_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Sale_Code);
}
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
}
//function to bind radio buttonlists
//bind mall radio list
public DataSet BindRMall(mallStateCity sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select
Mall_Name,Mall_Code from mallStateCity_Master where
State_Code=@state_Code and City_Code=@city_Code",_connectionString);
adp.SelectCommand.Parameters.Add("@state_Code",
SqlDbType.Int).Value = sc1.State_Code;
94
adp.SelectCommand.Parameters.Add("@city_Code",
SqlDbType.Int).Value = sc1.City_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//bind shopping complex radio list
public DataSet BindRShopping_Complex(shopping_Complex sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select
Shopping_Complex_Name,Shopping_Complex_Code from
shopping_Complex_Master where State_Code=@state_Code and
City_Code=@city_Code and Mall_Code=@mall_Code",_connectionString);
adp.SelectCommand.Parameters.Add("@state_Code",
SqlDbType.Int).Value = sc1.State_Code;
adp.SelectCommand.Parameters.Add("@city_Code",
SqlDbType.Int).Value = sc1.City_Code;
adp.SelectCommand.Parameters.Add("@mall_Code",
SqlDbType.Int).Value = sc1.Mall_Code;
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//bind radio list brand
public DataSet BindRBrand(brand sc1)
{
SqlDataAdapter adp = new SqlDataAdapter("select
Brand_Name,Brand_Code from brand_Master where
State_Code=@state_Code and City_Code=@city_Code and
Mall_Code=@mall_Code and
Shopping_Complex_Code=@shopping_Complex_Code", _connectionString);
adp.SelectCommand.Parameters.Add("@state_Code",
SqlDbType.Int).Value = sc1.State_Code;
95
adp.SelectCommand.Parameters.Add("@city_Code",
SqlDbType.Int).Value = sc1.City_Code;
adp.SelectCommand.Parameters.Add("@mall_Code",
SqlDbType.Int).Value = sc1.Mall_Code;
adp.SelectCommand.Parameters.Add("@shopping_Complex_Code",
SqlDbType.Int).Value = sc1.Shopping_Complex_Code ;
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//function for data list
public DataSet BindDlistBrand()
{
SqlDataAdapter adp = new SqlDataAdapter("select
b.Brand_Name,b.Brand_Image,b.Brand_Code,s.State_Name,c.City_Name,sh
.Shopping_Complex_Name,m.Mall_Name from brand_Master as b join
state_Master as s on b.State_Code=s.State_Code join city_Master as c on
b.City_Code=c.City_Code join mallStateCity_Master as m on
b.Mall_Code=m.Mall_Code join shopping_Complex_Master as sh on
b.Shopping_Complex_Code=sh.Shopping_Complex_Code",
_connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
//function to bind details of brands in detail view
public void BindDlistBrandDetails(brand sc1)
{
cmd.CommandText =("select
b.Brand_Name,b.Brand_Image,b.Brand_Code,s.State_Name,c.City_Name,sh
.Shopping_Complex_Name,m.Mall_Name from brand_Master as b join
state_Master as s on b.State_Code=s.State_Code join city_Master as c on
b.City_Code=c.City_Code join mallStateCity_Master as m on
96
b.Mall_Code=m.Mall_Code join shopping_Complex_Master as sh on
b.Shopping_Complex_Code=sh.Shopping_Complex_Code where
Brand_Code=@brand_Code");
cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value =
sc1.Brand_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Brand_Code = Convert.ToInt32(dr["Brand_Code"]);
sc1.Brand_Image = Convert.ToString(dr["Brand_Image"]);
sc1.Brand_Name = Convert.ToString(dr["Brand_Name"]);
sc1.State_Name = Convert.ToString(dr["State_Name"]);
sc1.City_Name = Convert.ToString(dr["City_Name"]);
sc1.Mall_Name = Convert.ToString(dr["Mall_Name"]);
sc1.Shopping_Complex_Name =
Convert.ToString(dr["Shopping_Complex_Name"]);;
}
_connectionString.Close();
}
//function to get start and end date of sale
public void Filter_Sale(sale sc1)
{
cmd.CommandText = ("select Start_Date,End_Date from
sale_Master where State_Code=@state_Code and City_Code=@city_Code and
Mall_Code=@mall_Code and
Shopping_Complex_Code=@shopping_Complex_Code and
Brand_Code=@brand_Code and Sale_Percent=@sale_Percent");
cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value =
sc1.State_Code;
97
cmd.Parameters.Add("@city_Code", SqlDbType.Int).Value =
sc1.City_Code;
cmd.Parameters.Add("@mall_Code",SqlDbType.Int).Value =
sc1.Mall_Code;
cmd.Parameters.Add("@shopping_Complex_Code",
SqlDbType.Int).Value = sc1.Shopping_Complex_Code;
cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value =
sc1.Brand_Code;
cmd.Parameters.Add("@sale_Percent", SqlDbType.VarChar,
50).Value = Convert.ToString(sc1.Sale_Percent);
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Start_Date = Convert.ToString(dr["Start_Date"]);
sc1.End_Date = Convert.ToString(dr["End_Date"]);
}
_connectionString.Close();
}
//code to add Managers
public void SubmitManager(addManager sc1)
{
try
{
if (sc1.Manager_Code == 0)
{
cmd.CommandText = "insert into addManager_Master
values(@Manager_Name,@Email_Id,@Password,@Phone_No,@State_Code,@
City_Code,@Multiplex_Code)";
}
else
98
{
cmd.CommandText = "update addManager_Master set
Manager_Name=@Manager_Name,Email_Id=@Email_Id,Password=@Passwor
d,Phone_No=@Phone_No,State_Code=@State_Code,City_Code=@City_Code,
Multiplex_Code=@Multiplex_Code where Manager_Code=@Manager_Code";
cmd.Parameters.Add("@Manager_Code", SqlDbType.Int).Value
= Convert.ToInt32(sc1.Manager_Code);
}
cmd.Parameters.Add("@Manager_Name",
SqlDbType.VarChar).Value = sc1.Manager_Name;
cmd.Parameters.Add("@Email_Id", SqlDbType.VarChar, 50).Value
= sc1.Email_Id;
cmd.Parameters.Add("@Password", SqlDbType.VarChar,
50).Value = sc1.Password;
cmd.Parameters.Add("@Phone_No",SqlDbType.VarChar,
50).Value = sc1.Phone_No;
cmd.Parameters.Add("@State_Code", SqlDbType.Int).Value =
sc1.State_Code;
cmd.Parameters.Add("@City_Code", SqlDbType.Int).Value =
sc1.City_Code;
cmd.Parameters.Add("@Multiplex_Code", SqlDbType.Int).Value =
sc1.Multiplex_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
}
public DataSet BindManager()
99
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
addManager_Master ", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
public void GetManagerSCMWise(addManager sc1)
{
cmd.CommandText = ("select State_Code,City_Code,Multiplex_code
from addManager_Master where Email_Id=@Email_Id ");
cmd.Parameters.Add("@Email_Id", SqlDbType.Int).Value =
sc1.Email_Id;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]);
}
_connectionString.Close();
}
public void DeleteManager(int Manager_Code)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
addManager_Master where Manager_Code=@Manager_Code",
_connectionString);
adp.SelectCommand.Parameters.Add("@Manager_Code",
SqlDbType.Int).Value = Convert.ToInt32(Manager_Code);
DataSet ds = new DataSet();
adp.Fill(ds);
100
}
public void GetManager(addManager sc1)
{
cmd.CommandText = ("select * from addManager_Master where
Manager_Code=@Manager_Code");
cmd.Parameters.Add("@Manager_Code",SqlDbType.Int).Value =
sc1.Manager_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Manager_Name = Convert.ToString(dr["Manager_Name"]);
sc1.Email_Id = Convert.ToString(dr["Email_Id"]);
sc1.Password = Convert.ToString(dr["Password"]);
sc1.Phone_No = Convert.ToString(dr["Phone_No"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]);
}
_connectionString.Close();
}
public ResponseResult<addManager> ManagerList(int pageNo, int
pageSize, string searchStr = "")
{
List<addManager> ManagerList = new List<addManager>();
addManager mngr = null;
int totalRecords;
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Manager_Code )AS rno, * from
addManager_Master where Manager_Name like '%" + searchStr + "%') as t
101
where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*"
+ pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
addManager_Master where Manager_Name like '%" + searchStr + "%'",
_connectionString);
_connectionString.Open();
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
mngr = new addManager();
mngr.Manager_Code = Convert.ToInt32(dr["Manager_Code"]);
mngr.Manager_Name = (dr["Manager_Name"] + " ");
mngr.Email_Id = (dr["Email_Id"] + " ");
mngr.Password = (dr["Password"] + " ");
mngr.Phone_No = (dr["Phone_No"] + " ");
mngr.State_Code = Convert.ToInt32(dr["State_Code"] + "");
mngr.City_Code = Convert.ToInt32(dr["City_Code"] + "");
mngr.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"] +
"");
ManagerList.Add(mngr);
}
}
_connectionString.Close();
102
ResponseResult<addManager> resultmanager = new
ResponseResult<addManager>();
resultmanager.Records= ManagerList;
resultmanager.TotalRecords= totalRecords;
return resultmanager;
}
//Code To add Employee
public void SubmitEmployee(employee sc1)
{
try
{
if (sc1.Emp_Code == 0)
{
cmd.CommandText = "insert into employee_Master
values(@Employee_Name,@Email_Id,@Password,@Phone_No,@Date_Of_Join
ing,@State_Code,@City_Code,@Multiplex_Code)";
}
else
{
cmd.CommandText = "update employee_Master set
Employee_Name=@Employee_Name,Email_Id=@Email_Id,Password=@Passw
ord,Phone_No=@Phone_No,Date_Of_Joining=@Date_Of_Joining,State_Code=
@State_Code,City_Code=@City_Code,Multiplex_Code=@Multiplex_Code
where Emp_Code=@Emp_Code";
cmd.Parameters.Add("@Emp_Code", SqlDbType.Int).Value =
Convert.ToInt32(sc1.Emp_Code);
}
cmd.Parameters.Add("@Employee_Name",
SqlDbType.VarChar).Value = sc1.Employee_Name;
cmd.Parameters.Add("@Email_Id", SqlDbType.VarChar, 50).Value
= sc1.Email_Id;
cmd.Parameters.Add("@Password", SqlDbType.VarChar,
50).Value = sc1.Password;
103
cmd.Parameters.Add("@Phone_No",SqlDbType.VarChar,
50).Value = sc1.Phone_No;
cmd.Parameters.Add("@Date_Of_Joining",SqlDbType.VarChar,
50).Value = sc1.Date_Of_Joining;
cmd.Parameters.Add("@State_Code", SqlDbType.Int).Value =
sc1.State_Code;
cmd.Parameters.Add("@City_Code", SqlDbType.Int).Value =
sc1.City_Code;
cmd.Parameters.Add("@Multiplex_Code", SqlDbType.Int).Value =
sc1.Multiplex_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
}
catch (Exception ex)
{
throw ex;
}
}
public DataSet BindEmployee()
{
SqlDataAdapter adp = new SqlDataAdapter("select * from
employee_Master ", _connectionString);
DataSet ds = new DataSet();
adp.Fill(ds);
return (ds);
}
public void DeleteEmployee(int code)
{
SqlDataAdapter adp = new SqlDataAdapter("delete from
employee_Master where Emp_Code=@Emp_Code", _connectionString);
104
adp.SelectCommand.Parameters.Add("@Emp_Code",
SqlDbType.Int).Value = Convert.ToInt32(code);
DataSet ds = new DataSet();
adp.Fill(ds);
}
public void GetEmployee(employee sc1)
{
cmd.CommandText = ("select * from employee_Master where
Emp_Code=@Emp_Code");
cmd.Parameters.Add("@Emp_Code", SqlDbType.Int).Value =
sc1.Emp_Code;
_connectionString.Open();
cmd.Connection = _connectionString;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
sc1.Employee_Name = Convert.ToString(dr["Employee_Name"]);
sc1.Email_Id = Convert.ToString(dr["Email_Id"]);
sc1.Password = Convert.ToString(dr["Password"]);
sc1.Phone_No = Convert.ToString(dr["Phone_No"]);
sc1.Date_Of_Joining =
Convert.ToDateTime(dr["Date_Of_Joining"]);
sc1.State_Code = Convert.ToInt32(dr["State_Code"]);
sc1.City_Code = Convert.ToInt32(dr["City_Code"]);
sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]);
}
_connectionString.Close();
}
public ResponseResult<employee> EmployeeList(int pageNo, int
pageSize, string searchStr = "")
{
List<employee> EmployeeList = new List<employee>();
105
employee emp= null;
int totalRecords;
SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY Emp_Code )AS rno,* from
employee_Master where Employee_Name like '%" + searchStr + "%') as t
where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*"
+ pageSize + ")", _connectionString);
SqlCommand cmd1 = new SqlCommand("select COUNT(*) from
employee_Master where Employee_Name like '%" + searchStr + "%'",
_connectionString);
_connectionString.Open();
totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
cmd.CommandType = CommandType.Text;
cmd1.CommandType = CommandType.Text;
cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
cmd.Parameters.Add("@searchString",SqlDbType.VarChar,
50).Value = searchStr;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
emp = new employee();
emp.Emp_Code = Convert.ToInt32(dr["Emp_code"] + "");
emp.Employee_Name = (dr["Employee_Name"] + " ");
emp.Email_Id = (dr["Email_Id"] + " ");
emp.Password = (dr["Password"] + " ");
emp.Phone_No = (dr["Phone_No"] + " ");
emp.Date_Of_Joining =
Convert.ToDateTime((dr["Date_Of_Joining"] + " "));
emp.State_Code = Convert.ToInt32(dr["State_Code"] + " ");
emp.City_Code = Convert.ToInt32(dr["City_Code"] + " ");
106
emp.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"] +
" ");
EmployeeList.Add(emp);
}
}
_connectionString.Close();
ResponseResult<employee> resultemployee = new
ResponseResult<employee>();
resultemployee.Records= EmployeeList;
resultemployee.TotalRecords = totalRecords;
return resultemployee;
}
public void SubmitAttendenceIn(attendenceTimeIn sc1)
{
try
{
cmd.CommandText = "insert into attendenceTimeIn_Master
(Emp_Code,Date,TimeIn) values(@Emp_Code,@Date,@TimeIn)";
cmd.Parameters.Add("@Emp_Code", SqlDbType.Int).Value =
sc1.Emp_Code;
cmd.Parameters.Add("@Date", SqlDbType.VarChar, 50).Value =
sc1.Date;
cmd.Parameters.Add("@TimeIn", SqlDbType.VarChar).Value =
sc1.TimeIn;
_connectionString.Open();
cmd.Connection= _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
cmd.Dispose();
}
catch (Exception ex)
{
throw ex;
107
}
}
public void SubmitAttendenceOut(attendenceTimeOut sc1)
{
try
{
cmd.CommandText = "insert into attendenceTimeOut_Master
(Emp_Code,Date,TimeOut) values(@Emp_Code1,@Date1,@TimeIn1)";
cmd.Parameters.Add("@Emp_Code1", SqlDbType.Int).Value =
sc1.Emp_Code;
cmd.Parameters.Add("@Date1", SqlDbType.VarChar, 50).Value =
sc1.Date;
cmd.Parameters.Add("@TimeIn1", SqlDbType.VarChar).Value =
sc1.TimeOut;
_connectionString.Open();
cmd.Connection= _connectionString;
cmd.ExecuteNonQuery();
_connectionString.Close();
cmd.Dispose();
}
catch (Exception ex)
{
throw ex;
}
}
public DataSet BindAttendence()
{
SqlDataAdapter adp = new SqlDataAdapter("select
attendenceTimeIn_Master.TimeIn_Code,attendenceTimeIn_Master.TimeIn,
attendenceTimeOut_Master.TimeOut from attendenceTimeOut_Master join
attendenceTimeIn_Master on
attendenceTimeOut_Master.Date=attendenceTimeIn_Master.Date",
_connectionString);
Project report on multiplex management system
Project report on multiplex management system
Project report on multiplex management system
Project report on multiplex management system
Project report on multiplex management system
Project report on multiplex management system

More Related Content

What's hot

Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation System
Priyanka Sharma
 
Epics and User Stories
Epics and User StoriesEpics and User Stories
Epics and User Stories
Milind Gokhale
 

What's hot (20)

Final year project presentation
Final year project presentationFinal year project presentation
Final year project presentation
 
Airline management system
Airline management systemAirline management system
Airline management system
 
Project black book TYIT
Project black book TYITProject black book TYIT
Project black book TYIT
 
Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation System
 
Computer Graphics 471 Project Report Final
Computer Graphics 471 Project Report FinalComputer Graphics 471 Project Report Final
Computer Graphics 471 Project Report Final
 
Project presentation FPS
Project presentation FPSProject presentation FPS
Project presentation FPS
 
Placement management system
Placement management systemPlacement management system
Placement management system
 
online movie ticket booking system
online movie ticket booking systemonline movie ticket booking system
online movie ticket booking system
 
Fingerprint Authentication for ATM
Fingerprint Authentication for ATMFingerprint Authentication for ATM
Fingerprint Authentication for ATM
 
Hospital Management System SRS
Hospital Management System SRSHospital Management System SRS
Hospital Management System SRS
 
Seminar report on augmented and virtual reality
Seminar report on augmented and virtual realitySeminar report on augmented and virtual reality
Seminar report on augmented and virtual reality
 
Movie Ticket Booking Website Project Presentation
Movie Ticket Booking Website Project PresentationMovie Ticket Booking Website Project Presentation
Movie Ticket Booking Website Project Presentation
 
PPT FOR ONLINE HOTEL MANAGEMENT
PPT FOR ONLINE HOTEL MANAGEMENTPPT FOR ONLINE HOTEL MANAGEMENT
PPT FOR ONLINE HOTEL MANAGEMENT
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation system
 
Restaurant management presentation
Restaurant management presentationRestaurant management presentation
Restaurant management presentation
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android application
 
Attendance management system project report.
Attendance management system project report.Attendance management system project report.
Attendance management system project report.
 
Hotel+management+system
Hotel+management+systemHotel+management+system
Hotel+management+system
 
Hotel management system
Hotel management systemHotel management system
Hotel management system
 
Epics and User Stories
Epics and User StoriesEpics and User Stories
Epics and User Stories
 

Viewers also liked

Multiplex Management
Multiplex ManagementMultiplex Management
Multiplex Management
Zalpa Rathod
 
Online movie ticket booking
Online movie ticket bookingOnline movie ticket booking
Online movie ticket booking
mrinnovater007
 
Colour temperature
Colour temperatureColour temperature
Colour temperature
Kieran Ryan
 
Trevel presentation
Trevel presentationTrevel presentation
Trevel presentation
indra Kishor
 
Co relation between dfd & event table
Co relation between dfd & event tableCo relation between dfd & event table
Co relation between dfd & event table
Laxman Puri
 

Viewers also liked (20)

Multiplex Management
Multiplex ManagementMultiplex Management
Multiplex Management
 
Literature final
Literature finalLiterature final
Literature final
 
Thesis presentation 2013
Thesis presentation 2013Thesis presentation 2013
Thesis presentation 2013
 
Online movie ticket booking
Online movie ticket bookingOnline movie ticket booking
Online movie ticket booking
 
Colour temperature
Colour temperatureColour temperature
Colour temperature
 
Case study-29 nov
Case study-29 novCase study-29 nov
Case study-29 nov
 
Trevel presentation
Trevel presentationTrevel presentation
Trevel presentation
 
Hindustan Aeronautics Limited
Hindustan Aeronautics LimitedHindustan Aeronautics Limited
Hindustan Aeronautics Limited
 
Co relation between dfd & event table
Co relation between dfd & event tableCo relation between dfd & event table
Co relation between dfd & event table
 
Online booking system for car rental companies - Bespoke Car Rental Booking E...
Online booking system for car rental companies - Bespoke Car Rental Booking E...Online booking system for car rental companies - Bespoke Car Rental Booking E...
Online booking system for car rental companies - Bespoke Car Rental Booking E...
 
Online Bus Service
Online Bus ServiceOnline Bus Service
Online Bus Service
 
Major2ppt
Major2pptMajor2ppt
Major2ppt
 
Medical Store Management System Software Engineering 1
Medical Store Management System Software Engineering 1Medical Store Management System Software Engineering 1
Medical Store Management System Software Engineering 1
 
Online career building sites se report
Online career building sites se reportOnline career building sites se report
Online career building sites se report
 
Uid management-system
Uid management-systemUid management-system
Uid management-system
 
Multiplexes ppt (Mall Management)
Multiplexes   ppt (Mall Management)Multiplexes   ppt (Mall Management)
Multiplexes ppt (Mall Management)
 
BYS Report
BYS ReportBYS Report
BYS Report
 
Hospitality service design
Hospitality service designHospitality service design
Hospitality service design
 
ppt on stock management in medical store using php
ppt on stock management in medical store using phpppt on stock management in medical store using php
ppt on stock management in medical store using php
 
Railway booking & management system
Railway booking & management systemRailway booking & management system
Railway booking & management system
 

Similar to Project report on multiplex management system

BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECTBOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
Ravi Teja P
 
K N Avinash_ MBA_ BA
K N Avinash_ MBA_ BAK N Avinash_ MBA_ BA
K N Avinash_ MBA_ BA
avinashmba
 
Operation Maintenance Training Simulator (OMTS)
Operation Maintenance Training Simulator (OMTS)Operation Maintenance Training Simulator (OMTS)
Operation Maintenance Training Simulator (OMTS)
vls_omts
 
S_Hariharan_profile_26052016
S_Hariharan_profile_26052016S_Hariharan_profile_26052016
S_Hariharan_profile_26052016
Hariharan S
 
CONTENT MANAGEMENT SYSTEM nw
CONTENT MANAGEMENT SYSTEM nwCONTENT MANAGEMENT SYSTEM nw
CONTENT MANAGEMENT SYSTEM nw
Rana Harsh
 
Project on lead generation and sales
Project on lead generation and salesProject on lead generation and sales
Project on lead generation and sales
Sushant Kohli
 

Similar to Project report on multiplex management system (20)

REport Fle.pdf
REport Fle.pdfREport Fle.pdf
REport Fle.pdf
 
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECTBOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
 
K N Avinash_ MBA_ BA
K N Avinash_ MBA_ BAK N Avinash_ MBA_ BA
K N Avinash_ MBA_ BA
 
Project report
Project report Project report
Project report
 
Operation Maintenance Training Simulator (OMTS)
Operation Maintenance Training Simulator (OMTS)Operation Maintenance Training Simulator (OMTS)
Operation Maintenance Training Simulator (OMTS)
 
Janakiraman_Apr2016_3SF
Janakiraman_Apr2016_3SFJanakiraman_Apr2016_3SF
Janakiraman_Apr2016_3SF
 
Omkar_Resume
Omkar_ResumeOmkar_Resume
Omkar_Resume
 
Resume
ResumeResume
Resume
 
Blue book
Blue bookBlue book
Blue book
 
LunchBox:- A Web And Mobile Application
LunchBox:- A Web And Mobile ApplicationLunchBox:- A Web And Mobile Application
LunchBox:- A Web And Mobile Application
 
S_Hariharan_profile_26052016
S_Hariharan_profile_26052016S_Hariharan_profile_26052016
S_Hariharan_profile_26052016
 
Software development life cycle copy
Software development life cycle   copySoftware development life cycle   copy
Software development life cycle copy
 
KVD_Prasad_Profile
KVD_Prasad_ProfileKVD_Prasad_Profile
KVD_Prasad_Profile
 
CONTENT MANAGEMENT SYSTEM nw
CONTENT MANAGEMENT SYSTEM nwCONTENT MANAGEMENT SYSTEM nw
CONTENT MANAGEMENT SYSTEM nw
 
Saurabh Malhotra-CV
Saurabh Malhotra-CVSaurabh Malhotra-CV
Saurabh Malhotra-CV
 
EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...
EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...
EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...
 
EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...
EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...
EFFICIENT AND RELIABLE PERFORMANCE OF A GOAL QUESTION METRICS APPROACH FOR RE...
 
Project on lead generation and sales
Project on lead generation and salesProject on lead generation and sales
Project on lead generation and sales
 
A CASE Lab Report - Project File on "ATM - Banking System"
A CASE Lab Report - Project File on  "ATM - Banking System"A CASE Lab Report - Project File on  "ATM - Banking System"
A CASE Lab Report - Project File on "ATM - Banking System"
 
Biplab kundu resume
Biplab kundu resumeBiplab kundu resume
Biplab kundu resume
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Project report on multiplex management system

  • 1. 0 Project Report On MULTIPLEX MANAGEMENT SYSTEM Submitted in fulfillment of the requirement for the award of the degree of Master of Computer Applications (Batch 2011 - 2014) By Savita Kumari (1311710) Under the Supervision of Mr. Munishwar Rai M.M. Institute of Computer Technology & Business Management Maharishi Markandeshwar University, Mullana (Ambala) May 2014
  • 2. 1 CANDIDATE'S DECLARATION I hereby declare that the work which is being presented in this project entitled "Multiplex Management System" , in partial fulfillment of the requirement for the award of the degree of MCA, submitted at M.M.Institute of Computer Technology & Bussiness Management, Maharishi Markandeshwar University, Mullana , Ambala is an authentic work done by me , during the period 03 Jan 2014 to 16 May 2014 under the guidance of Mr. Munishwar Rai. The work presented in this project report has not been submitted by me for the award of any other degree of this or any other Institute or University. SAVITA KUMARI (1311710) This is to certify that the above declaration made by the candidate is correct to best of my knowledge and belief. Date: Mr. Munishwar Rai Place: (Associate Professor)
  • 3. 2 ACKNOWLEDGEMENT The satisfaction that accompanies that the successful completion of any task would be incomplete without the mention of people whose ceaseless cooperation made it possible, whose constant guidance and encouragement crown all efforts with success. My heartfelt gratitude goes to the principle, Dr. Dimple Juneja ,for giving me this opportunity to work for the project and also for constant encouragement. Every possible effort is dedicated to my internal supervisor Mr. Munishwar Rai ( Associate Professor ) for giving me a new significance to our endowment regarding this project. I am highly indebted for their gestures, invaluable suggested and boosting confidence to make this successful. I am thankful to the entire Team of Logic Erp who were a great source of information and knowledge for me and for their endless cooperation that they had showed to me. With all these , I am highly thankful to my project guide and trainee head Ms. Rajvinder Kaur at Logic Erp for the guidance, inspiration and constructive suggestion that helped me in the preparation of this project . I dedicate my whole efforts and success in this project to my parents and friends who assisted me with all kind of moral as well as monetary support throughout my project work. Savita Kumari 1311710
  • 4. 3 ABSTRACT The main objective of this software is to reduce the work load of the owner of the Multiplex. To make it possible for the users to view the various Brands available in the Mall and to check the Sale duration and amount on the Brands if exist. Using this software owner can easily check and evaluate everything running in the Multiplex and users can get information's about the Brands and Sale% . The Multiplex Management System Software performs all the operations and task online like :  Booking and Cancellation of tickets.  Screen and Movie Management.  Handling database and track records.  Managing employee databases.  Showing various Malls and Brands.  Listing the Sale duration and Sale% on Brands. With all the above task it reduces the occurrence of error rates of the multiplex system with a facility of listing all Brands of Multiplex and Sale on them and hence making the Multiplex System more successful.
  • 5. 4 LIST OF FIGURE S.No. Figure Heading Page No. 1. 2.0 SDLC Phases 10 2. 3.3.1 Incremental Level 12 3. 4.1.2.1 0 Level DFD 24 4. 4.1.2.2 Level 1 DFD 25 5. 4.1.2.3 Context Level DFD 26 6. 4.2.2.1 ER Diagram 28 7. 4.1.0 System Analysis 29 8. 4.1.2.1 Login Home Page 30 9. 4.1.2.2 Login Page 30 10. 4.1.2.3 Admin Home Page 31 11. 4.1.2.4 Admin State form Page To Add States 31 12. 4.1.2.5 Admin City form To Add Cities 32 13. 4.1.2.6 Admin Multiplex Page To Add Multiplex 32 14. 4.1.2.7 Admin Multiplex Page To Add Movies 33 15. 4.1.2.8 Admin Page For Adding Movie 33 16. 4.1.2.9 Admin Page For Adding Movie Timings 34 17. 4.1.2.10 Admin Page for Gallery 34 18. 4.1.2.11 Admin Page For Editing the Image 35 29. 4.1.2.12 Admin Page for Adding Malls 35 20. 4.1.2.13 Admin Page for Adding Shopping Malls 36 21. 4.1.2.14 Admin Page for Adding Brands 36 22. 4.1.2.15 Admin Page for Displaying Sales 37 23. 4.1.2.16 User Registration Page 37 24. 4.1.2.17 Page For viewing Sale 38 25. 4.1.2.18 Page For viewing Brand 88 26. 4.1.2.18.1 Page For viewing Brand 39 27. 4.1.2.19 Seat Booking Section 39 28. 4.1.2.20 Manager's Page 40
  • 6. 5 LIST OF TABLES S.No. Table Name Page No. 1. state_Master 17 2. city_Master 18 3. multiplex_Master 18 4. audi_Master 19 5. movie_Master 19 6. movie_Timing_Master 20 7. movie_Image_Master 20 8. user_Details 21 9. booking_Master 21 10. mallStateCity_Master 22 11. shopping_Complex_Master 22 12. brand_Master 23 13. sale_Master 23
  • 7. 6 LIST OF CONTENTS CHAPTER CONTENT HEADER PAGE No. List of Figures 4 List of Tables 5 Chapter 1 Company Profile 7 Chapter 2 Project Introduction 8 Chapter 3 SDLC Phases 11 Chapter 4 System Design 16 Chapter 5 User Interface 30 Chapter 6 Testing 109 Chapter 7 Maintainence & Implementation 111 Future Scope 113 Conclusion 113 Bibliography 114
  • 8. 7 COMPANY PROFILE 1.1 Company Profile Logic is Microsoft certified, SAP certified, HP certified, India based Custom Software Development Company providing IT services since the year 1993. In the last 15 years , Company has achieved the status of reputed Software Development Company by implementing wide range of projects for reputed organization in following different sectors:- Retail, Apparels & Footwear, Pharmaceutical, FMCG (Fast Moving Consumer Goods), Electronics & Telecommunication, Spa & Salon and F & B (Food and Beverages). Company's strength is maintaining good quality client satisfaction supported by a talented pool of experienced professionals. It offers dedicated services at all stages of the project right from the initial stage to final delivery and maintenance. 1.2 Logic Services and Solutions:-  ERP software or Business Solution Software.  Implementation of ERP.  Software development.  Product Development.  Software Training.  ERP Training.
  • 9. 8 PROJECT INTRODUCTION 2.1 Introduction Of The Project Multiplex Management System A Multiplex is a movie theater complex with more than three screens. The largest of these complexes are sometimes referred to as a Megaplex. Definitions of what constitutes multiplex vs. a Megaplex is related to the number of screens . Often the comparison is arbitrary . For example , 12 to 16 screens may constitute a Multiplex , whereas 14 to 20 may be branded a Megaplex . To manage these all types Multiplexes we are using Multiplex management system Software . In Multiplexes , there are different types of Departments. To handle the various departments in Multiplexes and Malls we can use this multiplex management software. 2.2 Objective of Project The main objective of this software is to reduce the work load of the owner of the Multiplex. Using this software owner can easily check and evaluate everything running in the Multiplex and with this the user can also view online the Brands available in Malls and the Sale% on the Brands if exist. The Multiplex Management System Software performs all the operations and task online like :  Booking and Cancellation of tickets.  Screen and Movie Management.  Handling database and track records.  Listing the Brands and Sale% on them.  Managing employee databases.
  • 10. 9 With all the above task it reduces the occurrence of error rates of the multiplex system and makes it easy to the user to view multiple offers on brands online and hence making the Multiplex System more successful. 2.2 Modules in the project: 1) User i. Can view Malls and Brands. ii. Can check Sale Duration and Sale% on Brands. iii. Sign up to get registered. iv. Login (logs in for ticket booking and cancellation) 2) Admin a) Ticket Booking i. Checks available Seats for user selection. ii. Appointing Managers for Multiplex. iii. Employee management at that time in the audi. iv. Audi Management. v. Movie management b) Audi & Movie Management: i. Managing Audi's with respect to movies. ii. Dealing with show timing of movies. c) Employee management:- i. Managing employees. d) Manager:- i. Adding employees to the Multiplex. ii. Viewing employees Attendance. iii. Leave Approval 3. Organization of the project report in accordance with SDLC i. Requirement Phase:- I gathered all the information required for building this system. This involved studying the whole present Multiplex systems and Malls, determining its
  • 11. 10 limitations and what all changes that are needed to be done in order to improve it. A new system was then proposed on which further phases were applied. ii. Analysis Phase:- The requirements are then analyzed by conducting a feasibility study in all respects i.e. - technical , economical & operational feasibility. Further analysis is done by drawing Data-Flow Diagrams , Data Dictionary & ER- Diagram. Finally the hardware & software requirements are determined as per the needs of our system. iii. Design Phase:- After successful analysis of the requirements, the designing of the system begins. The Bottom-Up Approach is used for the Object-Oriented Methodology. Modules and sub- modules are then designed and a full system flow-chart is made. After this the activity diagrams & Sequence diagrams are designed. iv. Implementation Phase:- The major functions of each modules are determined and then pseudo codes for each of them are then written to begin the implementation phase. v. Testing Phase:- A methodology for testing is chosen and test cases are built according to it. Steps of testing are then specified. vi. Maintenance Phase:- For future maintenance, installation guide has been provided as well as troubleshooting tips are given. Also the necessary Do’s & Don’ts have been specified.
  • 12. 11 Fig 2.0 SDLC Phases SDLC PHASES 3.1 Requirement Analysis for Proposed System  Here, I analyze that the user needs to view online the various offers on Brands in the Mall .  The ability to the admin/owner of the multiplex to appoint managers to the multiplex.  Retreiving information faster and accurate and updating for authorized users.
  • 13. 12 3.2 Introduction to SRS 3.2.1 Model Description A process model is chosen on the basis of the nature of the project, its application, the tools and methods that are to be used as well as the controls and the deliverables that are required . The model used to build the " MULTIPLEX MANAGEMENT SYSTEM" is the "Incremental Model". Fig. 3.2.1 A series of mini-Waterfalls are performed, where all phases of the Waterfall are completed for a small part of a system, before proceeding to the next increment. This methodology is powerful, precise and thorough. The phases that fall under this model are as follows: 1. Requirement Analysis. 2. Design. 3. Implementation. 4. Testing. 5. Maintenance.
  • 14. 13 3.2.2 Architecture Three-tier architecture is a client–server architecture in which the user interface, functional process logic, computer data storage and data access are developed and independent modules are made, most often on separate platforms. Apart from the usual advantages of modular software with well-defined interfaces, the three-tier architecture is intended to allow any of the three tiers to be upgraded or replaced independently in response to changes in requirements or technology. Three-tier architecture has the following three tiers: Presentation tier This is the topmost level of the application. The presentation tier displays information related to Multiplexes, Malls and Brands. It communicates with other tiers by outputting results client tier and all other tiers in the network. (In simple terms, it is a layer which users can access directly such as a web page, or an operating systems GUI) Application tier (business logic, logic tier, data access tier, or middle tier) The logical tier is pulled out from the presentation tier, as its own layer, it controls an application’s functionality by performing detailed processing. Data tier This tier consists of database servers. Here information is stored and retrieved . This tier keeps data neutral and independent from application servers or business logic. Giving data its own tier also improves scalability and performance. 3.3 Certain specific requirements 3.3.1 Input & output of the project: Inputs Of the Project  Databases and records of employee.
  • 15. 14  Movies and number of screens.  Number of seats.  Request for booking/cancellation.  User registers.  List of Multiplexes.  List of Malls.  List of Brands.  Sale Details Outputs Of the Project  Databases and records of employees handled.  Movies schedule and screens handled.  Seats allotted.  Booking and cancellation done.  Registration performed.  Brands in Malls can be viewed.  Sale can be viewed. 3.3.2 Hardware & Software Requirement Hardware Requirements:  Processor: Intel dual core or above  Processor Speed:1.0GHZ or above  RAM: 1 GB RAM or above  Hard Disk: 20 GB hard disk or above Software Requirements:  Language: ASP.net  Platform-used: .net.  Back-End Tool: Microsoft SQL server 2008  Front-End Tool: Visual Studio 2012
  • 16. 15 3.4 FEASIBILITY STUDY It is the measure of how beneficial or practical the development of an Multiplex System will be, to an organization . It is a process , which defines exactly what a project is, and what strategic issues need to be considered to assess its feasibility, or likelihood of succeeding. Ideally, it's the process of making rational decisions about a number of enduring characteristics of the project. It is an evaluation of a proposed design, to determine the difficulties in carrying out the designated task. Generally, it precedes technical development and project implementation. In other words, it is an evaluation or analysis of the potential impact of the proposed project. 3.4.1 Technical feasibility: It's the measure of the practicality of the specific technical solution. A measure of the availability of technical resources and expertise. Technical feasibility addresses major issues such as :-  Is the proposed technology or solution is practical?  Do we currently possess the necessary technology? The "Multiplex Management System" is found to be technically feasible, as the resources and technology required by it, is available. 3.4.2 Operational feasibility: Its the measure of how well the solution of problems or a specific solution will work in the organization. A measure of how people feel about the system/project. "Multiplex Management System" is operationally feasible as it can be easily used by the users . The users as well as management/admin will feel good while using the system:
  • 17. 16  The system provides the users to book/cancel movie tickets online.  It provides the users to view the sales on brands in various Malls online.  It provides adequate throughput and response time. 3.4.3 Economic feasibility: Its the measure of the cost-effectiveness of the project, often called as cost-benefit analysis. "Multiplex Management System" is economically feasible, because it reduces the expense as well as time in the manual system. Following factors are studied for economic feasibility of project:  Systems analysts' time.  Cost of systems study.  Estimated cost of hardware.  Cost of packaged software/software development. SOFTWARE DESIGN 4.1 SYSTEM DESIGN System Design is a solution to the creation of a new system. This phase is composed of several systems. It focuses on the detailed implementation of the feasible system. It emphasis on translating design specifications to performance specifications.
  • 18. 17 Fig 4.1.0 System Design has two phases:  Architectural/Logical design.  User Interface/Physical design. 4.1.1 Architectural Design: In this phase , the analyst describes sources and destinations, databases and procedures , all in a format that meets the user requirements. The analyst also specifies the user needs and at a level that virtually determines the flow of the system and the data resources. This design is shown by the DFD's and Database design. 4.1.1 Database Designs: Table 4.1.1.1 User_Details
  • 22. 21 4.1.1.8 Table booking_Master 4.1.1.9 Table mallStateCity_Master
  • 25. 24 4.1.2 DFD's 4.1.2.1 0 Level DFD User Multiplex management system Registration Ticket Registered Booked/Cancelled Watched Movie Bookin g Malls Shopping Complex Brands
  • 26. 25 4.1.2.2 Level 1 DFD mallStateCity Login 2 User details Registration 1 Enter Detai ls Ticket Booking /Cancellation System 3 User Code allotted Ticket_Booking Management 4 User Details Manages Ticket Booking //ca 5 Mall Management admin
  • 28. 27
  • 30. 29 4.1.2 User Interface Design: This design is followed by the designing and the coding part. It produces the working system by defining the design specifications, which tells the programmers exactly what the candidate system must do. The programmers write the necessary programs that accepts input from the user, perform necessary processing on accepted data
  • 31. 30 through call and produce the required report on a hard copy or displays it on screen. 4.1.2.1 Login Home Page 4.1.2.2 Login Page
  • 32. 31 4.1.2.3 Admin Home Page 4.1.2.4 Admin State form Page To Add States
  • 33. 32 4.1.2.5 Admin City form To Add Cities 4.1.2.6 Admin Multiplex Page To Add Multiplex
  • 34. 33 4.1.2.7 Admin Movie Page To Add Movies To Multiplex 4.1.2.8 Admin Page For Adding Movie
  • 35. 34 4.1.2.9 Admin Page For Adding Movie Timings 4.1.2.10 Admin Page for Gallery
  • 36. 35 4.1.2.11 Admin Page For Editing the Image 4.1.2.12 Admin Page for Adding Malls
  • 37. 36 4.1.2.13 Admin Page for Adding Shopping Malls 4.1.2.14 Admin Page for Adding Brands
  • 38. 37 4.1.2.15 Admin Page for Displaying Sales on Brands 4.1.2.16 User Registration Page
  • 39. 38 4.1.2.17 Page For viewing Sale 4.1.2.18 Page For viewing Brand
  • 40. 39 4.1.2.18.1 Page For viewing Brand 4.1.2.19 Seat Booking Section
  • 41. 40 4.1.2.20 Managers page for adding employee 5. (Coding Section ) Common Functions of DAL Layer using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.Sql; using System.Data.SqlClient; using System.Data; using BAL; namespace DAL { public class CommonFunc { private SqlConnection _connectionString; public SqlCommand cmd = new SqlCommand();
  • 42. 41 public CommonFunc(SqlConnection con) { _connectionString = con; } // FUNCTIONS FOR STATE //submit function for state public void SubmitState(state sc1) { cmd.Parameters.Add("@state_name", SqlDbType.VarChar, 50).Value = sc1.State_Name; if (sc1.State_Code == 0) { cmd.CommandText = "insert into state_Master values (@state_name)"; } else { cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); cmd.CommandText = "update state_Master set State_Name=@state_name where State_Code=@state_Code"; } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } //bind function for state public DataSet BindState() { SqlDataAdapter adp = new SqlDataAdapter("select * from state_Master ", _connectionString); DataSet ds = new DataSet();
  • 43. 42 adp.Fill(ds); return (ds); } //delete function for state public void DelState(state sc1) { _connectionString.Open(); cmd.CommandText = "delete from state_Master where State_Code=@Code "; cmd.Parameters.Add("@code", SqlDbType.VarChar, 50).Value = Convert.ToInt32(sc1.State_Code); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } //function for gettingstate public void GetState(state sc1) { cmd.CommandText = "select * from state_Master where State_Code=@state_Code"; _connectionString.Open(); cmd.Connection = _connectionString; cmd.Parameters.Add("@state_Code", SqlDbType.VarChar, 50).Value = sc1.State_Code; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.State_Name = Convert.ToString(dr["State_Name"]); } _connectionString.Close(); } // function for state paging and searching
  • 44. 43 public ResponseResult<state> StateList(int pageNo, int pageSize, string searchStr = "") { List<state> stateList = new List<state>(); state State = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY State_Code )AS rno, * from state_Master where State_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from state_Master where State_Name like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { State = new state(); State.State_Name = dr["State_Name"] + ""; stateList.Add(State); } } _connectionString.Close();
  • 45. 44 ResponseResult<state> resultState = new ResponseResult<state>(); resultState.Records = stateList; resultState.TotalRecords = totalRecords; return resultState; } //FUNCTIONS FOR CITY //submit function for inserting and updating city public void SubmitCity(city sc1) { cmd.Parameters.Add("@city_name",SqlDbType.VarChar,50).Value = sc1.City_Name; cmd.Parameters.Add("@state_code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); if (sc1.City_Code == 0) { cmd.CommandText = "insert into city_Master(City_Name,State_Code) values(@city_name,@state_code)"; } else { cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); cmd.CommandText = "update city_Master set City_Name=@city_name where City_Code=@city_Code"; } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); } //function for binding city public DataSet BindCity() {
  • 46. 45 SqlDataAdapter adp = new SqlDataAdapter("select c.City_Name,c.City_Code ,S.State_Name from state_Master as S join city_Master as c on c.State_Code=S.State_Code ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //bind city and state accordingly public DataSet BindCityState(citysc1) { SqlDataAdapter adp = new SqlDataAdapter("select City_Name,City_Code from city_Master where State_Code=@state_Code", _connectionString); adp.SelectCommand.Parameters.Add("@state_Code", SqlDbType.Int).Value = sc1.State_Code; DataSet ds = new DataSet(); adp.Fill(ds); return ds; } //function for gettingcity public void GetCity(city sc1) { cmd.CommandText = "select * from city_Master where City_Code=@city_Code"; _connectionString.Open(); cmd.Connection = _connectionString; cmd.Parameters.Add("@city_Code", SqlDbType.VarChar, 50).Value = sc1.City_Code; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.City_Name = Convert.ToString(dr["City_Name"]);
  • 47. 46 } _connectionString.Close(); } //function for deleting city public void DelCity(city sc1) { _connectionString.Open(); cmd.CommandText = "delete from city_Master where City_Code=@Code "; cmd.Parameters.Add("@code", SqlDbType.VarChar, 50).Value = Convert.ToInt32(sc1.City_Code); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } //function for city paging and searching public ResponseResult<city> CityList(int pageNo, int pageSize, string searchStr = "") { List<city> cityList = new List<city>(); city City = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY c.City_Code )AS rno, c.City_Name,c.City_Code ,S.State_Name from state_Master as S join city_Master as c on c.State_Code=S.State_Code where c.City_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from city_Master where City_Name like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar());
  • 48. 47 cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { City = new city(); City.City_Name = dr["City_Name"] + ""; City.State_Name = dr["State_Name"] + ""; cityList.Add(City); } } _connectionString.Close(); ResponseResult<city>resultCity= new ResponseResult<city>(); resultCity.Records = cityList; resultCity.TotalRecords= totalRecords; return resultCity; } //FUNCTIONS FOR AUDI'S //function for adding audi public void SetAudi(audi sc1) { cmd.Parameters.Add("@audi_no",SqlDbType.VarChar,50).Value = sc1.Audi_No; cmd.Parameters.Add("@platinum_seats", SqlDbType.VarChar, 50).Value = sc1.Platinum_Seats; cmd.Parameters.Add("@gold_seats", SqlDbType.VarChar, 50).Value = sc1.Gold_Seats;
  • 49. 48 cmd.Parameters.Add("@silver_seats",SqlDbType.VarChar,50).Value = sc1.Silver_Seats; cmd.Parameters.Add("@bronze_seats",SqlDbType.VarChar, 50).Value = sc1.Bronze_Seats; if (sc1.Audi_Code == 0) { cmd.CommandText = "insert into audi_Master(Audi_No,Platinum_Seats,Gold_Seats,Silver_Seats,Bronze_Seats ) values (@audi_no,@platinum_seats,@gold_seats,@silver_seats,@bronze_seats)"; } else { cmd.CommandText = "update audi_Master set Audi_NO=@audi_no,Platinum_Seats=@platinum_seats,Gold_Seats=@gold_se ats,Silver_Seats=@silver_seats,Bronze_Seats=@bronze_seats where Audi_Code=@audi_Code"; cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Audi_Code); } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); } //bind function for Audi public DataSet BindAudi() { SqlDataAdapter adp = new SqlDataAdapter("select * from audi_Master ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); }
  • 50. 49 //search function for audi //delete function for audi public void DeleteAudi(int Audi_Code) { SqlDataAdapter adp = new SqlDataAdapter("delete from audi_Master where Audi_Code=@Audi_Code", _connectionString); adp.SelectCommand.Parameters.Add("@Audi_Code", SqlDbType.Int).Value = Convert.ToInt32(Audi_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //get function for audi public void GetAudi(audi a1) { cmd.CommandText = ("select * from audi_Master where Audi_Code=@Audi_Code"); cmd.Parameters.Add("@Audi_Code", SqlDbType.Int).Value = a1.Audi_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); a1.Audi_No = Convert.ToString(dr["Audi_No"]); a1.Platinum_Seats= Convert.ToString(dr["Platinum_Seats"]); a1.Gold_Seats= Convert.ToString(dr["Gold_Seats"]); a1.Silver_Seats = Convert.ToString(dr["Silver_Seats"]); a1.Bronze_Seats = Convert.ToString(dr["Bronze_Seats"]); } _connectionString.Close(); } //function for audi paging
  • 51. 50 public ResponseResult<audi>AudiList(int pageNo, int pageSize, string searchStr = "") { List<audi> audiList = new List<audi>(); audi audii = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Audi_Code )AS rno, * from audi_Master where Audi_No like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from audi_Master", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { audii = new audi(); audii.Audi_No = dr["Audi_No"] + ""; audii.Platinum_Seats = dr["Platinum_Seats"] + ""; audii.Gold_Seats = dr["Gold_Seats"] + ""; audii.Silver_Seats = dr["Silver_Seats"] + ""; audii.Bronze_Seats= dr["Bronze_Seats"] + ""; audii.Audi_Code = Convert.ToInt32(dr["Audi_Code"] + "");
  • 52. 51 audiList.Add(audii); } } _connectionString.Close(); ResponseResult<audi> resultAudi = new ResponseResult<audi>(); resultAudi.Records= audiList; resultAudi.TotalRecords = totalRecords; return resultAudi; } // FUNCTIONS FOR MOVIES //submit or set function for movie public void SetMovie(movie sc1) { try { if (sc1.Movies_Code == 0) { cmd.CommandText = "insert into movie_Master values(@movie_Name,@movie_Image,@releasing_Date,@end_Date,@languag e,@genres,@audi_Code,@multiplex_Code,@state_Code,@city_Code)"; } else { cmd.CommandText = "update movie_Master set Movie_Name=@movie_Name,Movie_Image=@movie_Image,Releasing_Date=@ releasing_Date,End_Date=@end_Date,Language=@language,Genres=@genre s,Audi_Code=@audi_Code,Multiplex_Code=@multiplex_Code,State_Code=@s tate_Code,City_Code=@city_Code where Movies_Code=@movie_Code"; cmd.Parameters.Add("@movie_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.Movies_Code); } cmd.Parameters.Add("@movie_Name", SqlDbType.VarChar, 50).Value = sc1.Movie_Name;
  • 53. 52 cmd.Parameters.Add("@movie_Image", SqlDbType.VarChar, 50).Value = sc1.Movie_Image; cmd.Parameters.Add("@releasing_Date", SqlDbType.VarChar, 50).Value = sc1.Releasing_Date; cmd.Parameters.Add("@end_Date", SqlDbType.VarChar, 50).Value = sc1.End_Date; cmd.Parameters.Add("@language",SqlDbType.VarChar, 50).Value = sc1.Language; cmd.Parameters.Add("@genres", SqlDbType.VarChar, 50).Value = sc1.Genres; cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Audi_Code); cmd.Parameters.Add("@multiplex_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.Multiplex_Code); cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } } //code for binding movie public DataSet BindMovie() { SqlDataAdapter adp = new SqlDataAdapter("select mo.Movies_Code,mo.Movie_Name,mo.Movie_Image,mo.Releasing_Date,mo.E nd_date,mo.Language,mo.Genres,a.Audi_No,m.Multiplex_Name,s.State_Na
  • 54. 53 me,c.City_Name from movie_Master as mo, audi_Master as a,state_Master as s,city_Master as c,multiplex_Master as m where mo.Audi_Code=a.Audi_Code and mo.State_Code=s.State_Code and mo.City_Code=c.City_Code and mo.Multiplex_Code=m.Multiplex_Code", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //delete code for movie public void DelMovie(int Movie_Code) { SqlDataAdapter adp = new SqlDataAdapter("delete from movie_Master where Movies_Code=@movie_Code", _connectionString); adp.SelectCommand.Parameters.Add("@movie_Code", SqlDbType.Int).Value = Convert.ToInt32(Movie_Code); DataSet ds = new DataSet(); adp.Fill(ds); } public void GetMovie(movie sc1) { cmd.CommandText = ("select * from movie_Master where movie_Master.Movies_Code=@Movie_Code"); cmd.Parameters.Add("@movie_Code", SqlDbType.Int).Value = sc1.Movies_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Movie_Name = Convert.ToString(dr["Movie_Name"]); sc1.Movie_Image = Convert.ToString(dr["Movie_Image"]);
  • 55. 54 sc1.Releasing_Date = Convert.ToString(dr["Releasing_Date"]); sc1.End_Date = Convert.ToString(dr["End_Date"]); sc1.Language = Convert.ToString(dr["Language"]); sc1.Genres = Convert.ToString(dr["Genres"]); sc1.Audi_Code = Convert.ToInt32(dr["Audi_Code"]); sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); } _connectionString.Close(); } //function for paging in movies public ResponseResult<movie> MovieList(int pageNo, int pageSize, string searchStr = "") { List<movie> movieList = new List<movie>(); movie Movie = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Movies_Code )AS rno, * from movie_Master where Movie_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from movie_Master where Movie_Name like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
  • 56. 55 cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Movie = new movie(); Movie.Movie_Name = dr["Movie_Name"] + ""; Movie.Movie_Image = dr["Movie_Image"] + ""; Movie.Releasing_Date = dr["Releasing_Date"] + ""; Movie.End_Date = dr["End_Date"] + ""; Movie.Language = dr["Language"] + ""; Movie.Genres = dr["Genres"] + ""; Movie.Audi_No = Convert.ToString(dr["Audi_No"]); Movie.Multiplex_Name = Convert.ToString(dr["Multiplex_Name"] + ""); Movie.State_Name = Convert.ToString(dr["State_Name"] + ""); Movie.City_Name = Convert.ToString(dr["City_Name"] + ""); movieList.Add(Movie); } } _connectionString.Close(); ResponseResult<movie>resultMovie = new ResponseResult<movie>(); resultMovie.Records= movieList; resultMovie.TotalRecords = totalRecords; return resultMovie; } //functions for multiplex //bind multiplex function public DataSet BindMultiplex() {
  • 57. 56 SqlDataAdapter adp = new SqlDataAdapter("select Multiplex_Code,Multiplex_Name,State_Name,City_Name from state_Master,city_Master join multiplex_Master on multiplex_Master.State_Code=state_Master.State_Code and multiplex_Master.City_Code=city_Master.City_Code ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //get function for multiplex public void GetMultiplex(multiplex sc1) { cmd.CommandText = ("select * from multiplex_master where multiplex_Master.Multiplex_Code=@multiplex_Code"); cmd.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value = sc1.Multiplex_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Multiplex_Name = Convert.ToString(dr["Multiplex_Name"]); } _connectionString.Close(); } //delete function for multiplex public void DelMultiplex(int Multiplex_Code) {
  • 58. 57 SqlDataAdapter adp = new SqlDataAdapter("delete from multiplex_Master where Multiplex_Code=@multiplex_Code", _connectionString); adp.SelectCommand.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value = Convert.ToInt32(Multiplex_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //paging and searching for multiplex public ResponseResult<multiplex> MultiplexList(int pageNo, int pageSize, string searchStr = "") { List<multiplex> multiplexList = new List<multiplex>(); multiplex Multiplexx = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Multiplex_Code )AS rno,m.Multiplex_Code,s.State_Name,c.City_Name,m.Multiplex_Name from multiplex_Master as m join city_Master as c on m.City_Code =c.City_Code join state_Master as s on s.State_Code=m.State_Code where Multiplex_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "- 1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from multiplex_Master where Multiplex_Name like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
  • 59. 58 cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Multiplexx = new multiplex(); Multiplexx.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]); Multiplexx.State_Name = Convert.ToString(dr["State_Name"]); Multiplexx.City_Name = Convert.ToString(dr["City_Name"]); Multiplexx.Multiplex_Name = Convert.ToString(dr["Multiplex_Name"] + ""); multiplexList.Add(Multiplexx); } } _connectionString.Close(); ResponseResult<multiplex> resultMultiplex = new ResponseResult<multiplex>(); resultMultiplex.Records = multiplexList; resultMultiplex.TotalRecords = totalRecords; return resultMultiplex; } //bind function for multiplex and city public DataSet BindCityMultiplex(multiplex sc1) { SqlDataAdapter adp = new SqlDataAdapter("select * from multiplex_Master where City_Code=@city_Code", _connectionString); adp.SelectCommand.Parameters.Add("@city_Code", SqlDbType.Int).Value = sc1.City_Code; DataSet ds = new DataSet(); adp.Fill(ds);
  • 60. 59 return ds; } //set function for multiplex public void SetMultiplex(multiplex sc1) { try { cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); cmd.Parameters.Add("@multiplex_Name",SqlDbType.VarChar, 50).Value = sc1.Multiplex_Name; if (sc1.Multiplex_Code == 0) { cmd.CommandText = "insert into multiplex_Master (State_Code,City_Code,Multiplex_Name) values(@state_Code,@city_Code,@multiplex_Name)"; } else { cmd.CommandText = "update multiplex_Master set State_Code=@state_Code,City_Code=@city_Code, Multiplex_Name=@multiplex_Name where Multiplex_Code=@multiplex_Code"; cmd.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Multiplex_Code); } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); }
  • 61. 60 catch (Exception ex) { throw ex; } } //functions for images public void GetImages(image im) { cmd.CommandText = ("select * from movieImage_Master"); cmd.Parameters.Add("@image_Code",SqlDbType.Int).Value = im.Image_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); im.Movie_Name = Convert.ToString(dr["Movie_Name"]); im.Image_Path = Convert.ToString(dr["Image_Path"]); } _connectionString.Close(); } //function for setting image public void SetImage(image im) { try { if (im.Image_Code == 0) { cmd.CommandText = "insert into movieImage_Master values(@movie_Name,@image_Path)"; } else
  • 62. 61 { cmd.CommandText = "update movieImage_Master set Movie_Name=@movie_Name,Image_Path=@image_Pathwhere Image_Code=@image_Code"; cmd.Parameters.Add("@image_Code", SqlDbType.Int).Value = Convert.ToInt32(im.Image_Code); } cmd.Parameters.Add("@movie_Name", SqlDbType.VarChar, 50).Value = im.Movie_Name; cmd.Parameters.Add("@image_Path",SqlDbType.VarChar, 50).Value = im.Image_Path; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } } //functions for movie timings //bind movie timings function public DataSet BindMovieTimings() { SqlDataAdapter adp = new SqlDataAdapter("select mo.MovieTimings_Code,mo.Date,mo.Show_Timings,a.Audi_No,m.Movie_Na me from movieTiming_Master as mo join audi_Master as a on mo.Audi_Code =a.Audi_Code join movie_Master as m on m.Movies_Code=mo.Movies_Code ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); }
  • 63. 62 //bind movies audi wise function public DataSet BindAudiMovie(movie sc1) { SqlDataAdapter adp = new SqlDataAdapter("select * from movie_Master where Audi_Code=@audi_Code",_connectionString); adp.SelectCommand.Parameters.Add("@audi_Code", SqlDbType.Int).Value = sc1.Audi_Code; DataSet ds = new DataSet(); adp.Fill(ds); return ds; } //get function for movie timings public void GetMovieTimings(movietiming sc1) { cmd.CommandText = ("select * from movieTiming_Master where movieTiming_Master.MovieTimings_Code=@movieTimings_Code "); cmd.Parameters.Add("@movieTimings_Code", SqlDbType.Int).Value = sc1.MovieTimings_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.MovieTimings_Code = Convert.ToInt32(dr["MovieTimings_Code"]); sc1.Date = Convert.ToString(dr["Date"]); sc1.Show_Timings= Convert.ToString(dr["Show_Timings"]); sc1.Movies_Code = Convert.ToInt32(dr["Movies_Code"]); sc1.Audi_Code = Convert.ToInt32(dr["Audi_Code"]); } _connectionString.Close(); }
  • 64. 63 //delete function for movie timings public void DelMovieTimings(int MovieTimings_Code) { SqlDataAdapter adp = new SqlDataAdapter("delete from movieTiming_Master where MovieTimings_Code=@movieTimings_Code", _connectionString); adp.SelectCommand.Parameters.Add("@movieTimings_Code", SqlDbType.Int).Value = Convert.ToInt32(MovieTimings_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //paging and searching for MovieTimings public ResponseResult<movietiming> MovieTimingsList(int pageNo, int pageSize, string searchStr = "") { List<movietiming> movieTimingsList = new List<movietiming>(); movietiming MovieTimingss= null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY MovieTimings_Code )AS rno, mo.MovieTimings_Code,mo.Date,mo.Show_Timings,a.Audi_No,m.Movie_Na me from movieTiming_Master as mo join audi_Master as a on mo.Audi_Code =a.Audi_Code join movie_Master as m on m.Movies_Code=mo.Movies_Code where Date like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from movieTiming_Master where Date like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text;
  • 65. 64 cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { MovieTimingss = new movietiming(); MovieTimingss.MovieTimings_Code = Convert.ToInt32(dr["MovieTimings_Code"] + ""); MovieTimingss.Date = dr["Date"] + ""; MovieTimingss.Show_Timings = dr["Show_Timings"] + ""; MovieTimingss.Audi_No = Convert.ToString(dr["Audi_No"] + ""); MovieTimingss.Movie_Name = Convert.ToString(dr["Movie_Name"]); movieTimingsList.Add(MovieTimingss); } } ResponseResult<movietiming> resultMovieTiming = new ResponseResult<movietiming>(); resultMovieTiming.Records = movieTimingsList; resultMovieTiming.TotalRecords= totalRecords; _connectionString.Close(); return resultMovieTiming; } //set function for MovieTimings public void SetMovieTimings(movietiming sc1) { try {
  • 66. 65 if (sc1.MovieTimings_Code == 0) { cmd.CommandText = "insert into movieTiming_Master (Date,Show_Timings,Audi_Code,Movies_Code) values(@date,@show_Timings,@audi_Code,@movies_Code)"; } else { cmd.CommandText = "update movieTiming_Master set Date=@date,Show_Timings=@show_Timings,Audi_Code=@audi_Code,Movies _Code=@movies_Code where MovieTimings_Code=@movieTimings_Code"; cmd.Parameters.Add("@movieTimings_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.MovieTimings_Code); } cmd.Parameters.Add("@date", SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.Date); cmd.Parameters.Add("@show_Timings", SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.Show_Timings); cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Audi_Code); cmd.Parameters.Add("@movies_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Movies_Code); _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; } } //search movie function
  • 67. 66 public void SearchMovie(movie sc1) { cmd.CommandText = ("select Movie_Name,Audi_No,Show_Timings from audi_Master join movie_Master on movie_Master.Audi_Code=audi_Master.Audi_Code where movie_Master.Movies_Code=@Movies_Code"); cmd.Parameters.Add("@Movies_Code", SqlDbType.Int).Value = Convert.ToString(sc1.Movies_Code); _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Audi_No = Convert.ToString((dr["Audi_No"])); } _connectionString.Close(); } //function for filtering movie according to date public DataSet FilterMovie(movie sc1, multiplex sc) { SqlDataAdapter adp = new SqlDataAdapter("select m.movie_name,m.Movies_Code from movie_Master as m join multiplex_master as mu on m.Multiplex_Code = mu.Multiplex_Code where m.Multiplex_Code=@multiplex_Code and m.End_Date>=@date ", _connectionString); adp.SelectCommand.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value = Convert.ToInt32(sc.Multiplex_Code); adp.SelectCommand.Parameters.Add("@date", SqlDbType.VarChar, 50).Value = sc1.Date; DataSet ds = new DataSet(); adp.Fill(ds); return ds;
  • 68. 67 } //function for gettingaudi as per movie public void FilterAudi(movie sc) { cmd.CommandText = "select a.audi_no,a.Audi_Code from audi_Master as a join movie_master as m on a.Audi_Code = m.Audi_Code where m.Movies_Code=@movies_Code"; _connectionString.Open(); cmd.Connection = _connectionString; cmd.Parameters.Add("@movies_Code",SqlDbType.Int).Value = Convert.ToInt32(sc.Movies_Code); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc.Audi_No = Convert.ToString(dr["Audi_No"]); } _connectionString.Close(); } //function for gettingshow timings of selected movie public DataSet FilterTimings(movietiming sc1) { SqlDataAdapter adp = new SqlDataAdapter("select s.show_Timings,s.MovieTimings_Code from movieTiming_Master as s join movie_master as m on s.Movies_Code = m.Movies_Code where s.Movies_Code=@movie_Code ", _connectionString); adp.SelectCommand.Parameters.Add("@movie_Code", SqlDbType.Int).Value = sc1.Movies_Code; DataSet ds = new DataSet(); adp.Fill(ds); return ds; } //code for booking table
  • 69. 68 public void SubmitBooking(booking sc1) { try { cmd.CommandText = "insert into booking_Master(User_Code,State_Code,City_Code,Multiplex_Code,Date,Movi eTiming_Code,Movies_Code,Audi_Code,Platinum_Seat,Gold_Seat,Silver_Sea t,Bronze_Seat,Seats,Total_Price) values(@User_Code,@State_Code,@City_Code,@Multiplex_Code,@Date,@Mov ieTiming_Code,@Movie_Code,@Audi_Code,@Platinum_Seat,@Gold_Seat,@Sil ver_Seat,@Bronze_Seat,@Seats,@total_Price)"; cmd.Parameters.Add("@User_Code", SqlDbType.Int).Value = sc1.User_Code; cmd.Parameters.Add("@State_Code", SqlDbType.Int).Value = sc1.State_Code; cmd.Parameters.Add("@City_Code", SqlDbType.Int).Value = sc1.City_Code; cmd.Parameters.Add("@Multiplex_Code", SqlDbType.Int).Value = sc1.Multiplex_Code; cmd.Parameters.Add("@Date",SqlDbType.VarChar,50).Value = sc1.Date; cmd.Parameters.Add("@Movie_Code",SqlDbType.VarChar, 50).Value = sc1.Movies_Code; cmd.Parameters.Add("@MovieTiming_Code", SqlDbType.VarChar, 50).Value = sc1.MovieTiming_Code; cmd.Parameters.Add("@Audi_Code",SqlDbType.Int).Value = sc1.Audi_Code; cmd.Parameters.Add("@Platinum_Seat", SqlDbType.VarChar, 50).Value = sc1.Platinum_Seat; cmd.Parameters.Add("@Gold_Seat", SqlDbType.VarChar, 50).Value = sc1.Gold_Seat; cmd.Parameters.Add("@Silver_Seat", SqlDbType.VarChar, 50).Value = sc1.Silver_Seat;
  • 70. 69 cmd.Parameters.Add("@Bronze_Seat",SqlDbType.VarChar, 50).Value = sc1.Bronze_Seat; cmd.Parameters.Add("@Seats", SqlDbType.VarChar, 50).Value = sc1.Seats; cmd.Parameters.Add("@total_Price", SqlDbType.Int).Value = sc1.Total_Price; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); cmd.Dispose(); } catch (Exception ex) { throw ex; } } //function for user registration public void SubmitUser(userDetails sc1) { try { cmd.CommandText = "insert into User_Details(User_Name,Email_Id,Password,D_o_b,Mobile_No) values(@User_Name,@Email_Id,@Password,@DOB,@Phone_No)"; cmd.Parameters.Add("@User_Name", SqlDbType.VarChar, 50).Value = sc1.User_Name; cmd.Parameters.Add("@Email_Id", SqlDbType.VarChar, 50).Value = sc1.Email_id; cmd.Parameters.Add("@Password", SqlDbType.VarChar, 50).Value = sc1.Password; cmd.Parameters.Add("@DOB", SqlDbType.VarChar, 50).Value = sc1.D_o_b;
  • 71. 70 cmd.Parameters.Add("@Phone_No",SqlDbType.VarChar, 50).Value = sc1.Mobile_No; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); // cmd.Dispose(); } catch (Exception ex) { throw ex; } } //function for changing password public void ChangePassword(userDetails sc1) { try { cmd.CommandText = "update User_Details set Password=@password where Email_id=@email_id"; cmd.Parameters.Add("@password", SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.Password); cmd.Parameters.Add("@email_id",SqlDbType.VarChar,50).Value = Convert.ToString(sc1.Email_id); _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; }
  • 72. 71 } //paging for viewing brand imagesby user public ResponseResult<brand> BrandViewList(int pageNo, int pageSize, string searchStr = "") { List<brand> brandviewList = new List<brand>(); brand Brandvieww = null; int totalImages; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Brand_Code )AS rno,Brand_Code,Brand_Name,Brand_Image from brand_Master ) as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from brand_Master", _connectionString); totalImages = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Brandvieww = new brand(); Brandvieww.Brand_Code = Convert.ToInt32(dr["Brand_Code"]); Brandvieww.Brand_Name = Convert.ToString(dr["Brand_Name"]); Brandvieww.Brand_Image = Convert.ToString(dr["Brand_Image"]); brandviewList.Add(Brandvieww);
  • 73. 72 } } _connectionString.Close(); ResponseResult<brand> resultBrandView = new ResponseResult<brand>(); resultBrandView.Records= brandviewList; resultBrandView.TotalRecords = totalImages; return resultBrandView; } //function for gettingall the booked seats in string public booking SplitSeats(booking sc1) { _connectionString.Open(); cmd.Connection = _connectionString; cmd.CommandText = "select Platinum_seat,Gold_Seat,Silver_Seat,Bronze_Seat from booking_Master where State_Code=@state_Code and City_Code=@city_Code and Multiplex_Code=@multiplex_Code and Movies_Code=@movie_Code and Date=@date and MovieTiming_Code=@movieTiming_Code and Audi_Code=@audi_Code "; cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = sc1.State_Code; cmd.Parameters.Add("@city_Code", SqlDbType.Int).Value = sc1.City_Code; cmd.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value = sc1.Multiplex_Code; cmd.Parameters.Add("@movie_Code", SqlDbType.Int).Value = sc1.Movies_Code; cmd.Parameters.Add("@movieTiming_Code", SqlDbType.Int).Value = sc1.MovieTiming_Code; cmd.Parameters.Add("@audi_Code", SqlDbType.Int).Value = sc1.Audi_Code;
  • 74. 73 cmd.Parameters.Add("@date", SqlDbType.VarChar, 50).Value = sc1.Date; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { sc1.Platinum_Seat = ""; sc1.Gold_Seat = ""; sc1.Silver_Seat = ""; sc1.Bronze_Seat = ""; while (dr.Read()) { sc1.Platinum_Seat = sc1.Platinum_Seat + "," + Convert.ToString(dr["Platinum_Seat"]); sc1.Gold_Seat = sc1.Gold_Seat + "," + Convert.ToString(dr["Gold_Seat"]); sc1.Silver_Seat = sc1.Silver_Seat + "," + Convert.ToString(dr["Silver_Seat"]); sc1.Bronze_Seat = sc1.Bronze_Seat + "," + Convert.ToString(dr["Bronze_Seat"]); } } _connectionString.Close(); return sc1; } //function for cancellation of booking public void CancelBooking(booking sc1) { SqlDataAdapter adp = new SqlDataAdapter("delete from booking_Master where State_Code=@state_Code and City_Code=@city_Code and Multiplex_Code=@multiplex_Code and Date=@Date and Movies_Code=@movies_Code and MovieTimings_Code=@movieTimings_Code and Audi_Code=@audi_Code", _connectionString);
  • 75. 74 adp.SelectCommand.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); adp.SelectCommand.Parameters.Add("@city_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); adp.SelectCommand.Parameters.Add("@multiplex_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Multiplex_Code); adp.SelectCommand.Parameters.Add("@date", SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.Date); adp.SelectCommand.Parameters.Add("@movies_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Movies_Code); adp.SelectCommand.Parameters.Add("@movieTimings_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.MovieTiming_Code); adp.SelectCommand.Parameters.Add("@audi_Code",SqlDbType.Int).Value=C onvert.ToInt32(sc1.Audi_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //functions for Mall //bind Mall function public DataSet BindMall() { SqlDataAdapter adp = new SqlDataAdapter("select m.Mall_Code,m.Mall_Name,s.State_Name,c.City_Name from mallStateCity_Master as m join state_Master as s on m.State_Code=s.State_Code join city_Master as c on m.City_Code=c.City_Code ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //get function for Mall public void GetMall(mallStateCity sc1) {
  • 76. 75 cmd.CommandText = ("select * from mallStateCity_master where mallStateCity_Master.Mall_Code=@mall_Code"); cmd.Parameters.Add("@mall_Code",SqlDbType.Int).Value = sc1.Mall_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Mall_Name = Convert.ToString(dr["Mall_Name"]); } _connectionString.Close(); } //delete function for Mall public void DelMall(int Mall_Code) { SqlDataAdapter adp = new SqlDataAdapter("delete from mallStateCity_Master where Mall_Code=@mall_Code", _connectionString); adp.SelectCommand.Parameters.Add("@mall_Code", SqlDbType.Int).Value = Convert.ToInt32(Mall_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //paging and searching for Mall public ResponseResult<mallStateCity> MallList(int pageNo, int pageSize, string searchStr = "") { List<mallStateCity> mallList = new List<mallStateCity>(); mallStateCity Malll = null;
  • 77. 76 int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Mall_Code )AS rno,m.Mall_Code,s.State_Name,c.City_Name,m.Mall_Name from mallStateCity_Master as m join city_Master as c on m.City_Code =c.City_Code join state_Master as s on s.State_Code=m.State_Code where Mall_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from mallStateCity_Master where Mall_Name like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Malll = new mallStateCity(); Malll.Mall_Code = Convert.ToInt32(dr["Mall_Code"]); Malll.State_Name = Convert.ToString(dr["State_Name"]); Malll.City_Name = Convert.ToString(dr["City_Name"]); Malll.Mall_Name = Convert.ToString(dr["Mall_Name"] + ""); mallList.Add(Malll); }
  • 78. 77 } _connectionString.Close(); ResponseResult<mallStateCity> resultMall = new ResponseResult<mallStateCity>(); resultMall.Records = mallList; resultMall.TotalRecords = totalRecords; return resultMall; } //bind function for mall and city public DataSet BindCityMall(mallStateCity sc1) { SqlDataAdapter adp = new SqlDataAdapter("select * from mallStateCity_Master where City_Code=@city_Code",_connectionString); adp.SelectCommand.Parameters.Add("@city_Code", SqlDbType.Int).Value = sc1.City_Code; DataSet ds = new DataSet(); adp.Fill(ds); return ds; } //set function for Mall public void SetMall(mallStateCity sc1) { try { cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); cmd.Parameters.Add("@mall_Name", SqlDbType.VarChar, 50).Value = sc1.Mall_Name; if (sc1.Mall_Code == 0) {
  • 79. 78 cmd.CommandText = "insert into mallStateCity_Master (State_Code,City_Code,Mall_Name) values(@state_Code,@city_Code,@mall_Name)"; } else { cmd.CommandText = "update mallStateCity_Master set State_Code=@state_Code,City_Code=@city_Code, Mall_Name=@mall_Name where Mall_Code=@mall_Code"; cmd.Parameters.Add("@mall_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Mall_Code); } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; } } //functions for shopping Complex //bind shopping Complex function public DataSet BindShopping_Complex() { SqlDataAdapter adp = new SqlDataAdapter("select sh.Shopping_Complex_Code,sh.Shopping_Complex_Name,sh.Shopping_Co mplex_Image,s.State_Name,c.City_Name,m.Mall_Name from shopping_Complex_Master as sh join state_Master as s on sh.State_Code=s.State_Code join city_Master as c on sh.City_Code=c.City_Code join mallStateCity_Master as m on sh.Mall_Code=m.Mall_Code",_connectionString);
  • 80. 79 DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //get function for Shopping_Complex public void GetShopping_Complex(shopping_Complex sc1) { cmd.CommandText = ("select * from shopping_Complex_master where shopping_Complex_Master,Shopping_Complex_Code=@shopping_Complex_ Code"); cmd.Parameters.Add("@shopping_Complex_Code", SqlDbType.Int).Value = sc1.Shopping_Complex_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Shopping_Complex_Code = Convert.ToInt32(dr["Shopping_Complex_Code"]); sc1.Shopping_Complex_Name = Convert.ToString(dr["Shopping_Complex_Name"]); sc1.Shopping_Complex_Image = Convert.ToString(dr["Shopping_Complex_Image"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]); } _connectionString.Close(); } //delete function for Shopping Complex public void DelShopping_Complex(int Shopping_Complex_Code)
  • 81. 80 { SqlDataAdapter adp = new SqlDataAdapter("delete from shopping_Complex_Master where Shopping_Complex_Code=@shopping_Complex_Code", _connectionString); adp.SelectCommand.Parameters.Add("@shopping_Complex_Code", SqlDbType.Int).Value = Convert.ToInt32(Shopping_Complex_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //paging and searching for Shopping Complex public ResponseResult<shopping_Complex> Shopping_ComplexList(int pageNo, int pageSize, string searchStr = "") { List<shopping_Complex> shopping_ComplexList = new List<shopping_Complex>(); shopping_Complex Shopping_Complexx = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Shopping_Complex_Code )AS rno,sh.Shopping_Complex_Code,sh.Shopping_Complex_Name,sh.Shopping_ Complex_Image,s.State_Name,c.City_Name,m.Mall_Name from shopping_Complex_Master as sh join city_Master as c on sh.City_Code =c.City_Code join state_Master as s on s.State_Code=sh.State_Code join mallStateCity_Master as m on m.Mall_Code=sh.Mall_Code where Shopping_Complex_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from shopping_Complex_Master where Shopping_Complex_Name like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text;
  • 82. 81 cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Shopping_Complexx = new shopping_Complex(); Shopping_Complexx.Shopping_Complex_Code = Convert.ToInt32(dr["Shopping_Complex_Code"]); Shopping_Complexx.Shopping_Complex_Name = Convert.ToString(dr["Shopping_Complex_Name"]); Shopping_Complexx.Shopping_Complex_Image = Convert.ToString(dr["Shopping_Complex_Image"]); Shopping_Complexx.State_Name = Convert.ToString(dr["State_Name"]); Shopping_Complexx.City_Name = Convert.ToString(dr["City_Name"]); Shopping_Complexx.Mall_Name = Convert.ToString(dr["Mall_Name"] + ""); shopping_ComplexList.Add(Shopping_Complexx); } } _connectionString.Close(); ResponseResult<shopping_Complex> resultShopping_Complex = new ResponseResult<shopping_Complex>(); resultShopping_Complex.Records= shopping_ComplexList; resultShopping_Complex.TotalRecords = totalRecords; return resultShopping_Complex; }
  • 83. 82 //bind function for Shopping complex and mall public DataSet BindMallShopping_Complex(shopping_Complex sc1) { SqlDataAdapter adp = new SqlDataAdapter("select * from shopping_Complex_Master where Mall_Code=@mall_Code", _connectionString); adp.SelectCommand.Parameters.Add("@mall_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Mall_Code); DataSet ds = new DataSet(); adp.Fill(ds); return ds; } //set function for Shopping Complex public void SetShopping_Complex(shopping_Complex sc1) { try { cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); cmd.Parameters.Add("@mall_Code",SqlDbType.Int).Value=Convert.ToInt32(s c1.Mall_Code); cmd.Parameters.Add("@shopping_Complex_Name", SqlDbType.VarChar,50).Value = sc1.Shopping_Complex_Name; cmd.Parameters.Add("@shopping_Complex_Image", SqlDbType.VarChar,50).Value = sc1.Shopping_Complex_Image; if (sc1.Shopping_Complex_Code == 0) { cmd.CommandText = "insert into shopping_Complex_Master (State_Code,City_Code,Mall_Code,Shopping_Complex_Name,Shopping_Com plex_Image)
  • 84. 83 values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Name,@s hopping_Complex_Image)"; } else { cmd.CommandText = "update shopping_Complex_Master set State_Code=@state_Code,City_Code=@city_Code, Mall_Code=@mall_Code,Shopping_Complex_Name=@shopping_Complex_Na me,Shopping_Complex_Image=@shopping_Complex_Image where Shopping_Complex_Code=@shopping_Complex_Code"; cmd.Parameters.Add("@shopping_Complex_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Shopping_Complex_Code); } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; } } //functions for brand //bind Brand function public DataSet BindBrand() { SqlDataAdapter adp = new SqlDataAdapter("select b.Brand_Code,b.Brand_Name,b.Brand_Image,sh.Shopping_Complex_Name, s.State_Name,c.City_Name,m.Mall_Name from Brand_Master as b join state_Master as s on b.State_Code=s.State_Code join city_Master as c on b.City_Code=c.City_Code join mallStateCity_Master as m on b.Mall_Code=m.Mall_Code join shopping_Complex_Master as sh on
  • 85. 84 b.Shopping_Complex_Code=sh.Shopping_Complex_Code", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //get function for Brand public void GetBrand(brand sc1) { cmd.CommandText = ("select * from brand_master where brand_Master.Brand_Code=@brand_Code"); cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value = sc1.Brand_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Brand_Code = Convert.ToInt32(dr["Brand_Code"]); sc1.Brand_Name = Convert.ToString(dr["Brand_Name"]); sc1.Brand_Image = Convert.ToString(dr["Brand_Image"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]); sc1.Shopping_Complex_Code = Convert.ToInt32(dr["Shopping_Complex_Code"]); } _connectionString.Close(); } //delete function for Brand public void DelBrand(int Brand_Code) {
  • 86. 85 SqlDataAdapter adp = new SqlDataAdapter("delete from brand_Master where Brand_Code=@brand_Code", _connectionString); adp.SelectCommand.Parameters.Add("@brand_Code", SqlDbType.Int).Value = Convert.ToInt32(Brand_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //paging and searching for Brand public ResponseResult<brand> BrandList(int pageNo, int pageSize, string searchStr = "") { List<brand> brandList = new List<brand>(); brand Brandd = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Brand_Code )AS rno,b.Brand_Code,b.Brand_Name,b.Brand_Image,sh.Shopping_Complex_Na me,s.State_Name,c.City_Name,m.Mall_Name from brand_Master as b join city_Master as c on b.City_Code =c.City_Code join state_Master as s on b.State_Code=s.State_Code join mallStateCity_Master as m on m.Mall_Code=b.Mall_Code join shopping_Complex_Master as sh on sh.Shopping_Complex_Code=b.Shopping_Complex_Code where Brand_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from brand_Master where Brand_Name like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
  • 87. 86 cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Brandd = new brand(); Brandd.Brand_Code = Convert.ToInt32(dr["Brand_Code"]); Brandd.Brand_Name = Convert.ToString(dr["Brand_Name"]); Brandd.Brand_Image = Convert.ToString(dr["Brand_Image"]); Brandd.State_Name = Convert.ToString(dr["State_Name"]); Brandd.City_Name = Convert.ToString(dr["City_Name"]); Brandd.Mall_Name = Convert.ToString(dr["Mall_Name"] + ""); Brandd.Shopping_Complex_Name = Convert.ToString(dr["Shopping_Complex_Name"]); brandList.Add(Brandd); } } _connectionString.Close(); ResponseResult<brand> resultBrand = new ResponseResult<brand>(); resultBrand.Records = brandList; resultBrand.TotalRecords= totalRecords; return resultBrand; } //bind function for Shopping complex and brand public DataSet BindShopping_ComplexBrand(brand sc1) { SqlDataAdapter adp = new SqlDataAdapter("select * from brand_Master where Shopping_Complex_Code=@shopping_Complex_Code", _connectionString);
  • 88. 87 adp.SelectCommand.Parameters.Add("@shopping_Complex_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Shopping_Complex_Code); DataSet ds = new DataSet(); adp.Fill(ds); return ds; } //set function for Shopping Complex public void SetBrand(brand sc1) { try { cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); cmd.Parameters.Add("@mall_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Mall_Code); cmd.Parameters.Add("@shopping_Complex_Code",SqlDbType.Int).Value=Co nvert.ToInt32(sc1.Shopping_Complex_Code); cmd.Parameters.Add("@brand_Name", SqlDbType.VarChar, 50).Value = sc1.Brand_Name; cmd.Parameters.Add("@brand_Image", SqlDbType.VarChar, 50).Value = sc1.Brand_Image; if (sc1.Brand_Code == 0) { cmd.CommandText = "insert into brand_Master (State_Code,City_Code,Mall_Code,Shopping_Complex_Code,Brand_Name,Br and_Image) values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Code,@br and_Name,@brand_Image)"; } else {
  • 89. 88 cmd.CommandText = "update brand_Master set State_Code=@state_Code,City_Code=@city_Code, Mall_Code=@mall_Code,Shopping_Complex_Code=@shopping_Complex_Cod e,Brand_Name=@brand_Name,Brand_Image=@brand_Image where Brand_Code=@brand_Code"; cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Brand_Code); } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; } } //functions for sale //bind Sale function public DataSet BindSale() { SqlDataAdapter adp = new SqlDataAdapter("select sa.Sale_Code,sa.Sale_Percent,sa.Start_Date,sa.End_Date,b.Brand_Name,sh. Shopping_Complex_Name,s.State_Name,c.City_Name,m.Mall_Name from sale_Master as sa join state_Master as s on sa.State_Code=s.State_Code join city_Master as c on sa.City_Code=c.City_Code join mallStateCity_Master as m on sa.Mall_Code=m.Mall_Code join shopping_Complex_Master as sh on sa.Shopping_Complex_Code=sh.Shopping_Complex_Code join brand_Master as b on sa.Brand_Code=b.Brand_Code", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds);
  • 90. 89 return (ds); } //get function for Sale public void GetSale(sale sc1) { cmd.CommandText = ("select * from sale_master where sale_Master.Sale_Code=@sale_Code"); cmd.Parameters.Add("@sale_Code",SqlDbType.Int).Value = sc1.Sale_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Sale_Code = Convert.ToInt32(dr["Sale_Code"]); sc1.Sale_Percent = Convert.ToString(dr["Sale_Percent"]); sc1.Start_Date = Convert.ToString(dr["Start_Date"]); sc1.End_Date = Convert.ToString(dr["End_Date"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Mall_Code = Convert.ToInt32(dr["Mall_Code"]); sc1.Shopping_Complex_Code = Convert.ToInt32(dr["Shopping_Complex_Code"]); sc1.Brand_Code = Convert.ToInt32(dr["Brand_Code"]); } _connectionString.Close(); } //delete function for Sale public void DelSale(int Sale_Code) { SqlDataAdapter adp = new SqlDataAdapter("delete from sale_Master where Sale_Code=@sale_Code", _connectionString);
  • 91. 90 adp.SelectCommand.Parameters.Add("@sale_Code", SqlDbType.Int).Value = Convert.ToInt32(Sale_Code); DataSet ds = new DataSet(); adp.Fill(ds); } //paging and searching for Sale public ResponseResult<sale> SaleList(int pageNo, int pageSize, string searchStr = "") { List<sale> saleList = new List<sale>(); sale Salee = null; int totalRecords; _connectionString.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Sale_Code )AS rno,sa.Sale_Code,sa.Sale_Percent,sa.Start_Date,sa.End_Date,b.Brand_Nam e,sh.Shopping_Complex_Name,s.State_Name,c.City_Name,m.Mall_Name from sale_Master as sa join city_Master as c on sa.City_Code =c.City_Code join state_Master as s on sa.State_Code=s.State_Code join mallStateCity_Master as m on m.Mall_Code=sa.Mall_Code join shopping_Complex_Master as sh on sh.Shopping_Complex_Code=sa.Shopping_Complex_Code join brand_Master as b on sa.Brand_Code=b.Brand_Code where Sale_Percent like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from sale_Master where Sale_Percent like '%" + searchStr + "%'", _connectionString); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo;
  • 92. 91 cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Salee = new sale(); Salee.Sale_Code = Convert.ToInt32(dr["Sale_Code"]); Salee.Sale_Percent = Convert.ToString(dr["Sale_Percent"]); Salee.Start_Date = Convert.ToString(dr["Start_Date"]); Salee.End_Date = Convert.ToString(dr["End_Date"]); Salee.State_Name = Convert.ToString(dr["State_Name"]); Salee.City_Name = Convert.ToString(dr["City_Name"]); Salee.Mall_Name = Convert.ToString(dr["Mall_Name"] + ""); Salee.Shopping_Complex_Name = Convert.ToString(dr["Shopping_Complex_Name"]); Salee.Brand_Name = Convert.ToString(dr["Brand_Name"]); saleList.Add(Salee); } } _connectionString.Close(); ResponseResult<sale> resultSale = new ResponseResult<sale>(); resultSale.Records = saleList; resultSale.TotalRecords = totalRecords; return resultSale; } //bind function for brand and sale public DataSet BindBrandSale(sale sc1) { SqlDataAdapter adp = new SqlDataAdapter("select * from sale_Master where Brand_Code=@brand_Code", _connectionString);
  • 93. 92 adp.SelectCommand.Parameters.Add("@brand_Code", SqlDbType.Int).Value = sc1.Brand_Code; DataSet ds = new DataSet(); adp.Fill(ds); return ds; } //set function for Shopping Complex public void SetSale(sale sc1) { try { cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.State_Code); cmd.Parameters.Add("@city_Code",SqlDbType.Int).Value = Convert.ToInt32(sc1.City_Code); cmd.Parameters.Add("@mall_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Mall_Code); cmd.Parameters.Add("@shopping_Complex_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Shopping_Complex_Code); cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Brand_Code); cmd.Parameters.Add("@sale_Percent", SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.Sale_Percent); cmd.Parameters.Add("@start_Date",SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.Start_Date); cmd.Parameters.Add("@end_Date", SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.End_Date); if (sc1.Sale_Code == 0) { cmd.CommandText = "insert into sale_Master (State_Code,City_Code,Mall_Code,Shopping_Complex_Code,Brand_Code,Sal e_Percent,Start_Date,End_Date)
  • 94. 93 values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Code,@br and_Code,@sale_Percent,@start_Date,@end_Date)"; } else { cmd.CommandText = "update brand_Master set State_Code=@state_Code,City_Code=@city_Code, Mall_Code=@mall_Code,Shopping_Complex_Code=@shopping_Complex_Cod e,Brand_Code=@brand_Code,Sale_Percent=@sale_Percent,Start_Date=@star t_Date,End_Date=@end_Date where Sale_Code=@sale_Code"; cmd.Parameters.Add("@sale_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Sale_Code); } _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; } } //function to bind radio buttonlists //bind mall radio list public DataSet BindRMall(mallStateCity sc1) { SqlDataAdapter adp = new SqlDataAdapter("select Mall_Name,Mall_Code from mallStateCity_Master where State_Code=@state_Code and City_Code=@city_Code",_connectionString); adp.SelectCommand.Parameters.Add("@state_Code", SqlDbType.Int).Value = sc1.State_Code;
  • 95. 94 adp.SelectCommand.Parameters.Add("@city_Code", SqlDbType.Int).Value = sc1.City_Code; DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //bind shopping complex radio list public DataSet BindRShopping_Complex(shopping_Complex sc1) { SqlDataAdapter adp = new SqlDataAdapter("select Shopping_Complex_Name,Shopping_Complex_Code from shopping_Complex_Master where State_Code=@state_Code and City_Code=@city_Code and Mall_Code=@mall_Code",_connectionString); adp.SelectCommand.Parameters.Add("@state_Code", SqlDbType.Int).Value = sc1.State_Code; adp.SelectCommand.Parameters.Add("@city_Code", SqlDbType.Int).Value = sc1.City_Code; adp.SelectCommand.Parameters.Add("@mall_Code", SqlDbType.Int).Value = sc1.Mall_Code; DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //bind radio list brand public DataSet BindRBrand(brand sc1) { SqlDataAdapter adp = new SqlDataAdapter("select Brand_Name,Brand_Code from brand_Master where State_Code=@state_Code and City_Code=@city_Code and Mall_Code=@mall_Code and Shopping_Complex_Code=@shopping_Complex_Code", _connectionString); adp.SelectCommand.Parameters.Add("@state_Code", SqlDbType.Int).Value = sc1.State_Code;
  • 96. 95 adp.SelectCommand.Parameters.Add("@city_Code", SqlDbType.Int).Value = sc1.City_Code; adp.SelectCommand.Parameters.Add("@mall_Code", SqlDbType.Int).Value = sc1.Mall_Code; adp.SelectCommand.Parameters.Add("@shopping_Complex_Code", SqlDbType.Int).Value = sc1.Shopping_Complex_Code ; DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //function for data list public DataSet BindDlistBrand() { SqlDataAdapter adp = new SqlDataAdapter("select b.Brand_Name,b.Brand_Image,b.Brand_Code,s.State_Name,c.City_Name,sh .Shopping_Complex_Name,m.Mall_Name from brand_Master as b join state_Master as s on b.State_Code=s.State_Code join city_Master as c on b.City_Code=c.City_Code join mallStateCity_Master as m on b.Mall_Code=m.Mall_Code join shopping_Complex_Master as sh on b.Shopping_Complex_Code=sh.Shopping_Complex_Code", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //function to bind details of brands in detail view public void BindDlistBrandDetails(brand sc1) { cmd.CommandText =("select b.Brand_Name,b.Brand_Image,b.Brand_Code,s.State_Name,c.City_Name,sh .Shopping_Complex_Name,m.Mall_Name from brand_Master as b join state_Master as s on b.State_Code=s.State_Code join city_Master as c on b.City_Code=c.City_Code join mallStateCity_Master as m on
  • 97. 96 b.Mall_Code=m.Mall_Code join shopping_Complex_Master as sh on b.Shopping_Complex_Code=sh.Shopping_Complex_Code where Brand_Code=@brand_Code"); cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value = sc1.Brand_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Brand_Code = Convert.ToInt32(dr["Brand_Code"]); sc1.Brand_Image = Convert.ToString(dr["Brand_Image"]); sc1.Brand_Name = Convert.ToString(dr["Brand_Name"]); sc1.State_Name = Convert.ToString(dr["State_Name"]); sc1.City_Name = Convert.ToString(dr["City_Name"]); sc1.Mall_Name = Convert.ToString(dr["Mall_Name"]); sc1.Shopping_Complex_Name = Convert.ToString(dr["Shopping_Complex_Name"]);; } _connectionString.Close(); } //function to get start and end date of sale public void Filter_Sale(sale sc1) { cmd.CommandText = ("select Start_Date,End_Date from sale_Master where State_Code=@state_Code and City_Code=@city_Code and Mall_Code=@mall_Code and Shopping_Complex_Code=@shopping_Complex_Code and Brand_Code=@brand_Code and Sale_Percent=@sale_Percent"); cmd.Parameters.Add("@state_Code", SqlDbType.Int).Value = sc1.State_Code;
  • 98. 97 cmd.Parameters.Add("@city_Code", SqlDbType.Int).Value = sc1.City_Code; cmd.Parameters.Add("@mall_Code",SqlDbType.Int).Value = sc1.Mall_Code; cmd.Parameters.Add("@shopping_Complex_Code", SqlDbType.Int).Value = sc1.Shopping_Complex_Code; cmd.Parameters.Add("@brand_Code", SqlDbType.Int).Value = sc1.Brand_Code; cmd.Parameters.Add("@sale_Percent", SqlDbType.VarChar, 50).Value = Convert.ToString(sc1.Sale_Percent); _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Start_Date = Convert.ToString(dr["Start_Date"]); sc1.End_Date = Convert.ToString(dr["End_Date"]); } _connectionString.Close(); } //code to add Managers public void SubmitManager(addManager sc1) { try { if (sc1.Manager_Code == 0) { cmd.CommandText = "insert into addManager_Master values(@Manager_Name,@Email_Id,@Password,@Phone_No,@State_Code,@ City_Code,@Multiplex_Code)"; } else
  • 99. 98 { cmd.CommandText = "update addManager_Master set Manager_Name=@Manager_Name,Email_Id=@Email_Id,Password=@Passwor d,Phone_No=@Phone_No,State_Code=@State_Code,City_Code=@City_Code, Multiplex_Code=@Multiplex_Code where Manager_Code=@Manager_Code"; cmd.Parameters.Add("@Manager_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Manager_Code); } cmd.Parameters.Add("@Manager_Name", SqlDbType.VarChar).Value = sc1.Manager_Name; cmd.Parameters.Add("@Email_Id", SqlDbType.VarChar, 50).Value = sc1.Email_Id; cmd.Parameters.Add("@Password", SqlDbType.VarChar, 50).Value = sc1.Password; cmd.Parameters.Add("@Phone_No",SqlDbType.VarChar, 50).Value = sc1.Phone_No; cmd.Parameters.Add("@State_Code", SqlDbType.Int).Value = sc1.State_Code; cmd.Parameters.Add("@City_Code", SqlDbType.Int).Value = sc1.City_Code; cmd.Parameters.Add("@Multiplex_Code", SqlDbType.Int).Value = sc1.Multiplex_Code; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; } } public DataSet BindManager()
  • 100. 99 { SqlDataAdapter adp = new SqlDataAdapter("select * from addManager_Master ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } public void GetManagerSCMWise(addManager sc1) { cmd.CommandText = ("select State_Code,City_Code,Multiplex_code from addManager_Master where Email_Id=@Email_Id "); cmd.Parameters.Add("@Email_Id", SqlDbType.Int).Value = sc1.Email_Id; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]); } _connectionString.Close(); } public void DeleteManager(int Manager_Code) { SqlDataAdapter adp = new SqlDataAdapter("delete from addManager_Master where Manager_Code=@Manager_Code", _connectionString); adp.SelectCommand.Parameters.Add("@Manager_Code", SqlDbType.Int).Value = Convert.ToInt32(Manager_Code); DataSet ds = new DataSet(); adp.Fill(ds);
  • 101. 100 } public void GetManager(addManager sc1) { cmd.CommandText = ("select * from addManager_Master where Manager_Code=@Manager_Code"); cmd.Parameters.Add("@Manager_Code",SqlDbType.Int).Value = sc1.Manager_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Manager_Name = Convert.ToString(dr["Manager_Name"]); sc1.Email_Id = Convert.ToString(dr["Email_Id"]); sc1.Password = Convert.ToString(dr["Password"]); sc1.Phone_No = Convert.ToString(dr["Phone_No"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]); } _connectionString.Close(); } public ResponseResult<addManager> ManagerList(int pageNo, int pageSize, string searchStr = "") { List<addManager> ManagerList = new List<addManager>(); addManager mngr = null; int totalRecords; SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Manager_Code )AS rno, * from addManager_Master where Manager_Name like '%" + searchStr + "%') as t
  • 102. 101 where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from addManager_Master where Manager_Name like '%" + searchStr + "%'", _connectionString); _connectionString.Open(); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { mngr = new addManager(); mngr.Manager_Code = Convert.ToInt32(dr["Manager_Code"]); mngr.Manager_Name = (dr["Manager_Name"] + " "); mngr.Email_Id = (dr["Email_Id"] + " "); mngr.Password = (dr["Password"] + " "); mngr.Phone_No = (dr["Phone_No"] + " "); mngr.State_Code = Convert.ToInt32(dr["State_Code"] + ""); mngr.City_Code = Convert.ToInt32(dr["City_Code"] + ""); mngr.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"] + ""); ManagerList.Add(mngr); } } _connectionString.Close();
  • 103. 102 ResponseResult<addManager> resultmanager = new ResponseResult<addManager>(); resultmanager.Records= ManagerList; resultmanager.TotalRecords= totalRecords; return resultmanager; } //Code To add Employee public void SubmitEmployee(employee sc1) { try { if (sc1.Emp_Code == 0) { cmd.CommandText = "insert into employee_Master values(@Employee_Name,@Email_Id,@Password,@Phone_No,@Date_Of_Join ing,@State_Code,@City_Code,@Multiplex_Code)"; } else { cmd.CommandText = "update employee_Master set Employee_Name=@Employee_Name,Email_Id=@Email_Id,Password=@Passw ord,Phone_No=@Phone_No,Date_Of_Joining=@Date_Of_Joining,State_Code= @State_Code,City_Code=@City_Code,Multiplex_Code=@Multiplex_Code where Emp_Code=@Emp_Code"; cmd.Parameters.Add("@Emp_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Emp_Code); } cmd.Parameters.Add("@Employee_Name", SqlDbType.VarChar).Value = sc1.Employee_Name; cmd.Parameters.Add("@Email_Id", SqlDbType.VarChar, 50).Value = sc1.Email_Id; cmd.Parameters.Add("@Password", SqlDbType.VarChar, 50).Value = sc1.Password;
  • 104. 103 cmd.Parameters.Add("@Phone_No",SqlDbType.VarChar, 50).Value = sc1.Phone_No; cmd.Parameters.Add("@Date_Of_Joining",SqlDbType.VarChar, 50).Value = sc1.Date_Of_Joining; cmd.Parameters.Add("@State_Code", SqlDbType.Int).Value = sc1.State_Code; cmd.Parameters.Add("@City_Code", SqlDbType.Int).Value = sc1.City_Code; cmd.Parameters.Add("@Multiplex_Code", SqlDbType.Int).Value = sc1.Multiplex_Code; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); } catch (Exception ex) { throw ex; } } public DataSet BindEmployee() { SqlDataAdapter adp = new SqlDataAdapter("select * from employee_Master ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } public void DeleteEmployee(int code) { SqlDataAdapter adp = new SqlDataAdapter("delete from employee_Master where Emp_Code=@Emp_Code", _connectionString);
  • 105. 104 adp.SelectCommand.Parameters.Add("@Emp_Code", SqlDbType.Int).Value = Convert.ToInt32(code); DataSet ds = new DataSet(); adp.Fill(ds); } public void GetEmployee(employee sc1) { cmd.CommandText = ("select * from employee_Master where Emp_Code=@Emp_Code"); cmd.Parameters.Add("@Emp_Code", SqlDbType.Int).Value = sc1.Emp_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Employee_Name = Convert.ToString(dr["Employee_Name"]); sc1.Email_Id = Convert.ToString(dr["Email_Id"]); sc1.Password = Convert.ToString(dr["Password"]); sc1.Phone_No = Convert.ToString(dr["Phone_No"]); sc1.Date_Of_Joining = Convert.ToDateTime(dr["Date_Of_Joining"]); sc1.State_Code = Convert.ToInt32(dr["State_Code"]); sc1.City_Code = Convert.ToInt32(dr["City_Code"]); sc1.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"]); } _connectionString.Close(); } public ResponseResult<employee> EmployeeList(int pageNo, int pageSize, string searchStr = "") { List<employee> EmployeeList = new List<employee>();
  • 106. 105 employee emp= null; int totalRecords; SqlCommand cmd = new SqlCommand("SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Emp_Code )AS rno,* from employee_Master where Employee_Name like '%" + searchStr + "%') as t where rno>((" + pageNo + "-1)*" + pageSize + ") AND rno<=((" + pageNo + ")*" + pageSize + ")", _connectionString); SqlCommand cmd1 = new SqlCommand("select COUNT(*) from employee_Master where Employee_Name like '%" + searchStr + "%'", _connectionString); _connectionString.Open(); totalRecords = Convert.ToInt32(cmd1.ExecuteScalar()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize; cmd.Parameters.Add("@pageNo",SqlDbType.Int).Value = pageNo; cmd.Parameters.Add("@searchString",SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { emp = new employee(); emp.Emp_Code = Convert.ToInt32(dr["Emp_code"] + ""); emp.Employee_Name = (dr["Employee_Name"] + " "); emp.Email_Id = (dr["Email_Id"] + " "); emp.Password = (dr["Password"] + " "); emp.Phone_No = (dr["Phone_No"] + " "); emp.Date_Of_Joining = Convert.ToDateTime((dr["Date_Of_Joining"] + " ")); emp.State_Code = Convert.ToInt32(dr["State_Code"] + " "); emp.City_Code = Convert.ToInt32(dr["City_Code"] + " ");
  • 107. 106 emp.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"] + " "); EmployeeList.Add(emp); } } _connectionString.Close(); ResponseResult<employee> resultemployee = new ResponseResult<employee>(); resultemployee.Records= EmployeeList; resultemployee.TotalRecords = totalRecords; return resultemployee; } public void SubmitAttendenceIn(attendenceTimeIn sc1) { try { cmd.CommandText = "insert into attendenceTimeIn_Master (Emp_Code,Date,TimeIn) values(@Emp_Code,@Date,@TimeIn)"; cmd.Parameters.Add("@Emp_Code", SqlDbType.Int).Value = sc1.Emp_Code; cmd.Parameters.Add("@Date", SqlDbType.VarChar, 50).Value = sc1.Date; cmd.Parameters.Add("@TimeIn", SqlDbType.VarChar).Value = sc1.TimeIn; _connectionString.Open(); cmd.Connection= _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); cmd.Dispose(); } catch (Exception ex) { throw ex;
  • 108. 107 } } public void SubmitAttendenceOut(attendenceTimeOut sc1) { try { cmd.CommandText = "insert into attendenceTimeOut_Master (Emp_Code,Date,TimeOut) values(@Emp_Code1,@Date1,@TimeIn1)"; cmd.Parameters.Add("@Emp_Code1", SqlDbType.Int).Value = sc1.Emp_Code; cmd.Parameters.Add("@Date1", SqlDbType.VarChar, 50).Value = sc1.Date; cmd.Parameters.Add("@TimeIn1", SqlDbType.VarChar).Value = sc1.TimeOut; _connectionString.Open(); cmd.Connection= _connectionString; cmd.ExecuteNonQuery(); _connectionString.Close(); cmd.Dispose(); } catch (Exception ex) { throw ex; } } public DataSet BindAttendence() { SqlDataAdapter adp = new SqlDataAdapter("select attendenceTimeIn_Master.TimeIn_Code,attendenceTimeIn_Master.TimeIn, attendenceTimeOut_Master.TimeOut from attendenceTimeOut_Master join attendenceTimeIn_Master on attendenceTimeOut_Master.Date=attendenceTimeIn_Master.Date", _connectionString);