Exemple #1
0
        //重新结账
        private void CtxRepay_Click(object sender, EventArgs e)
        {
            var seat = getContextSenderSeat(sender);

            InputEmployeeByPwd inputEmployee = new InputEmployeeByPwd();
            if (inputEmployee.ShowDialog() != DialogResult.OK)
                return;

            if (!dao.get_authority(inputEmployee.employee, "重新结账"))
            {
                BathClass.printErrorMsg("权限不够!");
                return;
            }

            //if (seat.status != SeatStatus.PAIED && seat.status != SeatStatus.AVILABLE)
            //{
            //    BathClass.printErrorMsg("手牌正在使用,不能重新结账");
            //    return;
            //}

            RepayActListForm form = new RepayActListForm(seat, inputEmployee.employee);
            form.ShowDialog();
        }
Exemple #2
0
        //重新结账
        private void CtxRepay_Click(object sender, EventArgs e)
        {
            //TableCashierCheckForm tableCashierSummaryForm = new TableCashierCheckForm();
            //tableCashierSummaryForm.ShowDialog();

            //BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            var seat = getContextSenderSeat(sender);

            InputEmployeeByPwd inputEmployee = new InputEmployeeByPwd();
            if (inputEmployee.ShowDialog() != DialogResult.OK)
                return;

            if (!dao.get_authority(inputEmployee.employee, "重新结账"))
            {
                BathClass.printErrorMsg("权限不够!");
                return;
            }

            //if (seat.status != SeatStatus.PAIED && seat.status != SeatStatus.AVILABLE)
            //{
            //    BathClass.printErrorMsg("手牌正在使用,不能重新结账");
            //    return;
            //}

            RepayActListForm form = new RepayActListForm(seat, inputEmployee.employee);
            form.ShowDialog();

            /*var act = db_new.Account.FirstOrDefault(x => x.systemId.Contains(seat.systemId) && x.abandon == null);
            if (act == null)
            {
                if (BathClass.printAskMsg("手牌未结账,是否直接恢复手牌?") != DialogResult.Yes)
                    return;

                seat.status = 2;
                db_new.SubmitChanges();
                return;
            }
            var ids = act.systemId.Split('|');
            var seats = db_new.Seat.Where(x => ids.Contains(x.systemId));
            foreach (var s in seats)
            {
                if (s.status == 2 || s.status == 6 || s.status == 7)
                {
                    BathClass.printErrorMsg("已经重新开牌,请先更换手牌");
                    return;
                }
                s.status = 2;
                var orders = db_new.HisOrders.Where(x => x.systemId == s.systemId);
                foreach (var order in orders)
                {
                    var ho = new Orders();
                    ho.menu = order.menu;
                    ho.text = order.text;
                    ho.systemId = order.systemId;
                    ho.number = order.number;
                    ho.priceType = order.priceType;
                    ho.money = order.money;
                    ho.technician = order.technician;
                    ho.techType = order.techType;
                    ho.inputTime = order.inputTime;
                    ho.inputEmployee = order.inputEmployee;
                    ho.deleteEmployee = order.deleteEmployee;
                    ho.donorEmployee = order.donorEmployee;
                    ho.comboId = order.comboId;
                    ho.paid = false;
                    ho.accountId = order.accountId;
                    ho.billId = order.billId;
                    db_new.HisOrders.DeleteOnSubmit(order);
                    db_new.Orders.InsertOnSubmit(ho);
                }
            }
            act.abandon = inputEmployee.employee.id;
            var cc = db_new.CardCharge.Where(x => act.id.ToString() == x.CC_AccountNo);
            if (cc.Any())
                db_new.CardCharge.DeleteAllOnSubmit(cc);
            db_new.SubmitChanges();*/
        }
Exemple #3
0
        //重新结账
        private void CtxRepay_Click(object sender, EventArgs e)
        {
            //TableCashierCheckForm tableCashierSummaryForm = new TableCashierCheckForm();
            //tableCashierSummaryForm.ShowDialog();

            BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            var seat = getContextSenderSeat(db_new, sender);

            InputEmployeeByPwd inputEmployee = new InputEmployeeByPwd();

            if (inputEmployee.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            if (!BathClass.getAuthority(db_new, inputEmployee.employee, "重新结账"))
            {
                BathClass.printErrorMsg("权限不够!");
                return;
            }

            if (seat.status != 3)
            {
                BathClass.printErrorMsg("手牌未结账,不能重新结账");
                return;
            }

            RepayActListForm form = new RepayActListForm(seat, inputEmployee.employee);

            form.ShowDialog();

            /*var act = db_new.Account.FirstOrDefault(x => x.systemId.Contains(seat.systemId) && x.abandon == null);
             * if (act == null)
             * {
             *  if (BathClass.printAskMsg("手牌未结账,是否直接恢复手牌?") != DialogResult.Yes)
             *      return;
             *
             *  seat.status = 2;
             *  db_new.SubmitChanges();
             *  return;
             * }
             * var ids = act.systemId.Split('|');
             * var seats = db_new.Seat.Where(x => ids.Contains(x.systemId));
             * foreach (var s in seats)
             * {
             *  if (s.status == 2 || s.status == 6 || s.status == 7)
             *  {
             *      BathClass.printErrorMsg("已经重新开牌,请先更换手牌");
             *      return;
             *  }
             *  s.status = 2;
             *  var orders = db_new.HisOrders.Where(x => x.systemId == s.systemId);
             *  foreach (var order in orders)
             *  {
             *      var ho = new Orders();
             *      ho.menu = order.menu;
             *      ho.text = order.text;
             *      ho.systemId = order.systemId;
             *      ho.number = order.number;
             *      ho.priceType = order.priceType;
             *      ho.money = order.money;
             *      ho.technician = order.technician;
             *      ho.techType = order.techType;
             *      ho.inputTime = order.inputTime;
             *      ho.inputEmployee = order.inputEmployee;
             *      ho.deleteEmployee = order.deleteEmployee;
             *      ho.donorEmployee = order.donorEmployee;
             *      ho.comboId = order.comboId;
             *      ho.paid = false;
             *      ho.accountId = order.accountId;
             *      ho.billId = order.billId;
             *      db_new.HisOrders.DeleteOnSubmit(order);
             *      db_new.Orders.InsertOnSubmit(ho);
             *  }
             * }
             * act.abandon = inputEmployee.employee.id;
             * var cc = db_new.CardCharge.Where(x => act.id.ToString() == x.CC_AccountNo);
             * if (cc.Any())
             *  db_new.CardCharge.DeleteAllOnSubmit(cc);
             * db_new.SubmitChanges();*/
        }