protected void ConfirmDelete_Click(object sender, EventArgs e) { string memberno = (string)Session["memberno"]; ClubBaistSampleHandler RequestDirector; RequestDirector = new ClubBaistSampleHandler(); Reserveteetimes TeeTimeInfo; TeeTimeInfo = new Reserveteetimes(); TeeTimeInfo.MemberNo = memberno; TeeTimeInfo.NoofCarts = Convert.ToInt32(NoOfCarts.Text); TeeTimeInfo.Player1 = Player1.Text; TeeTimeInfo.Player2 = Player2.Text; TeeTimeInfo.Player3 = Player3.Text; TeeTimeInfo.date = Date1.Text; TeeTimeInfo.time1 = Time.Text; Boolean Confirmation; Confirmation = RequestDirector.ModifyTeeTime(TeeTimeInfo); if (Confirmation) { Response.Write("Your Tee Time Updated"); } }
public Boolean AddMember(Reserveteetimes Reserve) { Reserveteetime reservemanager; reservemanager = new Reserveteetime(); Boolean Confirmation; Confirmation = reservemanager.Addtime(Reserve); return(Confirmation); }
public Boolean ModifyTeeTime(Reserveteetimes Teetimeupdate) { Reserveteetime CustomerManager; CustomerManager = new Reserveteetime(); Boolean Confirmation; Confirmation = CustomerManager.UpdateCustomer(Teetimeupdate); return(Confirmation); }
public Boolean deleteteetime(Reserveteetimes Reserve) { Reserveteetime CustomerManager; CustomerManager = new Reserveteetime(); Boolean Confirmation; Confirmation = CustomerManager.deleteteetime(Reserve); return(Confirmation); }
public Reserveteetimes GetTeetimeUser(Reserveteetimes Reserve) { Reserveteetime User; User = new Reserveteetime(); Reserveteetimes Teetimeinfo; Teetimeinfo = new Reserveteetimes(); Teetimeinfo = User.Getteetime(Reserve); return(Teetimeinfo); }
protected void Button2_Click(object sender, EventArgs e) { string role = (string)Session["role"]; string memberno = (string)Session["memberno"]; if (DropDownListGold.Visible == true) { ClubBaistSampleHandler RequestDirector; RequestDirector = new ClubBaistSampleHandler(); Reserveteetimes Reserve = new Reserveteetimes(); Reserve.MemberNo = memberno; Reserve.NoofCarts = Convert.ToInt32(NumberOfCarts.Text); Reserve.Player1 = Player1.Text; Reserve.Player2 = Player2.Text; Reserve.Player3 = Player3.Text; Reserve.date = ACalendar.SelectedDate.ToString("yyyy/MM/dd"); Reserve.time1 = DropDownListGold.SelectedItem.ToString(); Reserve.Phone = TextBox3.Text; Boolean Confirmation; Confirmation = RequestDirector.AddMember(Reserve); if (Confirmation) { Msg.Text = "Tee Time Reserved"; } else { Msg.Text = "Tee Time Not Reserved"; } } else if (DropDownListGold.Visible == false) { string memberno1 = (string)Session["memberno"]; ClubBaistSampleHandler RequestDirector; RequestDirector = new ClubBaistSampleHandler(); Reserveteetimes TeeTimeInfo; TeeTimeInfo = new Reserveteetimes(); TeeTimeInfo.MemberNo = memberno1; TeeTimeInfo.NoofCarts = Convert.ToInt32(NumberOfCarts.Text); TeeTimeInfo.Player1 = Player1.Text; TeeTimeInfo.Player2 = Player2.Text; TeeTimeInfo.Player3 = Player3.Text; TeeTimeInfo.MemberNo = TextBox4.Text; TeeTimeInfo.date = ACalendar.SelectedDate.ToString("yyyy/MM/dd"); TeeTimeInfo.time1 = DropDownListBooked.SelectedItem.ToString(); Boolean Confirmation; Confirmation = RequestDirector.ModifyTeeTime(TeeTimeInfo); if (Confirmation) { Response.Write("Your Tee Time Updated"); } } }
// For deleting tee time public Boolean deleteteetime(Reserveteetimes Reserve) { Boolean Success = false; SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "DeleteTeeTime"; SqlParameter MemberNo; MemberNo = new SqlParameter(); MemberNo.ParameterName = "@MemberNumber"; MemberNo.SqlDbType = SqlDbType.VarChar; MemberNo.Value = Reserve.MemberNo; MemberNo.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(MemberNo); SqlParameter date; date = new SqlParameter(); date.ParameterName = "@Date"; date.SqlDbType = SqlDbType.VarChar; date.Value = Reserve.date; date.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(date); SqlParameter time; time = new SqlParameter(); time.ParameterName = "@Time"; time.SqlDbType = SqlDbType.VarChar; time.Value = Reserve.time1; time.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(time); StudentConnection.Open(); StudentCommand.ExecuteNonQuery(); StudentConnection.Close(); Success = true; return(Success); }
protected void ConfirmDelete_Click(object sender, EventArgs e) { string memberno1 = (string)Session["memberno"]; ClubBaistSampleHandler RequestDirector; RequestDirector = new ClubBaistSampleHandler(); Reserveteetimes TeeTimeInfo; TeeTimeInfo = new Reserveteetimes(); TeeTimeInfo.MemberNo = memberno1; TeeTimeInfo.date = Date1.Text; TeeTimeInfo.time1 = Time.Text; Boolean Confirmation; Confirmation = RequestDirector.deleteteetime(TeeTimeInfo); if (Confirmation) { Response.Write("Your Tee Time Cacelled"); } }
// Getting tee time for update and cancel public List <string> teetimesUpdate(string date) { //List<Reserveteetimes> Availableteetime = new List<Reserveteetimes>(); Reserveteetimes bookedtimes = new Reserveteetimes(); SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "GetTeeTime"; SqlParameter programcode; programcode = new SqlParameter(); programcode.ParameterName = "@Date"; programcode.SqlDbType = SqlDbType.VarChar; programcode.Value = Convert.ToDateTime(date); programcode.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(programcode); StudentConnection.Open(); SqlDataReader BAIS3150Reader; BAIS3150Reader = StudentCommand.ExecuteReader(); string Tee; while (BAIS3150Reader.Read()) { //Reserveteetimes Availableteetime; //Availableteetime = new Reserveteetimes(); Tee = (string)BAIS3150Reader["Time"]; bookedtimes.Availableteetime.Add(Tee); } StudentConnection.Close(); return(bookedtimes.Availableteetime); }
protected void BookedTime_Click(object sender, EventArgs e) { DropDownListGold.Visible = false; string memberno = (string)Session["memberno"]; string membername = (string)Session["membername"]; ClubBaistSampleHandler RequestDirector; RequestDirector = new ClubBaistSampleHandler(); Reserveteetimes TeeTimeInfo; TeeTimeInfo = new Reserveteetimes(); TeeTimeInfo.MemberNo = memberno; TeeTimeInfo.date = DateTime.Today.ToString("yyyy/MM/dd"); TeeTimeInfo.time1 = DropDownListBooked.SelectedItem.ToString(); TeeTimeInfo = RequestDirector.GetTeetimeUser(TeeTimeInfo); Player1.Text = TeeTimeInfo.Player1; Player2.Text = TeeTimeInfo.Player2; Player3.Text = TeeTimeInfo.Player3; NumberOfCarts.Text = Convert.ToString(TeeTimeInfo.NoofCarts); }
protected void Delete_Click1(object sender, EventArgs e) { string membername = (string)Session["memebername"]; string memberno1 = (string)Session["memberno"]; ClubBaistSampleHandler RequestDirector; RequestDirector = new ClubBaistSampleHandler(); Reserveteetimes TeeTimeInfo; TeeTimeInfo = new Reserveteetimes(); TeeTimeInfo.MemberNo = memberno1; TeeTimeInfo.date = ACalendar.SelectedDate.ToString("yyyy/MM/dd"); TeeTimeInfo.time1 = DropDownList3.SelectedItem.ToString(); TeeTimeInfo = RequestDirector.GetTeetimeUser(TeeTimeInfo); MemberNo.Text = memberno1; MemberName.Text = membername; Player1.Text = TeeTimeInfo.Player1; Player2.Text = TeeTimeInfo.Player2; Player3.Text = TeeTimeInfo.Player3; NoOfCarts.Text = Convert.ToString(TeeTimeInfo.NoofCarts); Date1.Text = Convert.ToString(TeeTimeInfo.date); Time.Text = TeeTimeInfo.time1; }
protected void Delete_Click1(object sender, EventArgs e) { string membername = (string)Session["membername"]; string memberno1 = (string)Session["memberno"]; ClubBaistSampleHandler RequestDirector; RequestDirector = new ClubBaistSampleHandler(); Reserveteetimes TeeTimeInfo; TeeTimeInfo = new Reserveteetimes(); TeeTimeInfo.MemberNo = memberno1; TeeTimeInfo.date = ACalendar.SelectedDate.ToString("yyyy/MM/dd"); TeeTimeInfo.time1 = DropDownList3.SelectedItem.ToString(); TeeTimeInfo = RequestDirector.GetTeetimeUser(TeeTimeInfo); MemberNo.Text = memberno1; MemberName.Text = membername; Player1.Text = TeeTimeInfo.Player1; Player2.Text = TeeTimeInfo.Player2; Player3.Text = TeeTimeInfo.Player3; NoOfCarts.Text = Convert.ToString(TeeTimeInfo.NoofCarts); Date1.Text = Convert.ToString(TeeTimeInfo.date); Time.Text = TeeTimeInfo.time1; }
// For deleting tee time public Boolean deleteteetime(Reserveteetimes Reserve ) { Boolean Success = false; SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "DeleteTeeTime"; SqlParameter MemberNo; MemberNo = new SqlParameter(); MemberNo.ParameterName = "@MemberNumber"; MemberNo.SqlDbType = SqlDbType.VarChar; MemberNo.Value = Reserve.MemberNo; MemberNo.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(MemberNo); SqlParameter date; date = new SqlParameter(); date.ParameterName = "@Date"; date.SqlDbType = SqlDbType.VarChar; date.Value = Reserve.date; date.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(date); SqlParameter time; time = new SqlParameter(); time.ParameterName = "@Time"; time.SqlDbType = SqlDbType.VarChar; time.Value = Reserve.time1; time.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(time); StudentConnection.Open(); StudentCommand.ExecuteNonQuery(); StudentConnection.Close(); Success = true; return Success; }
// Updating players no of players and no of carts Scenario Modifying tee time public Boolean UpdateCustomer(Reserveteetimes TeeTimeUpdate) { Boolean Success = false; SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "UpdateTeeTime"; SqlParameter MemberNo; MemberNo = new SqlParameter(); MemberNo.ParameterName = "@MemberNumber"; MemberNo.SqlDbType = SqlDbType.VarChar; MemberNo.Value = TeeTimeUpdate.MemberNo; MemberNo.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(MemberNo); SqlParameter NoofCarts; NoofCarts = new SqlParameter(); NoofCarts.ParameterName = "@NoofCarts"; NoofCarts.SqlDbType = SqlDbType.VarChar; NoofCarts.Value = TeeTimeUpdate.NoofCarts; NoofCarts.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(NoofCarts); SqlParameter Player1; Player1 = new SqlParameter(); Player1.ParameterName = "@Player1"; Player1.SqlDbType = SqlDbType.VarChar; Player1.Value = TeeTimeUpdate.Player1; Player1.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(Player1); SqlParameter Player2; Player2 = new SqlParameter(); Player2.ParameterName = "@Player2"; Player2.SqlDbType = SqlDbType.VarChar; Player2.Value = TeeTimeUpdate.Player2; Player2.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(Player2); SqlParameter Player3; Player3 = new SqlParameter(); Player3.ParameterName = "@Player3"; Player3.SqlDbType = SqlDbType.VarChar; Player3.Value = TeeTimeUpdate.Player3; Player3.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(Player3); SqlParameter date; date = new SqlParameter(); date.ParameterName = "@Date"; date.SqlDbType = SqlDbType.VarChar; date.Value = TeeTimeUpdate.date; date.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(date); SqlParameter time; time = new SqlParameter(); time.ParameterName = "@Time"; time.SqlDbType = SqlDbType.VarChar; time.Value = TeeTimeUpdate.time1; time.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(time); StudentConnection.Open(); StudentCommand.ExecuteNonQuery(); StudentConnection.Close(); Success = true; return Success; }
// Getting tee time for update and cancel public List<string> teetimesUpdate(string date) { //List<Reserveteetimes> Availableteetime = new List<Reserveteetimes>(); Reserveteetimes bookedtimes = new Reserveteetimes(); SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "GetTeeTime"; SqlParameter programcode; programcode = new SqlParameter(); programcode.ParameterName = "@Date"; programcode.SqlDbType = SqlDbType.VarChar; programcode.Value = Convert.ToDateTime(date); programcode.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(programcode); StudentConnection.Open(); SqlDataReader BAIS3150Reader; BAIS3150Reader = StudentCommand.ExecuteReader(); string Tee; while (BAIS3150Reader.Read()) { //Reserveteetimes Availableteetime; //Availableteetime = new Reserveteetimes(); Tee = (string)BAIS3150Reader["Time"]; bookedtimes.Availableteetime.Add(Tee); } StudentConnection.Close(); return bookedtimes.Availableteetime; }
// Getting all information of the time reserved by the golf member public Reserveteetimes Getteetime(Reserveteetimes Reserve) { Reserveteetimes Teetimeinfo; Teetimeinfo = new Reserveteetimes(); SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "GetTeeTimeInfo"; SqlParameter studentid; studentid = new SqlParameter(); studentid.ParameterName = "@MemberNumber"; studentid.SqlDbType = SqlDbType.VarChar; studentid.Value = Reserve.MemberNo; studentid.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(studentid); SqlParameter date; date = new SqlParameter(); date.ParameterName = "@Date"; date.SqlDbType = SqlDbType.VarChar; date.Value = Reserve.date; date.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(date); SqlParameter time; time = new SqlParameter(); time.ParameterName = "@Time"; time.SqlDbType = SqlDbType.VarChar; time.Value = Reserve.time1; time.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(time); StudentConnection.Open(); SqlDataReader BAIS3150Reader; BAIS3150Reader = StudentCommand.ExecuteReader(); while (BAIS3150Reader.Read()) { Teetimeinfo.MemberNo = (string)BAIS3150Reader["MemberNumber"]; Teetimeinfo.NoofCarts = (int)BAIS3150Reader["NoofCarts"]; Teetimeinfo.Player1 = (string)BAIS3150Reader["Player1"]; Teetimeinfo.Player2 = (string)BAIS3150Reader["Player2"]; Teetimeinfo.Player3 = (string)BAIS3150Reader["Player3"]; Teetimeinfo.time1 = (string)BAIS3150Reader["Time"]; Teetimeinfo.date = Convert.ToDateTime(BAIS3150Reader["Date"]).ToString("yyyy/MM/dd"); } StudentConnection.Close(); return Teetimeinfo; }
// Getting all information of the time reserved by the golf member public Reserveteetimes Getteetime(Reserveteetimes Reserve) { Reserveteetimes Teetimeinfo; Teetimeinfo = new Reserveteetimes(); SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "GetTeeTimeInfo"; SqlParameter studentid; studentid = new SqlParameter(); studentid.ParameterName = "@MemberNumber"; studentid.SqlDbType = SqlDbType.VarChar; studentid.Value = Reserve.MemberNo; studentid.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(studentid); SqlParameter date; date = new SqlParameter(); date.ParameterName = "@Date"; date.SqlDbType = SqlDbType.VarChar; date.Value = Reserve.date; date.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(date); SqlParameter time; time = new SqlParameter(); time.ParameterName = "@Time"; time.SqlDbType = SqlDbType.VarChar; time.Value = Reserve.time1; time.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(time); StudentConnection.Open(); SqlDataReader BAIS3150Reader; BAIS3150Reader = StudentCommand.ExecuteReader(); while (BAIS3150Reader.Read()) { Teetimeinfo.MemberNo = (string)BAIS3150Reader["MemberNumber"]; Teetimeinfo.NoofCarts = (int)BAIS3150Reader["NoofCarts"]; Teetimeinfo.Player1 = (string)BAIS3150Reader["Player1"]; Teetimeinfo.Player2 = (string)BAIS3150Reader["Player2"]; Teetimeinfo.Player3 = (string)BAIS3150Reader["Player3"]; Teetimeinfo.time1 = (string)BAIS3150Reader["Time"]; Teetimeinfo.date = Convert.ToDateTime(BAIS3150Reader["Date"]).ToString("yyyy/MM/dd"); } StudentConnection.Close(); return(Teetimeinfo); }
// Updating players no of players and no of carts Scenario Modifying tee time public Boolean UpdateCustomer(Reserveteetimes TeeTimeUpdate) { Boolean Success = false; SqlConnection StudentConnection; StudentConnection = new SqlConnection(); StudentConnection.ConnectionString = "Data Source= (localDB)\\v11.0;Initial Catalog=GolfClubBAIST;Integrated Security = True"; SqlCommand StudentCommand; StudentCommand = new SqlCommand(); StudentCommand.CommandType = CommandType.StoredProcedure; StudentCommand.Connection = StudentConnection; StudentCommand.CommandText = "UpdateTeeTime"; SqlParameter MemberNo; MemberNo = new SqlParameter(); MemberNo.ParameterName = "@MemberNumber"; MemberNo.SqlDbType = SqlDbType.VarChar; MemberNo.Value = TeeTimeUpdate.MemberNo; MemberNo.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(MemberNo); SqlParameter NoofCarts; NoofCarts = new SqlParameter(); NoofCarts.ParameterName = "@NoofCarts"; NoofCarts.SqlDbType = SqlDbType.VarChar; NoofCarts.Value = TeeTimeUpdate.NoofCarts; NoofCarts.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(NoofCarts); SqlParameter Player1; Player1 = new SqlParameter(); Player1.ParameterName = "@Player1"; Player1.SqlDbType = SqlDbType.VarChar; Player1.Value = TeeTimeUpdate.Player1; Player1.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(Player1); SqlParameter Player2; Player2 = new SqlParameter(); Player2.ParameterName = "@Player2"; Player2.SqlDbType = SqlDbType.VarChar; Player2.Value = TeeTimeUpdate.Player2; Player2.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(Player2); SqlParameter Player3; Player3 = new SqlParameter(); Player3.ParameterName = "@Player3"; Player3.SqlDbType = SqlDbType.VarChar; Player3.Value = TeeTimeUpdate.Player3; Player3.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(Player3); SqlParameter date; date = new SqlParameter(); date.ParameterName = "@Date"; date.SqlDbType = SqlDbType.VarChar; date.Value = TeeTimeUpdate.date; date.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(date); SqlParameter time; time = new SqlParameter(); time.ParameterName = "@Time"; time.SqlDbType = SqlDbType.VarChar; time.Value = TeeTimeUpdate.time1; time.Direction = ParameterDirection.Input; StudentCommand.Parameters.Add(time); StudentConnection.Open(); StudentCommand.ExecuteNonQuery(); StudentConnection.Close(); Success = true; return(Success); }