Пример #1
0
        /// <summary>
        /// 获取交接班信息
        /// </summary>
        /// <returns></returns>
        public HandOverModel GetHandOverInfo()
        {
            try
            {
                HandOverInfo         bHandOver     = new HandOverInfo();
                int                  nHandOverId   = bHandOver.GetHandOverLatestId();
                ObjectControls       oCtrl         = new ObjectControls();
                List <HandOverModel> listHandOver  = new List <HandOverModel>();
                HandOverModel        mHandOver     = new HandOverModel();
                CustomerStayModel    mCustomerStay = new CustomerStayModel();

                if (nHandOverId > 0)
                {
                    mHandOver.HandOverId = nHandOverId;
                    listHandOver         = bHandOver.GetHandOverList(mHandOver, new ObjectControls(MCtrl.ByHandOverId));
                    if (Cmn.CheckEOF(listHandOver))
                    {
                        mCustomerStay.CommonInfo.CreateDate = listHandOver[0].CommonInfo.EndDate;
                        mHandOver.CommonInfo.StartDate      = listHandOver[0].CommonInfo.EndDate;
                        mHandOver.FromLastMoney             = listHandOver[0].ToNextMoney;
                    }
                }
                else
                {
                    mCustomerStay.CommonInfo.CreateDate = DateTime.Parse("2005-01-01");
                    mHandOver.CommonInfo.StartDate      = mCustomerStay.CommonInfo.CreateDate;
                    mHandOver.FromLastMoney             = 0.0;
                }
                oCtrl.Add(MCtrl.ByCreateDate);
                mCustomerStay.Status = 'I';
                oCtrl.Add(MCtrl.ByStayStatus);
                mHandOver.CurrentDeposit     = bCustomerStay.GetHandOverStayInfo(mCustomerStay, oCtrl).CurrentDeposit;
                mCustomerStay.Status         = 'O';
                mHandOver.CurrentPaidMoney   = bCustomerStay.GetHandOverStayInfo(mCustomerStay, oCtrl).CurrentPaidMoney;
                mHandOver.CommonInfo.EndDate = Cmn.DateBaseDate;
                mHandOver.HandInMoney        = 0;
                mHandOver.HandOverMoney      = mHandOver.FromLastMoney + mHandOver.CurrentDeposit + mHandOver.CurrentPaidMoney;
                mHandOver.ToNextMoney        = mHandOver.HandOverMoney;
                return(mHandOver);
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Пример #2
0
        /// <summary>
        /// 获取交接班信息
        /// </summary>
        /// <returns></returns>
        public HandOverModel GetHandOverInfo()
        {
            try
            {
                HandOverInfo bHandOver = new HandOverInfo();
                int nHandOverId = bHandOver.GetHandOverLatestId();
                ObjectControls oCtrl = new ObjectControls();
                List<HandOverModel> listHandOver = new List<HandOverModel>();
                HandOverModel mHandOver = new HandOverModel();
                CustomerStayModel mCustomerStay = new CustomerStayModel();

                if (nHandOverId > 0)
                {
                    mHandOver.HandOverId = nHandOverId;
                    listHandOver = bHandOver.GetHandOverList(mHandOver, new ObjectControls(MCtrl.ByHandOverId));
                    if (Cmn.CheckEOF(listHandOver))
                    {
                        mCustomerStay.CommonInfo.CreateDate = listHandOver[0].CommonInfo.EndDate;
                        mHandOver.CommonInfo.StartDate = listHandOver[0].CommonInfo.EndDate;
                        mHandOver.FromLastMoney = listHandOver[0].ToNextMoney;
                    }
                }
                else
                {
                    mCustomerStay.CommonInfo.CreateDate = DateTime.Parse("2005-01-01");
                    mHandOver.CommonInfo.StartDate = mCustomerStay.CommonInfo.CreateDate;
                    mHandOver.FromLastMoney = 0.0;
                }
                oCtrl.Add(MCtrl.ByCreateDate);
                mCustomerStay.Status = 'I';
                oCtrl.Add(MCtrl.ByStayStatus);
                mHandOver.CurrentDeposit = bCustomerStay.GetHandOverStayInfo(mCustomerStay, oCtrl).CurrentDeposit;
                mCustomerStay.Status = 'O';
                mHandOver.CurrentPaidMoney = bCustomerStay.GetHandOverStayInfo(mCustomerStay, oCtrl).CurrentPaidMoney;
                mHandOver.CommonInfo.EndDate = Cmn.DateBaseDate;
                mHandOver.HandInMoney = 0;
                mHandOver.HandOverMoney = mHandOver.FromLastMoney + mHandOver.CurrentDeposit + mHandOver.CurrentPaidMoney;
                mHandOver.ToNextMoney = mHandOver.HandOverMoney;
                return mHandOver;
            }
            catch (Exception err)
            {
                throw err;
            }
        }