private void btn_Delete_Booking_Click(object sender, EventArgs e) { BLBooking blRT = new BLBooking(); blRT.DeleteBooking(txt_Booking_BookingID.Text); dgv_Booking.DataSource = blRT.LoadBooking(); dgv_Booking_CellClick(null, null); }
public void LoadOutdateBooking() { BS_Layer.BLBooking bl = new BLBooking(); var temp = bl.OutdateBooking(); foreach (var c in temp) { RichTextBox_DefaultScreen.AppendText("Phong " + c.RoomID + " do Customer " + c.CustomerID + " dat co Appointment Date " + c.AppointmentDate + " da qua han nen se duoc xoa. Xin chu y! \n"); } }
/// <summary> /// Load lại bảng theo khu vực /// </summary> private void LoadTableByAreaID() { UltraTab activeTab = tabAreaTableMapping.ActiveTab; if (activeTab == null || string.IsNullOrEmpty(activeTab.Key)) { return; } Guid areaID = Guid.Parse(activeTab.Key); BusinessDataSet dsTable = new BusinessDataSet(); dsTable.AreaTableMapping.Merge(_oblArea.GetTableMappingByAreaID(areaID, dteDateAreaTableMapping.DateTime)); FlowLayoutPanel flowLayout = new FlowLayoutPanel(); flowLayout.Padding = new Padding(10); flowLayout.Dock = DockStyle.Fill; flowLayout.AutoScroll = true; if (dsTable.AreaTableMapping.Rows.Count > 0) { // Bỏ số lượng của Khu vực đi để cộng lại Area_All_Status_Empty[Key_All] -= Area_All_Status_Empty[areaID.ToString()]; Area_All_Status_Empty[areaID.ToString()] = 0; foreach (BusinessDataSet.AreaTableMappingRow iAreaTable in dsTable.AreaTableMapping.Rows) { EnumTableStatus tableStatus = (EnumTableStatus)iAreaTable.TableStatus; if (tableStatus == EnumTableStatus.Empty) { Area_All_Status_Empty[areaID.ToString()] += 1; Area_All_Status_Empty[Key_All] += 1; } else if (tableStatus == EnumTableStatus.Booking) { TimeSpan timeSpan; timeSpan = iAreaTable.BookingDate - DateTime.Now; if (timeSpan.Minutes >= 15) { BLBooking bLBooking = new BLBooking(); DictionaryDataSet.BookingRow row = dsDictionary.Booking.FindByBookingID(iAreaTable.BookingID); row.BookingStatus = 2; bLBooking.InsertUpdate(row); } } UctTableMapping tableMapping = CreateUctTableMapping(iAreaTable); tableMapping.Click += Table_Click; tableMapping.DoubleClick += Table_DoubleClick; tableMapping.LoadAreaStatus += ChangeAreaStatus; flowLayout.Controls.Add(tableMapping); } } activeTab.TabPage.Controls.Clear(); activeTab.TabPage.Controls.Add(flowLayout); }
private void LoadInfo() { BLBooking bLBooking = new BLBooking(); DsDictionary.Booking.Clear(); DsDictionary.Booking.Merge(bLBooking.GetDataByID(BookingID)); if (dsDictionary.Booking.Rows.Count > 0) { foreach (DictionaryDataSet.BookingRow row in dsDictionary.Booking.Rows) { txtOrderNo.Text = row.BookingNo; cboTableMapping.Value = row.TableID; cboCustomerID.Value = row.CustomerID; txtNumberOfPeople.Value = row.NumberOfPeople; dteOrderDate.Value = DateTime.Now; } } }
public object GetBookings() { ServiceResult result = new ServiceResult(); List <Booking> items; try { items = new BLBooking().GetBookings(); result.Success = true; result.Data = items; } catch (Exception ex) { CommonFunction.WriteLog(ex, SerializeUtil.Serialize(""), Request.RequestUri.ToString()); result.Success = false; result.ErrorCode = ex.Message; } return(result); }
private void btn_Save_Booking_Click(object sender, EventArgs e) { BLBooking blSP = new BLBooking(); if (SaveStatus == 1) { blSP.CreateBooking(txt_Booking_CustomerID.Text, txt_Booking_RoomID.Text, txt_Booking_AppointmentDate.Text); } else if (SaveStatus == 2) { blSP.UpdateBooking(txt_Booking_BookingID.Text, txt_Booking_CustomerID.Text, txt_Booking_RoomID.Text, txt_Booking_AppointmentDate.Text); } SaveStatus = 0; dgv_Booking.DataSource = blSP.LoadBooking(); dgv_Booking_CellClick(null, null); btn_Update_Booking.Enabled = true; btn_Save_Booking.Enabled = false; }
private void btn_Booking_Click(object sender, EventArgs e) { TabControl_Main.TabPages.Clear(); TabControl_Main.TabPages.Add(TabPage_Booking); dgv_Booking.AutoResizeColumns(); BLBooking dbB = new BLBooking(); var data = dbB.LoadBooking(); if (data != null) { dgv_Booking.DataSource = data; } else { dgv_Booking.DataSource = null; } dgv_Booking_CellClick(null, null); txt_Booking_BookingID.Enabled = false; }