Esempio n. 1
0
        public ReservationActions(ReservationVM vm,
                                  RoomsBLL roomBLL,
                                  FeaturesBLL featureBLL,
                                  ExtraServicesBLL extraServicesBLL,
                                  DiscountBLL discountBLL)
        {
            viewModel = vm;

            this.roomBLL          = roomBLL;
            this.featureBLL       = featureBLL;
            this.extraServicesBLL = extraServicesBLL;
            this.discountBLL      = discountBLL;
        }
Esempio n. 2
0
        /* Constructor */
        public AdminActions(AdminVM adminVM,
                            RoomsBLL roomBLL,
                            FeaturesBLL featureBLL,
                            ExtraServicesBLL extraServicesBLL,
                            DiscountBLL discountBLL)
        {
            viewModel = adminVM;

            this.roomBLL          = roomBLL;
            this.featureBLL       = featureBLL;
            this.extraServicesBLL = extraServicesBLL;
            this.discountBLL      = discountBLL;

            roomsDAL     = new RoomsDAL();
            ImageManager = new ImageManager();
        }
Esempio n. 3
0
        /// <summary>
        /// 读取数据
        /// </summary>
        private void GetData()
        {
            Thread.Sleep(1000);

            #region 更新主档信息
            //商品主档和商品变化主档同时存在时,先读取商品主档,再读取变化主档
            if (File.Exists(GlobalParams.spmxServerPath))
            {
                int ret;
                ret = new GoodsBLL().DeleteGoods();

                if (ret >= 0)
                {
                    DataOperator.UpdateData(GlobalParams.spmxServerPath, GlobalParams.spmxLocalPath, "goods_spmx", false);
                }
                else
                {
                    MessageBox.Show("商品表更新异常,请重新登录");
                    Log.WriteErrorLog("清空商品表出现异常,中断更新");
                }
            }
            DataOperator.UpdateSpit();

            if (File.Exists(GlobalParams.ygkServerPath))
            {
                int ret;
                ret = new StaffBLL().DeleteStaff();

                if (ret >= 0)
                {
                    DataOperator.UpdateData(GlobalParams.ygkServerPath, GlobalParams.ygkLocalPath, "staff_ygk", false);
                }
                else
                {
                    MessageBox.Show("员工表更新异常,请重新登录");
                    Log.WriteErrorLog("清空员工表出现异常,中断更新");
                }
            }

            if (File.Exists(GlobalParams.jsfsServerPath))
            {
                int ret;
                ret = new CardBLL().DeleteCard();

                if (ret >= 0)
                {
                    DataOperator.UpdateData(GlobalParams.jsfsServerPath, GlobalParams.jsfsLocalPath, "paymentmethod_jsfs", false);
                }
                else
                {
                    MessageBox.Show("结算方式表更新异常,请重新登录");
                    Log.WriteErrorLog("清空结算方式表出现异常,中断更新");
                }
            }

            if (File.Exists(GlobalParams.yhxsServerPath))
            {
                int ret;
                ret = new DiscountBLL().DeleteDiscount();

                if (ret >= 0)
                {
                    DataOperator.UpdateData(GlobalParams.yhxsServerPath, GlobalParams.yhxsLocalPath, "discount_yhxs", false);
                }
                else
                {
                    MessageBox.Show("时段折扣表更新异常,请重新登录");
                    Log.WriteErrorLog("清空时段折扣表出现异常,中断更新");
                }
            }

            //促销没有主键,采用先清空,再导入的策略
            if (File.Exists(GlobalParams.ptServerPath))
            {
                int ret;
                ret = new PromotionBLL().DeletePromotion();

                if (ret >= 0)
                {
                    DataOperator.UpdateData(GlobalParams.ptServerPath, GlobalParams.ptLocalPath, "promotion_pt", false);
                }
                else
                {
                    MessageBox.Show("促销表更新异常,请重新登录");
                    Log.WriteErrorLog("清空促销表出现异常,中断更新");
                }
            }
            #endregion

            Staff loginStaff = new StaffBLL().GetStaffByID(txtStaffID.Text);

            //记录登录的员工
            staff = loginStaff;
        }
Esempio n. 4
0
 /* Properties */
 public CreateDiscountVM()
 {
     discountBLL = new DiscountBLL();
 }
Esempio n. 5
0
 /* Properties */
 public UpdateDiscountVM()
 {
     discountBLL = new DiscountBLL();
 }