//hiennv public void GetListSelectRooms(int IDBookingR) { try { ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO(); RoomMemberEN aRoomMemberEN; List<RoomsEN> aListTempRooms = aReceptionTaskBO.GetListRooms_ByIDBookingR(IDBookingR); foreach (RoomsEN aRooms in aListTempRooms) { aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.IDBookingRooms = aRooms.IDBookingRooms; aRoomMemberEN.RoomSku = aRooms.Sku; aRoomMemberEN.RoomCode = aRooms.Code; aRoomMemberEN.RoomType = Convert.ToInt32(aRooms.Type); aRoomMemberEN.RoomBed1 = Convert.ToInt32(aRooms.Bed1); aRoomMemberEN.RoomBed2 = Convert.ToInt32(aRooms.Bed2); aRoomMemberEN.RoomCostRef = Convert.ToDecimal(aRooms.CostRef); aRoomMemberEN.RoomTypeDisplay = CORE.CONSTANTS.SelectedRoomsType(Convert.ToInt32(aRooms.Type)).Name; this.aCheckInRoomBookingEN.aListRoomMembers.Add(aRoomMemberEN); } dgvSelectedRooms.DataSource = this.aCheckInRoomBookingEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); } catch (Exception ex) { MessageBox.Show("frmTsk_CheckInGoverment_ForRoomBooking_Step1.GetListSelectRooms\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAddSelectedRooms_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomSku = viewAvailableRooms.GetFocusedRowCellValue("Sku").ToString(); aRoomMemberEN.RoomCode = viewAvailableRooms.GetFocusedRowCellValue("Code").ToString(); aRoomMemberEN.RoomTypeDisplay = viewAvailableRooms.GetFocusedRowCellValue("TypeDisplay").ToString(); aRoomMemberEN.RoomBed1 = Convert.ToInt32(viewAvailableRooms.GetFocusedRowCellValue("Bed1").ToString()); aRoomMemberEN.RoomBed2 = Convert.ToInt32(viewAvailableRooms.GetFocusedRowCellValue("Bed2").ToString()); aRoomMemberEN.RoomCostRef = Convert.ToDecimal(viewAvailableRooms.GetFocusedRowCellValue("CostRef").ToString()); aCheckInEN.aListRoomMembers.Insert(aCheckInEN.aListRoomMembers.Count, aRoomMemberEN); dgvSelectedRooms.DataSource = aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); RoomsEN Temps = aListAvaiableRooms.Where(p => p.Sku == viewAvailableRooms.GetFocusedRowCellValue("Sku").ToString()).ToList()[0]; aListAvaiableRooms.Remove(Temps); dgvAvailableRooms.DataSource = aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn_Group_Step1.btnAddSelectedRooms_ButtonClick\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmTsk_CheckIn_Group_Step1_Load(object sender, EventArgs e) { try { ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO(); if (String.IsNullOrEmpty(this.codeRoom) == false) { dtpFrom.DateTime = DateTime.Now; dtpTo.DateTime = aReceptionTaskBO.SetDateValueDefault(DateTime.Now.AddDays(1)); this.LoadListAvailableRooms(dtpFrom.DateTime, dtpTo.DateTime); List<RoomsEN> aListRoomEN = this.aListAvaiableRooms.Where(p => p.Code == this.codeRoom).ToList(); if (aListRoomEN.Count > 0) { this.aListAvaiableRooms.Remove(aListRoomEN[0]); dgvAvailableRooms.DataSource = this.aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomSku = aListRoomEN[0].Sku; aRoomMemberEN.RoomCode = aListRoomEN[0].Code; aRoomMemberEN.RoomTypeDisplay = aListRoomEN[0].TypeDisplay; aRoomMemberEN.RoomBed1 = aListRoomEN[0].Bed1.GetValueOrDefault(); aRoomMemberEN.RoomBed2 = aListRoomEN[0].Bed2.GetValueOrDefault(); aRoomMemberEN.RoomCostRef = aListRoomEN[0].CostRef.GetValueOrDefault(); this.aCheckInEN.aListRoomMembers.Insert(this.aCheckInEN.aListRoomMembers.Count, aRoomMemberEN); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); } } else { dtpFrom.DateTime = DateTime.Now; dtpTo.DateTime = aReceptionTaskBO.SetDateValueDefault(DateTime.Now.AddDays(1)); this.LoadListAvailableRooms(dtpFrom.DateTime, dtpTo.DateTime); } } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn_Group_Step1.frmTsk_CheckIn_Group_Step1_Load\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnSearch_Click(object sender, EventArgs e) { try { DateTime From = dtpFrom.DateTime; DateTime To = dtpTo.DateTime; this.aListAvaiableRooms.Clear(); this.LoadListAvailableRooms(From, To); List<RoomsEN> aListRoomEN = this.aListAvaiableRooms.Where(p => p.Code == this.codeRoom).ToList(); if (aListRoomEN.Count > 0) { this.aListAvaiableRooms.Remove(aListRoomEN[0]); dgvAvailableRooms.DataSource = this.aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomSku = aListRoomEN[0].Sku; aRoomMemberEN.RoomCode = aListRoomEN[0].Code; aRoomMemberEN.RoomTypeDisplay = aListRoomEN[0].TypeDisplay; aRoomMemberEN.RoomBed1 = aListRoomEN[0].Bed1.GetValueOrDefault(); aRoomMemberEN.RoomBed2 = aListRoomEN[0].Bed2.GetValueOrDefault(); aRoomMemberEN.RoomCostRef = aListRoomEN[0].CostRef.GetValueOrDefault(); this.aCheckInEN.aListRoomMembers.Insert(this.aCheckInEN.aListRoomMembers.Count, aRoomMemberEN); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); } } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn_Group_Step1.btnSearch_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Hiennv Tạo mới 18/11/2014 Load ra toàn bộ danh sách phòng còn trống trong khoảng thời gian tìm kiếm public List<RoomMemberEN> LoadListAvailableRooms(DateTime fromDate, DateTime toDate) { try { ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO(); if (this.CheckData() == true) { aCheckInEN.aListRoomMembers.Clear(); List<Rooms> aListRooms = aReceptionTaskBO.GetListAvailableRooms(fromDate, toDate, 1).OrderBy(r => r.Sku).ToList(); // 1=IDLang RoomMemberEN aRoomMemberEN; for (int i = 0; i < aListRooms.Count; i++) { aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.IDBookingRooms = aListRooms[i].ID; aRoomMemberEN.RoomCode = aListRooms[i].Code; aRoomMemberEN.RoomSku = aListRooms[i].Sku; aRoomMemberEN.RoomBed1 = aListRooms[i].Bed1.GetValueOrDefault(); aRoomMemberEN.RoomBed2 = aListRooms[i].Bed2.GetValueOrDefault(); aRoomMemberEN.RoomCostRef = aListRooms[i].CostRef.GetValueOrDefault(); aRoomMemberEN.RoomTypeDisplay = CORE.CONSTANTS.SelectedRoomsType(Convert.ToInt32(aListRooms[i].Type)).Name; this.aListAvaiableRooms.Add(aRoomMemberEN); } } return this.aListAvaiableRooms; } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn.LoadListAvailableRooms\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } }
//Hiennv Tạo mới 18/11/2014 private void btnUnSelect_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomCode = viewSelectedRooms.GetFocusedRowCellValue("RoomCode").ToString(); aRoomMemberEN.RoomSku = viewSelectedRooms.GetFocusedRowCellValue("RoomSku").ToString(); aRoomMemberEN.RoomTypeDisplay = viewSelectedRooms.GetFocusedRowCellValue("RoomTypeDisplay").ToString(); aRoomMemberEN.RoomBed1 = Convert.ToInt32(viewSelectedRooms.GetFocusedRowCellValue("RoomBed1")); aRoomMemberEN.RoomBed2 = Convert.ToInt32(viewSelectedRooms.GetFocusedRowCellValue("RoomBed2")); aRoomMemberEN.RoomCostRef = Convert.ToDecimal(viewSelectedRooms.GetFocusedRowCellValue("RoomCostRef")); this.aListAvaiableRooms.Insert(0, aRoomMemberEN); dgvAvailableRooms.DataSource = aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); RoomMemberEN Temps = aCheckInEN.IsCodeRoomExistInRoom(viewSelectedRooms.GetFocusedRowCellValue("RoomCode").ToString()); if (Temps != null) { this.aCheckInEN.RemoveRoom(Temps); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); } if (!String.IsNullOrEmpty(this.aCurrent_CodeRoom)) { if (this.aCheckInEN.GetListRoomMemberByCodeRoom(this.aCurrent_CodeRoom).Count <= 0) { this.aCurrent_CodeRoom = string.Empty; lblRoomSku.Text = "Phòng số : 000"; dgvSelectedCustomer.DataSource = null; dgvSelectedCustomer.RefreshDataSource(); } } } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn.btnUnSelect_ButtonClick\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Hiennv Tạo mới 18/11/2014 private void btnSelect_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomSku = viewAvailableRooms.GetFocusedRowCellValue("RoomSku").ToString(); aRoomMemberEN.RoomCode = viewAvailableRooms.GetFocusedRowCellValue("RoomCode").ToString(); aRoomMemberEN.RoomTypeDisplay = viewAvailableRooms.GetFocusedRowCellValue("RoomTypeDisplay").ToString(); aRoomMemberEN.RoomBed1 = Convert.ToInt32(viewAvailableRooms.GetFocusedRowCellValue("RoomBed1").ToString()); aRoomMemberEN.RoomBed2 = Convert.ToInt32(viewAvailableRooms.GetFocusedRowCellValue("RoomBed2").ToString()); aRoomMemberEN.RoomCostRef = Convert.ToDecimal(viewAvailableRooms.GetFocusedRowCellValue("RoomCostRef").ToString()); this.aCheckInEN.InsertRoom(aRoomMemberEN); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); RoomMemberEN Temps = aListAvaiableRooms.Where(p => p.RoomSku == viewAvailableRooms.GetFocusedRowCellValue("RoomSku").ToString()).ToList()[0]; this.aListAvaiableRooms.Remove(Temps); dgvAvailableRooms.DataSource = this.aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); RoomsBO aRoomsBO = new RoomsBO(); this.aCurrent_CodeRoom = aRoomMemberEN.RoomCode; lblRoomSku.Text = "Phòng số :" + aRoomsBO.Select_ByCodeRoom(this.aCurrent_CodeRoom, 1).Sku; dgvSelectedCustomer.DataSource = null; dgvSelectedCustomer.DataSource = this.aCheckInEN.GetListCustomerByRoomCode(this.aCurrent_CodeRoom); dgvSelectedCustomer.RefreshDataSource(); } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn.btnSelect_ButtonClick\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Hiennv Tạo mới 18/11/2014 Tim ra toàn bộ danh sách phòng còn trống trong khoảng thời gian tìm kiếm private void btnSearch_Click(object sender, EventArgs e) { try { if (this.CheckData() == true) { DateTime From = dtpFrom.DateTime; DateTime To = dtpTo.DateTime; this.aListAvaiableRooms.Clear(); dgvAvailableRooms.DataSource = this.LoadListAvailableRooms(From, To); dgvAvailableRooms.RefreshDataSource(); this.aCheckInEN.aListRoomMembers.Clear(); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); this.aCurrent_CodeRoom = string.Empty; lblRoomSku.Text = "Phòng số :000"; this.aCheckInEN.ClearAllListCustomer(); dgvSelectedCustomer.DataSource = this.aCheckInEN.GetListCustomerByRoomCode(this.aCurrent_CodeRoom); dgvSelectedCustomer.RefreshDataSource(); this.ResetValueAddNew(); List<RoomMemberEN> aListRoomMemberEN = this.aListAvaiableRooms.Where(p => p.RoomCode == this.aCurrent_CodeRoom).ToList(); if (aListRoomMemberEN.Count > 0) { this.aListAvaiableRooms.Remove(aListRoomMemberEN[0]); dgvAvailableRooms.DataSource = this.aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomSku = aListRoomMemberEN[0].RoomSku; aRoomMemberEN.RoomCode = aListRoomMemberEN[0].RoomCode; aRoomMemberEN.RoomTypeDisplay = aListRoomMemberEN[0].RoomTypeDisplay; aRoomMemberEN.RoomBed1 = aListRoomMemberEN[0].RoomBed1; aRoomMemberEN.RoomBed2 = aListRoomMemberEN[0].RoomBed2; aRoomMemberEN.RoomCostRef = aListRoomMemberEN[0].RoomCostRef; this.aCheckInEN.InsertRoom(aRoomMemberEN); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); } } } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn.btnSearch_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Hiennv 25/11/2014 load ra danh sach cac phong da duoc chon public List<RoomMemberEN> LoadListSelectRooms(DateTime fromDate, DateTime toDate) { try { if (!String.IsNullOrEmpty(this.aCurrent_CodeRoom)) { List<RoomMemberEN> aListRoomMemberEN = this.aListAvaiableRooms.Where(p => p.RoomCode == this.aCurrent_CodeRoom).ToList(); if (aListRoomMemberEN.Count > 0) { this.aListAvaiableRooms.Remove(aListRoomMemberEN[0]); dgvAvailableRooms.DataSource = this.aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomSku = aListRoomMemberEN[0].RoomSku; aRoomMemberEN.RoomCode = aListRoomMemberEN[0].RoomCode; aRoomMemberEN.RoomTypeDisplay = aListRoomMemberEN[0].RoomTypeDisplay; aRoomMemberEN.RoomBed1 = aListRoomMemberEN[0].RoomBed1; aRoomMemberEN.RoomBed2 = aListRoomMemberEN[0].RoomBed2; aRoomMemberEN.RoomCostRef = aListRoomMemberEN[0].RoomCostRef; this.aCheckInEN.InsertRoom(aRoomMemberEN); } return this.aCheckInEN.aListRoomMembers; } return null; } catch (Exception ex) { MessageBox.Show("frmTsk_CheckIn.LoadListSelectRooms()\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } }
private void btnFill_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.RoomSku = grvAvaiableRooms.GetFocusedRowCellValue("Sku").ToString(); aRoomMemberEN.RoomCode = grvAvaiableRooms.GetFocusedRowCellValue("Code").ToString(); aRoomMemberEN.RoomTypeDisplay = grvAvaiableRooms.GetFocusedRowCellValue("TypeDisplay").ToString(); aRoomMemberEN.RoomBed1 = Convert.ToInt16(grvAvaiableRooms.GetFocusedRowCellValue("Bed1")); aRoomMemberEN.RoomBed2 = Convert.ToInt16(grvAvaiableRooms.GetFocusedRowCellValue("Bed2")); aRoomMemberEN.RoomCostRef = Convert.ToDecimal(grvAvaiableRooms.GetFocusedRowCellValue("CostRef")); this.aCheckInEN.aListRoomMembers.Insert(this.aCheckInEN.aListRoomMembers.Count, aRoomMemberEN); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); RoomsEN Temps = this.aListAvaiableRooms.Where(p => p.Sku == grvAvaiableRooms.GetFocusedRowCellValue("Sku").ToString()).ToList()[0]; this.aListAvaiableRooms.Remove(Temps); dgvAvailableRooms.DataSource = this.aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); } catch (Exception ex) { MessageBox.Show("Check In Step 1 - Khách lẻ - Chọn " + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Hiennv 26/11/2014 ham dung de load toan bo du lieu theo IDBookingR public CheckInEN InitData(int IDBookingR) { try { CheckInEN aCheckInEN = new CheckInEN(); BookingRsBO aBookingRsBO = new BookingRsBO(); BookingRs aBookingRs = new BookingRs(); aBookingRs = aBookingRsBO.Select_ByID(IDBookingR); if(aBookingRs != null) { aCheckInEN.IDBookingR = aBookingRs.ID; aCheckInEN.CustomerType = aBookingRs.CustomerType.GetValueOrDefault(); aCheckInEN.BookingType = aBookingRs.BookingType.GetValueOrDefault(); aCheckInEN.Note = aBookingRs.Note; aCheckInEN.IDCustomerGroup = aBookingRs.IDCustomerGroup; aCheckInEN.IDCustomer = aBookingRs.IDCustomer; aCheckInEN.IDSystemUser = aBookingRs.IDSystemUser; aCheckInEN.PayMenthod = aBookingRs.PayMenthod.GetValueOrDefault(); aCheckInEN.StatusPay = aBookingRs.StatusPay.GetValueOrDefault(); aCheckInEN.BookingMoney = aBookingRs.BookingMoney.GetValueOrDefault(); aCheckInEN.ExchangeRate = aBookingRs.ExchangeRate.GetValueOrDefault(); aCheckInEN.Status = aBookingRs.Status.GetValueOrDefault(); aCheckInEN.Type = aBookingRs.Type.GetValueOrDefault(); aCheckInEN.Disable = aBookingRs.Disable.GetValueOrDefault(); aCheckInEN.Level = aBookingRs.Level; aCheckInEN.Subject = aBookingRs.Subject; aCheckInEN.Description = aBookingRs.Description; aCheckInEN.DatePay = aBookingRs.DatePay; aCheckInEN.DateEdit = aBookingRs.DateEdit; CustomerGroupsBO aCustomerGroupsBO = new CustomerGroupsBO(); CustomerGroups aCustomerGroups = new CustomerGroups(); aCustomerGroups = aCustomerGroupsBO.Select_ByID(aBookingRs.IDCustomerGroup); if(aCustomerGroups !=null) { aCheckInEN.IDCompany = aCustomerGroups.IDCompany; } } RoomsBO aRoomsBO = new RoomsBO(); List<Rooms> aListRooms = new List<Rooms>(); aListRooms = aRoomsBO.Select_All(); BookingRoomsBO aBookingRoomsBO = new BookingRoomsBO(); List<BookingRooms> aListBookingRooms = new List<BookingRooms>(); aListBookingRooms = aBookingRoomsBO.Select_ByIDBookingRs(IDBookingR); for (int i = 0; i < aListBookingRooms.Count; i++ ) { RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.IDBookingRooms = aListBookingRooms[i].ID; aRoomMemberEN.RoomCode = aListBookingRooms[i].CodeRoom; aRoomMemberEN.RoomSku = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Sku; aRoomMemberEN.RoomType = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Type.GetValueOrDefault(); aRoomMemberEN.RoomTypeDisplay = CORE.CONSTANTS.SelectedRoomsType(aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Type.GetValueOrDefault()).Name; aRoomMemberEN.RoomBed1 = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Bed1.GetValueOrDefault(); aRoomMemberEN.RoomBed2 = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Bed2.GetValueOrDefault(); aRoomMemberEN.RoomCostRef = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).CostRef.GetValueOrDefault(); aRoomMemberEN.RoomCost = aListBookingRooms[i].Cost.GetValueOrDefault(); aCheckInEN.InsertRoom(aRoomMemberEN); } return aCheckInEN; } catch (Exception ex) { MessageBox.Show("frmTsk_CheckInForRoomBooking.InitData()\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } }
//Hiennv Tạo mới 26/11/2014 private void btnSelect_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.IDBookingRooms = 0; aRoomMemberEN.RoomSku = viewAvailableRooms.GetFocusedRowCellValue("RoomSku").ToString(); aRoomMemberEN.RoomCode = viewAvailableRooms.GetFocusedRowCellValue("RoomCode").ToString(); aRoomMemberEN.RoomTypeDisplay = viewAvailableRooms.GetFocusedRowCellValue("RoomTypeDisplay").ToString(); aRoomMemberEN.RoomBed1 = Convert.ToInt32(viewAvailableRooms.GetFocusedRowCellValue("RoomBed1").ToString()); aRoomMemberEN.RoomBed2 = Convert.ToInt32(viewAvailableRooms.GetFocusedRowCellValue("RoomBed2").ToString()); aRoomMemberEN.RoomCostRef = Convert.ToDecimal(viewAvailableRooms.GetFocusedRowCellValue("RoomCostRef").ToString()); this.aCheckInEN.InsertRoom(aRoomMemberEN); dgvSelectedRooms.DataSource = this.aCheckInEN.aListRoomMembers; dgvSelectedRooms.RefreshDataSource(); List<RoomMemberEN> Temps = aListAvaiableRooms.Where(p => p.RoomSku == viewAvailableRooms.GetFocusedRowCellValue("RoomSku").ToString()).ToList(); if (Temps.Count > 0) { this.aListAvaiableRooms.Remove(Temps[0]); dgvAvailableRooms.DataSource = this.aListAvaiableRooms; dgvAvailableRooms.RefreshDataSource(); } } catch (Exception ex) { MessageBox.Show("frmTsk_CheckInForRoomBooking.btnSelect_ButtonClick\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Hiennv 18/11/2014 public void RemoveRoom(RoomMemberEN aRoomMemberEN) { this.aListRoomMembers.Remove(aRoomMemberEN); }
//Hiennv 18/11/2014 public void InsertRoom(RoomMemberEN aRoomMemberEN) { this.aListRoomMembers.Insert(0, aRoomMemberEN); }