protected void btnReserv_Click(object sender, EventArgs e) { //lbBookingMess.Text = "Đặt bàn"; int rs = 0; DatSpa data = new DatSpa(); data.Ten = custumerName.Text; data.DiaChi = Address.Text; data.Email = String.Empty; data.SDT = Convert.ToInt32(Phone.Text.Trim()); data.SoNguoi = Amount.Text; DateTime Ngay = DateTime.ParseExact(Date.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); data.Ngay = Ngay; data.Gio = Hour.Text; data.NgayGui = DateTime.Now; data.TrangThai = 0; rs = DatSpa.Them(data); if (rs > 0) { refesh(); lbBookingMess.Text = "Success, Thank you!"; } else { lbBookingMess.Text = "Cannot book"; } }
protected void LoadDatSpa(DatSpa data) { //Thong tin khach hang lbID.Text = data.ID.ToString(); lbdiachi.Text = data.DiaChi; lbhoten.Text = data.Ten; lbemail.Text = data.Email; lbgio.Text = data.Gio; lbnguoi.Text = data.SoNguoi; lbngaydat.Text = String.Format("{0:dd/MM/yyyy}", data.Ngay); lbsdt.Text = data.SDT.ToString(); lbngaygui.Text = String.Format("{0:dd/MM/yyyy}", data.NgayGui); lbtrangthai.Text = LoaiStatus(data.TrangThai); titletrangthai.Text = data.TrangThai.ToString(); }
public static int Them(DatSpa datspa) { try { object rs = DataProvider.Instance.ExecuteNonQueryWithOutput("@ID", "DatSpa_Them", datspa.ID, datspa.Ten, datspa.DiaChi, datspa.Email, datspa.SDT, datspa.SoNguoi, datspa.Ngay, datspa.Gio, datspa.TrangThai, datspa.NgayGui); return Convert.ToInt32(rs); } catch { return 0; } }
public static bool Sua(DatSpa datspa) { try { object rs = DataProvider.Instance.ExecuteNonQuery("DatSpa_Sua", datspa.ID, datspa.Ten, datspa.DiaChi, datspa.Email, datspa.SDT, datspa.SoNguoi, datspa.Ngay, datspa.Gio, datspa.TrangThai, datspa.NgayGui); return Convert.ToInt32(rs) > 0; } catch { return false; } }