project report on multiplex management system
TRANSCRIPT
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 ManagementMaharishi Markandeshwar University, Mullana (Ambala)
May 2014
0
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 RaiPlace: (Associate Professor)
1
ACKNOWLEDGEMENTThe 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
2
1311710ABSTRACT
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.
3
LIST OF FIGURES.No. Figure Heading Page No.
1. 2.0 SDLC Phases 10 2. 3.3.1 Incremental Level 123. 4.1.2.1 0 Level DFD 244. 4.1.2.2 Level 1 DFD 25
5. 4.1.2.3 Context Level DFD 266. 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 3010. 4.1.2.3 Admin Home Page 3111. 4.1.2.4 Admin State form Page To Add States 3112. 4.1.2.5 Admin City form To Add Cities 3213. 4.1.2.6 Admin Multiplex Page To Add Multiplex 3214. 4.1.2.7 Admin Multiplex Page To Add Movies 3315. 4.1.2.8 Admin Page For Adding Movie 3316. 4.1.2.9 Admin Page For Adding Movie Timings 34 17. 4.1.2.10 Admin Page for Gallery 3418. 4.1.2.11 Admin Page For Editing the Image 3529. 4.1.2.12 Admin Page for Adding Malls 3520. 4.1.2.13 Admin Page for Adding Shopping Malls 3621. 4.1.2.14 Admin Page for Adding Brands 3622. 4.1.2.15 Admin Page for Displaying Sales 3723. 4.1.2.16 User Registration Page 37
4
24. 4.1.2.17 Page For viewing Sale 3825. 4.1.2.18 Page For viewing Brand 8826. 4.1.2.18.1 Page For viewing Brand 3927. 4.1.2.19 Seat Booking Section 39
28. 4.1.2.20 Manager's Page 40
LIST OF TABLES
S.No. Table Name Page No. 1. state_Master 172. city_Master 183. multiplex_Master 184. audi_Master 195. movie_Master 196. movie_Timing_Master 207. movie_Image_Master 208. user_Details 219. booking_Master 2110. mallStateCity_Master 2211. shopping_Complex_Master 2212. brand_Master 2313. sale_Master 23
5
LIST OF CONTENTS
CHAPTER CONTENT HEADER PAGE No. List of Figures 4 List of Tables 5Chapter 1 Company Profile 7Chapter 2 Project Introduction 8Chapter 3 SDLC Phases 11Chapter 4 System Design 16Chapter 5 User Interface 30Chapter 6 Testing 109Chapter 7 Maintainence & Implementation 111 Future Scope 113 Conclusion 113 Bibliography 114
6
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.
7
Software development. Product Development. Software Training. ERP Training.
PROJECT INTRODUCTION
2.1 Introduction Of The ProjectMultiplex Management SystemA 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 ProjectThe 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.
8
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.
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:-
9
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 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.
10
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.
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.
11
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.
12
4. Testing.5. Maintenance.
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 tierThis 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
13
3.3.1 Input & output of the project:Inputs Of the Project
Databases and records of employee. 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 RequirementHardware 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
14
3.4 FEASIBILITY STUDYIt 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.
15
"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:
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
16
implementation of the feasible system. It emphasis on translating design specifications to performance specifications.
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
17
4.1.1.2 Table state_Master
4.1.1.3 Table city_Master
18
4.1.1.4 Table multiplex_Master
4.1.1.5 Table movie_Master
19
4.1.1.6 Table movieTiming_Master
4.1.1.7 Table movieImage_Master
20
4.1.1.8 Table booking_Master
4.1.1.9 Table mallStateCity_Master
21
4.1.1.10 Table shopping_Complex_Master
4.1.1.11 Table brand_Master
22
4.1.1.12 Table sale_Master
4.1.13 Table audi_Master
23
4.1.2 DFD's4.1.2.1 0 Level DFD
24
UserMultiplex management system
Registration
Ticket
Registered
Booked/Cancelled
Watched Movie
Booking
Malls
Shopping Complex
Brands
4.1.2.2 Level 1 DFD
25
2
Login
User details
1
Registration
Enter Detai
3
Ticket Booking /Cancellation System
User Code allotted
Ticket_BookingUser Details
mallStateCity
4.1.2.3 Context Level DFD
26
4
Management
Manages Ticket Booking //ca
5 MallManagement
admin
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
30
accepted data 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 Layerusing 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(); adp.Fill(ds);
42
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 getting state 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 public ResponseResult<state> StateList(int pageNo, int pageSize, string searchStr = "")
43
{ 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(city sc1) { 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 getting city 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()); cmd.CommandType = CommandType.Text; cmd1.CommandType = CommandType.Text;
47
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_seats,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); } //search function for audi
49
//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 public ResponseResult<audi> AudiList(int pageNo, int pageSize, string searchStr = "")
50
{ 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"] + ""); audiList.Add(audii);
51
} } _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,@language,@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=@genres,Audi_Code=@audi_Code,Multiplex_Code=@multiplex_Code,State_Code=@state_Code,City_Code=@city_Code where Movies_Code=@movie_Code"; cmd.Parameters.Add("@movie_Code", SqlDbType.Int).Value = Convert.ToInt32(sc1.Movies_Code); }
52
cmd.Parameters.Add("@movie_Name", SqlDbType.VarChar, 50).Value = sc1.Movie_Name; 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,m
53
o.End_date,mo.Language,mo.Genres,a.Audi_No,m.Multiplex_Name,s.State_Name,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(); } catch (Exception ex)
60
{ 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_Path where 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_Name 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); } //bind movies audi wise function public DataSet BindAudiMovie(movie sc1)
62
{ 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(); }
//delete function for movie timings public void DelMovieTimings(int MovieTimings_Code)
63
{ 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_Name 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; cmd1.CommandType = CommandType.Text; cmd.Parameters.Add("@pageSize", SqlDbType.Int).Value = pageSize;
64
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 { if (sc1.MovieTimings_Code == 0)
65
{ 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 public void SearchMovie(movie sc1)
66
{ 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; } //function for getting audi as per movie
67
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 getting show 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 public void SubmitBooking(booking sc1) { try
68
{ cmd.CommandText = "insert into booking_Master(User_Code,State_Code,City_Code,Multiplex_Code,Date,MovieTiming_Code,Movies_Code,Audi_Code,Platinum_Seat,Gold_Seat,Silver_Seat,Bronze_Seat,Seats,Total_Price) values(@User_Code,@State_Code,@City_Code,@Multiplex_Code,@Date,@MovieTiming_Code,@Movie_Code,@Audi_Code,@Platinum_Seat,@Gold_Seat,@Silver_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; cmd.Parameters.Add("@Bronze_Seat", SqlDbType.VarChar, 50).Value = sc1.Bronze_Seat; cmd.Parameters.Add("@Seats", SqlDbType.VarChar, 50).Value = sc1.Seats;
69
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; cmd.Parameters.Add("@Phone_No", SqlDbType.VarChar, 50).Value = sc1.Mobile_No; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery();
70
_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; } } //paging for viewing brand images by user public ResponseResult<brand> BrandViewList(int pageNo, int pageSize, string searchStr = "") { List<brand> brandviewList = new List<brand>();
71
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); } } _connectionString.Close();
72
ResponseResult<brand> resultBrandView = new ResponseResult<brand>(); resultBrandView.Records = brandviewList; resultBrandView.TotalRecords = totalImages; return resultBrandView; } //function for getting all 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; cmd.Parameters.Add("@date", SqlDbType.VarChar, 50).Value = sc1.Date; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) {
73
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); 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);
74
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=Convert.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) { 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();
75
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; 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
76
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); } } _connectionString.Close(); ResponseResult<mallStateCity> resultMall = new ResponseResult<mallStateCity>(); resultMall.Records = mallList; resultMall.TotalRecords = totalRecords;
77
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) { cmd.CommandText = "insert into mallStateCity_Master (State_Code,City_Code,Mall_Name) values(@state_Code,@city_Code,@mall_Name)"; } else {
78
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_Complex_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); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } //get function for Shopping_Complex public void GetShopping_Complex(shopping_Complex sc1) {
79
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) { 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);
80
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; 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;
81
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; } //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);
82
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(sc1.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_Complex_Image) values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Name,@shopping_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
83
_Name,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 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) {
84
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) { 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 = "")
85
{ 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_Name,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; 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();
86
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); 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; }
87
//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=Convert.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,Brand_Image) values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Code,@brand_Name,@brand_Image)"; } else { cmd.CommandText = "update brand_Master set State_Code=@state_Code,City_Code=@city_Code, Mall_Code=@mall_Code,Shopping_Complex_Code=@shopping_Complex_Code,Brand_Name=@brand_Name,Brand_Image=@brand_Image where Brand_Code=@brand_Code";
88
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); return (ds); } //get function for Sale public void GetSale(sale sc1) {
89
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); 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
90
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_Name,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; cmd.Parameters.Add("@searchString", SqlDbType.VarChar, 50).Value = searchStr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows)
91
{ 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); adp.SelectCommand.Parameters.Add("@brand_Code", SqlDbType.Int).Value = sc1.Brand_Code; DataSet ds = new DataSet(); adp.Fill(ds); return ds;
92
} //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,Sale_Percent,Start_Date,End_Date) values(@state_Code,@city_Code,@mall_Code,@shopping_Complex_Code,@brand_Code,@sale_Percent,@start_Date,@end_Date)"; } else { cmd.CommandText = "update brand_Master set State_Code=@state_Code,City_Code=@city_Code,
93
Mall_Code=@mall_Code,Shopping_Complex_Code=@shopping_Complex_Code,Brand_Code=@brand_Code,Sale_Percent=@sale_Percent,Start_Date=@start_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; 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)
94
{ 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; 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();
95
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 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();
96
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; 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);
97
_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 { cmd.CommandText = "update addManager_Master set Manager_Name=@Manager_Name,Email_Id=@Email_Id,Password=@Password,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;
98
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() { SqlDataAdapter adp = new SqlDataAdapter("select * from addManager_Master ", _connectionString); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } public void GetManagerSCMWise(addManager sc1) {
99
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); } 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;
100
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 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;
101
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(); ResponseResult<addManager> resultmanager = new ResponseResult<addManager>(); resultmanager.Records = ManagerList; resultmanager.TotalRecords = totalRecords; return resultmanager; } //Code To add Employee public void SubmitEmployee(employee sc1)
102
{ try { if (sc1.Emp_Code == 0) { cmd.CommandText = "insert into employee_Master values(@Employee_Name,@Email_Id,@Password,@Phone_No,@Date_Of_Joining,@State_Code,@City_Code,@Multiplex_Code)"; } else { cmd.CommandText = "update employee_Master set Employee_Name=@Employee_Name,Email_Id=@Email_Id,Password=@Password,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; 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;
103
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); 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");
104
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>(); 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);
105
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"] + " "); emp.Multiplex_Code = Convert.ToInt32(dr["Multiplex_Code"] + " "); EmployeeList.Add(emp); } } _connectionString.Close();
106
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; } } public void SubmitAttendenceOut(attendenceTimeOut sc1) { try {
107
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); DataSet ds = new DataSet(); adp.Fill(ds); return (ds); } public void BindAttendenceTimeWise(attendenceTimeIn sc1) {
108
cmd.CommandText = ("select attendenceTimeIn_Master.TimeIn,attendenceTimeIn_Master.TimeIn_Code, attendenceTimeIn_Master.Date, attendenceTimeOut_Master.TimeOut from attendenceTimeOut_Master join attendenceTimeIn_Master on attendenceTimeOut_Master.Date=attendenceTimeIn_Master.Date where attendenceTimeIn_Master.TimeIn_Code=@timeincode "); cmd.Parameters.Add("@timeincode", SqlDbType.Int).Value = sc1.TimeIn_Code; _connectionString.Open(); cmd.Connection = _connectionString; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); sc1.Date = Convert.ToString(dr["date"]); sc1.TimeIn = Convert.ToString(dr["TimeIn"]); sc1.TimeOut = Convert.ToString(dr["TimeOut"]); } _connectionString.Close(); }// function for time in public void EditAttendenceTimeIn(attendenceTimeIn sc1) { cmd.CommandText = "update attendenceTimeIn_Master set TimeIn=@TimeIn where TimeIn_Code=@TimeIn_Code"; cmd.Parameters.Add("@TimeIn_Code", SqlDbType.Int).Value = sc1.TimeIn_Code; cmd.Parameters.Add("@TimeIn", SqlDbType.VarChar,50).Value = sc1.TimeIn; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); } // function for timeout
109
public void EditAttendenceTimeOut(attendenceTimeOut sc1) { cmd.CommandText = "update attendenceTimeOut_Master set TimeOut=@TimeOut where TimeOut_Code=@TimeOut_Code"; cmd.Parameters.Add("@TimeOut_Code", SqlDbType.Int).Value = sc1.TimeOut_Code; cmd.Parameters.Add("@TimeOut", SqlDbType.VarChar, 50).Value = sc1.TimeOut; _connectionString.Open(); cmd.Connection = _connectionString; cmd.ExecuteNonQuery(); } }}
6. Testing 6.1 Methodology of Testing used in the project
Testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test. Software testing also provides an objective, independent view of the software to allow the business to appreciate and understand the risks at implementation of the software. In Project :White-Box TestingAs the knowledge of Internal Coding Structure is the prerequisite , so Coding and Designing part can be said to be categorized under White Box Testing Techniques as while connecting with SQL Server through coding or while forming our desired form ,we can make many mistakes like Typing Errors, Type Mismatch Error , taking Array Out Of Bound or Run Time Errors may occur like Memory Overflow etc.All these errors have to detect by the programmer
110
itself for the successful execution of the program and in turn project(the sole aim of Developer).Black-Box TestingWhen i was finally ready with Project ,then applied a strategy at that time to determine if the Project is ready to implement and will be able to run successfully under any circumstances and will not throw any exception or give any error.Here i provided multiple inputs and checked for the outputs.
6.2Test Cases
7. Implementation/Maintenance
7.1 For implementation and maintainance: Installing of Visual Studio 2010 is must.
111
Installing MS SQL Server 2008 is needed.
Software Maintainance is the modification of a software product after delivery to correct faults to improve performance or other attributes.Types of maintainance:
Corrective Maintainance :- Reactive Modification. Adaptive Maintainance :- Adaptive to changing
enviornment. Perfective Maintainance :- Improve Performance. Preventive Maintainance :- Modification of product.
FUTURE SCOPE:The project "The Multiplex Management System" can be used by the bigger brands to manage their multiplexes and malls located
112
at various place very easily and can be integrated as a whole mall management.
CONCLUSION:"The Multiplex Management System" is an application that enables the user to book movie tickets online in the multiplexes they wish.With this , the user can check for brands in various Malls and Sale% and duration on them.From admin point of view, it enables them to handle the complete multiplex online and appointing managers to them to handle employees.Overall it is a project with multiple use.
Bibliography And References
BOOKS REFFERED
113
BEGINNING ASP.NET WITH C# (WROX PUBLICATION) ASP.NET 3.4 Unleashed –SamsMastering ASP.NET with C#Wrox Professional ASP.NET 3.4 in C#www.w3school.com
114