当前位置: 首页>>代码示例>>C#>>正文


C# ReceptionTaskBO.GetTimeInUsed方法代码示例

本文整理汇总了C#中BussinessLogic.ReceptionTaskBO.GetTimeInUsed方法的典型用法代码示例。如果您正苦于以下问题:C# ReceptionTaskBO.GetTimeInUsed方法的具体用法?C# ReceptionTaskBO.GetTimeInUsed怎么用?C# ReceptionTaskBO.GetTimeInUsed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BussinessLogic.ReceptionTaskBO的用法示例。


在下文中一共展示了ReceptionTaskBO.GetTimeInUsed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadDataCurrentRoomForControl

        //Load lai du lieu cho cac control moi khi select vao 1 phong moi
        // Ngoc - done
        private void LoadDataCurrentRoomForControl()
        {
            if (this.aNewPaymentEN.aListBookingRoomUsed.Where(a => a.ID == this.CurrentIDBookingRoom).ToList().Count > 0)
            {
                BookingRoomUsedEN aBookingRoomUsedEN = this.aNewPaymentEN.aListBookingRoomUsed.Where(a => a.ID == this.CurrentIDBookingRoom).ToList()[0];
                /*Ghi chu TypeBookingRooms
                 * Type = 2: //Tính checkin sớm , không tính checkout muộn.
                 * Type = 0: //Không tính checkIn sớm và checkout muộn.
                 * Type = 3: //Tính checkin sớm và Checkout muộn
                 * Type = 1: //Không tính checkin sớm , tính checkout muộn
                 */
                ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO();

                if (aBookingRoomUsedEN.Status == 1 || aBookingRoomUsedEN.Status == 2)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInPlan;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutPlan;

                    txtNumberDate.Text = ""; // Phong chua su dung
                    txtAddTimeEnd.Text = "";
                    txtAddTimeStart.Text = "";

                    lblCI.Text = "CI dự kiến";
                    lblCO.Text = "CO dự kiến";
                    lblCaptionStatusRoom.Text = ("Phòng " + aBookingRoomUsedEN.RoomSku + " đang ở trạng thái đặt").ToUpper();

                }
                else if (aBookingRoomUsedEN.Status == 3)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInActual;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutPlan;

                    txtNumberDate.Text = aReceptionTaskBO.GetTimeInUsed(aBookingRoomUsedEN.CheckInActual, aBookingRoomUsedEN.CheckOutPlan).ToString();

                    txtAddTimeEnd.Text = aReceptionTaskBO.GetAddTimeEnd(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckOutPlan).ToString();
                    txtAddTimeStart.Text = aReceptionTaskBO.GetAddTimeStart(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckInActual).ToString();
                    lblCI.Text = "CI thực tế";
                    lblCO.Text = "CO dự kiến";
                    lblCaptionStatusRoom.Text = ("Phòng " + aBookingRoomUsedEN.RoomSku + " đang có người ở").ToUpper();
                }
                else if (aBookingRoomUsedEN.Status == 5)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInActual;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutPlan;

                    txtNumberDate.Text = aReceptionTaskBO.GetTimeInUsed(aBookingRoomUsedEN.CheckInActual, aBookingRoomUsedEN.CheckOutPlan).ToString();
                    txtAddTimeEnd.Text = aReceptionTaskBO.GetAddTimeEnd(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckOutPlan).ToString();
                    txtAddTimeStart.Text = aReceptionTaskBO.GetAddTimeStart(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckInActual).ToString();

                    lblCI.Text = "CI thực tế";
                    lblCO.Text = "CO dự kiến";
                    lblCaptionStatusRoom.Text = ("Phòng " + aBookingRoomUsedEN.RoomSku + " đang khóa").ToUpper();
                }
                else if (aBookingRoomUsedEN.Status == 7)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInActual;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutActual;

                    txtNumberDate.Text = aReceptionTaskBO.GetTimeInUsed(aBookingRoomUsedEN.CheckInActual, aBookingRoomUsedEN.CheckOutActual).ToString();
                    txtAddTimeEnd.Text = aReceptionTaskBO.GetAddTimeEnd(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckOutActual).ToString();
                    txtAddTimeStart.Text = aReceptionTaskBO.GetAddTimeStart(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckInActual).ToString();

                    lblCI.Text = "CI thực tế";
                    lblCO.Text = "CO thực tế";
                    lblCaptionStatusRoom.Text = ("Phòng " + aBookingRoomUsedEN.RoomSku + " đã checkout nhưng chưa thanh toán").ToUpper();
                }
                else if (aBookingRoomUsedEN.Status == 8)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInActual;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutActual;

                    // Neu phong da dc thanh toan tuc la thong tin phong da chot. Vay lay thong tin nay de hien thi
                    txtNumberDate.Text = (aBookingRoomUsedEN.TimeInUse.GetValueOrDefault(0)/(24*60)).ToString();
                    txtAddTimeEnd.Text = aBookingRoomUsedEN.AddTimeEnd.ToString();
                    txtAddTimeStart.Text = aBookingRoomUsedEN.AddTimeStart.ToString();

                    lblCI.Text = "CI thực tế";
                    lblCO.Text = "CO thực tế";
                    lblCaptionStatusRoom.Text = ("Phòng " + aBookingRoomUsedEN.RoomSku + " đã thanh toán").ToUpper();
                }
                lblSkuRooms.Text = aBookingRoomUsedEN.RoomSku;

                txtPercentTax_Room.Text = Convert.ToString(aBookingRoomUsedEN.PercentTax);
                lblMoneyRoom.Text = String.Format("{0:0,0} (VND)", this.aNewPaymentEN.GetOnlyMoneyRoom(aBookingRoomUsedEN.ID));

                if (string.IsNullOrEmpty(aBookingRoomUsedEN.Cost.ToString()) == false)
                {
                    txtBookingRoomsCost.EditValue = aBookingRoomUsedEN.Cost;
                }
                else
                {
                    txtBookingRoomsCost.EditValue = aAccountancyBO.CalculateCostRoom(this.CurrentIDBookingRoom, aBookingRoomUsedEN.PriceType, this.aNewPaymentEN.CustomerType.GetValueOrDefault(0), this.aNewPaymentEN.GetNumberCustomerInRoom(this.CurrentIDBookingRoom));
                }
                // Danh sách khách
                dgvCustomers.DataSource = aBookingRoomUsedEN.ListCustomer;
                dgvCustomers.RefreshDataSource();
                // Danh sách dịch vụ
                dgvServicesR.DataSource = aNewPaymentEN.GetListServiceUsedInRoom(aBookingRoomUsedEN.ID);
//.........这里部分代码省略.........
开发者ID:BruceleeThanh,项目名称:Pro_Government_2307,代码行数:101,代码来源:frmTsk_Payment_Step2.cs

示例2: InitData


//.........这里部分代码省略.........
                aNewPaymentEN.CustomerType = aBookingRs.CustomerType;
                aNewPaymentEN.Status_BookingR = aBookingRs.Status;
                aNewPaymentEN.StatusPay = aBookingRs.StatusPay;
                aNewPaymentEN.BookingRMoney = aBookingRs.BookingMoney;
                aNewPaymentEN.Status_BookingR = aBookingRs.Status;
                aNewPaymentEN.AcceptDate = aBookingRs.AcceptDate;
                aNewPaymentEN.InvoiceDate = aBookingRs.InvoiceDate;
                aNewPaymentEN.InvoiceNumber = aBookingRs.InvoiceNumber;

                // Truyen du lieu cho List BookingRoom cua NewPayment
                List<BookingRooms> aListBookingRooms = aBookingRoomBO.Select_ByIDBookingRs(this.IDBookingR);
                if (aListBookingRooms.Count > 0)
                {
                    BookingRoomUsedEN aBookingRoomUsedEN;

                    foreach (BookingRooms item in aListBookingRooms)
                    {
                        aBookingRoomUsedEN = new BookingRoomUsedEN();
                        aBookingRoomUsedEN.SetValue(item);
                        aBookingRoomUsedEN.ListCustomer = aCustomersBO.SelectListCustomer_ByIDBookingRoom(item.ID);
                        Rooms aRooms = aRoomsBO.Select_ByCodeRoom(item.CodeRoom, 1);
                        if (aRooms != null)
                        {
                            aBookingRoomUsedEN.RoomSku = aRooms.Sku;
                        }
                        else
                        {
                            aBookingRoomUsedEN.RoomSku = string.Empty;
                        }
                        if (item.Status == 8 || item.Status == 7)
                        {
                            aBookingRoomUsedEN.AddTimeStart = Convert.ToDouble(aReceptionTaskBO.GetAddTimeStart(Convert.ToInt32(item.Type), item.CheckInActual));
                            aBookingRoomUsedEN.AddTimeEnd = Convert.ToDouble(aReceptionTaskBO.GetAddTimeEnd(Convert.ToInt32(item.Type), item.CheckOutActual));
                            aBookingRoomUsedEN.TimeInUse = Convert.ToDecimal(aReceptionTaskBO.GetTimeInUsed(item.CheckInActual, item.CheckOutActual) * 24 * 60);
                        }
                        else
                        {
                            aBookingRoomUsedEN.AddTimeStart = Convert.ToDouble(aReceptionTaskBO.GetAddTimeStart(Convert.ToInt32(item.Type), item.CheckInActual));
                            aBookingRoomUsedEN.AddTimeEnd = Convert.ToDouble(aReceptionTaskBO.GetAddTimeEnd(Convert.ToInt32(item.Type), item.CheckOutPlan));
                            aBookingRoomUsedEN.TimeInUse = Convert.ToDecimal(aReceptionTaskBO.GetTimeInUsed(item.CheckInActual, item.CheckOutPlan) * 24 * 60);

                        }
                        decimal? cost = 0;
                        if (item.Cost == null)
                        {
                            cost = item.CostRef_Rooms;
                            aBookingRoomUsedEN.Cost = cost + Convert.ToDecimal(aExtraCostBO.Select_BySku_ByPriceType_ByNumberPeople(aRooms.Sku, aBookingRoomUsedEN.PriceType, aBookingRoomUsedEN.ListCustomer.Count).ExtraValue);
                        }
                        else
                        {
                            cost = item.Cost;
                            aBookingRoomUsedEN.Cost = cost;
                        }
                        List<ServiceUsedEN> aListServiceRTemp = aReceptionTaskBO.GetListServiceUsedInRoom_ByIDBookingRoom(item.ID);
                        foreach (ServiceUsedEN aTemp in aListServiceRTemp)
                        {
                            aBookingRoomUsedEN.ListServiceUsed.Add(aTemp);
                            aListIndexTemp.Add(Convert.ToInt32(aTemp.IndexSubPayment));
                        }
                        aListIndexTemp.Add(Convert.ToInt32(aBookingRoomUsedEN.IndexSubPayment));
                        aNewPaymentEN.aListBookingRoomUsed.Add(aBookingRoomUsedEN);
                    }
                }

                //====================================================================================================
                //====================================================================================================
开发者ID:BruceleeThanh,项目名称:Pro_Government_2307,代码行数:67,代码来源:frmTsk_Payment_Step2.cs

示例3: CheckOut

        public void CheckOut(int IDBookingRoom)
        {
            try
            {
                RoomsBO aRoomsBO = new RoomsBO();
                ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO();
                ExtraCostBO aExtraCostBO = new ExtraCostBO();
                BookingRoomsBO aBookingRoomsBO = new BookingRoomsBO();
                BookingRoomsMembersBO aBookingRoomsMembersBO = new BookingRoomsMembersBO();

                BookingRooms aBookingRooms = aBookingRoomsBO.Select_ByID(IDBookingRoom);
                List<BookingRoomsMembers> aListCus = aBookingRoomsMembersBO.Select_ByIDBookingRoom(IDBookingRoom);
                aBookingRooms.CheckOutActual = DateTime.Now;
                aBookingRooms.Status = 7;
                aBookingRooms.AddTimeStart = Convert.ToDouble(aReceptionTaskBO.GetAddTimeStart(aBookingRooms.Type.GetValueOrDefault(0), aBookingRooms.CheckInActual));
                aBookingRooms.AddTimeEnd = Convert.ToDouble(aReceptionTaskBO.GetAddTimeEnd(aBookingRooms.Type.GetValueOrDefault(0), aBookingRooms.CheckOutActual));
                aBookingRooms.TimeInUse = Convert.ToDecimal(aReceptionTaskBO.GetTimeInUsed(aBookingRooms.CheckInActual, aBookingRooms.CheckOutActual) * 24 * 60);
                Rooms aRooms = aRoomsBO.Select_ByCodeRoom(aBookingRooms.CodeRoom, 1);
                if (aRooms != null)
                {
                    if (aBookingRooms.Cost == null)
                    {
                        decimal? cost = 0;
                        cost = aBookingRooms.CostRef_Rooms;
                        aBookingRooms.Cost = cost + Convert.ToDecimal(aExtraCostBO.Select_BySku_ByPriceType_ByNumberPeople(aRooms.Sku, aBookingRooms.PriceType, aListCus.Count).ExtraValue);
                    }
                }

                aBookingRoomsBO.Update(aBookingRooms);
            }
            catch (Exception ex)
            {

                throw new Exception("AccountancyBO.CheckOut\n" + ex.ToString());
            }
        }
开发者ID:BruceleeThanh,项目名称:Pro_Government_0207,代码行数:36,代码来源:AccountancyBO.cs

示例4: LoadDataCurrentRoomForControl

        //Load lai du lieu cho cac control moi khi select vao 1 phong moi
        // Ngoc - done
        private void LoadDataCurrentRoomForControl()
        {
            if (this.aNewPaymentEN.aListBookingRoomUsed.Where(a => a.ID == this.CurrentIDBookingRoom).ToList().Count > 0)
            {
                BookingRoomUsedEN aBookingRoomUsedEN = this.aNewPaymentEN.aListBookingRoomUsed.Where(a => a.ID == this.CurrentIDBookingRoom).ToList()[0];
                /*Ghi chu TypeBookingRooms
                 * Type = 2: //Tính checkin sớm , không tính checkout muộn.
                 * Type = 0: //Không tính checkIn sớm và checkout muộn.
                 * Type = 3: //Tính checkin sớm và Checkout muộn
                 * Type = 1: //Không tính checkin sớm , tính checkout muộn
                 */
                ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO();
                this.ShowControlAutoCost(aBookingRoomUsedEN.Type.GetValueOrDefault(0));

                if (aBookingRoomUsedEN.Status == 1 || aBookingRoomUsedEN.Status == 2)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInPlan;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutPlan;

                    txtNumberDate.Text = "" ; // Phong chua su dung
                    txtAddTimeEnd.Text = "";
                    txtAddTimeStart.Text = "";

                    lblCI.Text = "CI dự kiến";
                    lblCO.Text = "CO dự kiến";

                }
                else if (aBookingRoomUsedEN.Status == 3 || aBookingRoomUsedEN.Status == 4 || aBookingRoomUsedEN.Status == 5)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInActual;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutPlan;

                    txtNumberDate.Text = aReceptionTaskBO.GetTimeInUsed(aBookingRoomUsedEN.CheckInActual, aBookingRoomUsedEN.CheckOutPlan).ToString();

                    txtAddTimeEnd.Text = aReceptionTaskBO.GetAddTimeEnd(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckOutPlan).ToString();
                    txtAddTimeStart.Text = aReceptionTaskBO.GetAddTimeStart(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckInActual).ToString();
                    lblCI.Text = "CI thực tế";
                    lblCO.Text = "CO dự kiến";
                }
                else if (aBookingRoomUsedEN.Status == 8 || aBookingRoomUsedEN.Status == 7)
                {
                    dtpCheckInActual.DateTime = aBookingRoomUsedEN.CheckInActual;
                    dtpCheckOutActual.DateTime = aBookingRoomUsedEN.CheckOutActual;

                    txtNumberDate.Text = aReceptionTaskBO.GetTimeInUsed(aBookingRoomUsedEN.CheckInActual, aBookingRoomUsedEN.CheckOutActual).ToString();
                    txtAddTimeEnd.Text = aReceptionTaskBO.GetAddTimeEnd(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckOutActual).ToString();
                    txtAddTimeStart.Text = aReceptionTaskBO.GetAddTimeStart(aBookingRoomUsedEN.Type.GetValueOrDefault(0), aBookingRoomUsedEN.CheckInActual).ToString();
                    lblCI.Text = "CI thực tế";
                    lblCO.Text = "CO thực tế";
                }

                lblSkuRooms.Text = aBookingRoomUsedEN.RoomSku;

                txtPercentTax_Room.Text = Convert.ToString(aBookingRoomUsedEN.PercentTax);
                lblMoneyRoom.Text = String.Format("{0:0,0} (VND)", this.aNewPaymentEN.GetMoneyARoom(aBookingRoomUsedEN.ID));

                if (string.IsNullOrEmpty(aBookingRoomUsedEN.Cost.ToString()) == false)
                {
                    txtBookingRoomsCost.EditValue = aBookingRoomUsedEN.Cost;
                }
                else
                {
                    txtBookingRoomsCost.EditValue = aAccountancyBO.CalculateCostRoom(this.CurrentIDBookingRoom, aBookingRoomUsedEN.PriceType, this.aNewPaymentEN.CustomerType.GetValueOrDefault(0), this.aNewPaymentEN.GetNumberCustomerInRoom(this.CurrentIDBookingRoom));
                }
                // Danh sách khách
                dgvCustomers.DataSource = aBookingRoomUsedEN.ListCustomer;
                dgvCustomers.RefreshDataSource();
                // Danh sách dịch vụ
                dgvServices.DataSource = aNewPaymentEN.GetListServiceUsedInRoom(aBookingRoomUsedEN.ID);
                dgvServices.RefreshDataSource();
                lblTotalMoneyService.Text = String.Format("{0:0,0} (VND)", this.aNewPaymentEN.GetMoneyListServiceUsedInARoom(aBookingRoomUsedEN.ID));
                //=========================================
                // Load lai  control khac
                this.LoadData();
            }
        }
开发者ID:BruceleeThanh,项目名称:Pro_Government_0207,代码行数:78,代码来源:frmTsk_Payment_Step2.cs

示例5: CheckOutFirstRoom

        //Ngoc
        public int CheckOutFirstRoom(int IDBookingRoom, DateTime CheckOut)
        {
            try
            {
                /*Ghi chu TypeBookingRooms
                *
                * Type = 2: //Tính checkin sớm , không tính checkout muộn.
                * Type = 0: //Không tính checkIn sớm và checkout muộn.
                * Type = 3: //Tính checkin sớm và Checkout muộn
                * Type = 1: //Không tính checkin sớm , tính checkout muộn
                */
                ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO();
                BookingRoomsBO aBookingRoomsBO = new BookingRoomsBO();
                BookingRooms aBookingRooms = aBookingRoomsBO.Select_ByID(IDBookingRoom);

                if (aBookingRooms != null)
                {
                    aBookingRooms.CheckOutActual = CheckOut;
                    int updateType = -1;
                    if (aBookingRooms.Type == 2)
                    {
                        updateType = 2;
                    }
                    else if (aBookingRooms.Type == 0)
                    {
                        updateType = 0;
                    }
                    else if (aBookingRooms.Type == 3)
                    {
                        updateType = 2;
                    }
                    else if (aBookingRooms.Type == 1)
                    {
                        updateType = 0;
                    }
                    else
                    {
                        updateType = 3;
                    }
                    aBookingRooms.Type = updateType;
                    aBookingRooms.Status = 7;//da checkout nhung chua thanh toan
                    aBookingRooms.TimeInUse = decimal.Parse(aReceptionTaskBO.GetTimeInUsed(aBookingRooms.CheckInActual, CheckOut).ToString());
                    aBookingRooms.AddTimeStart = aReceptionTaskBO.GetAddTimeStart(aBookingRooms.Type.GetValueOrDefault(0), aBookingRooms.CheckInActual);
                    aBookingRooms.AddTimeEnd =  aReceptionTaskBO.GetAddTimeEnd(aBookingRooms.Type.GetValueOrDefault(0), CheckOut);

                    return aBookingRoomsBO.Update(aBookingRooms);

                }
                else
                {
                    return 0;
                }

            }
            catch (Exception ex)
            {
                return 0;
            }
        }
开发者ID:BruceleeThanh,项目名称:Pro_Government_0207,代码行数:60,代码来源:ReceptionTaskBO.cs

示例6: CheckOut

        public int CheckOut(int IDBookingRoom, DateTime CheckOut)
        {
            try
            {
                ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO();
                BookingRoomsBO aBookingRoomsBO = new BookingRoomsBO();
                BookingRooms aBookingRooms = aBookingRoomsBO.Select_ByID(IDBookingRoom);
                if (aBookingRooms != null)
                {
                    aBookingRooms.CheckOutActual = CheckOut;
                    aBookingRooms.Status = 7;//da checkout nhung chua thanh toan
                    aBookingRooms.TimeInUse = decimal.Parse(aReceptionTaskBO.GetTimeInUsed(aBookingRooms.CheckInActual, CheckOut).ToString());
                    aBookingRooms.AddTimeStart = aReceptionTaskBO.GetAddTimeStart(aBookingRooms.Type.GetValueOrDefault(0), aBookingRooms.CheckInActual);
                    aBookingRooms.AddTimeEnd = aReceptionTaskBO.GetAddTimeEnd(aBookingRooms.Type.GetValueOrDefault(0), CheckOut);
                    return aBookingRoomsBO.Update(aBookingRooms);
                }
                else
                {
                    return 0;
                }

            }
            catch (Exception ex)
            {
                return 0;
            }
        }
开发者ID:BruceleeThanh,项目名称:Pro_Government_0207,代码行数:27,代码来源:ReceptionTaskBO.cs


注:本文中的BussinessLogic.ReceptionTaskBO.GetTimeInUsed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。