This report contain the detailed structure of a multiplex system.
How it can be manages.
The tools and platform used.
How does it work and what are its benefits.
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
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
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
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;
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;
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;
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
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;
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);
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);
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;