Пример #1
0
        //会员打折
        private void btnDiscount_Click(object sender, EventArgs e)
        {
            BathClass.sendMessageToCamera(db, m_Seats[0].systemId);
            var id = string.Join("|", m_Seats.Select(x => x.systemId).ToArray());
            MemberPromotionForm memberPromotionForm = new MemberPromotionForm(m_Seats, id);

            memberPromotionForm.ShowDialog();
            m_Member = memberPromotionForm.m_member;
            this.Close();
        }
Пример #2
0
        //储值卡结账
        private void creditCardTool_Click(object sender, EventArgs e)
        {
            //1,刷会员卡
            //2,更新订单信息,修改订单paid属性
            //3,插入账单数据库,更新
            //4,更新台位信息
            //5,更新客房信息
            if (!creditCardTool.Enabled)
            {
                return;
            }

            creditCardTool.Enabled = false;
            if (check_if_combined())
            {
                return;
            }

            try
            {
                CardUsingForm memberCardUsingForm = new CardUsingForm(Convert.ToDouble(moneyPayable.Text));
                if (memberCardUsingForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                if (m_Member_List == null)
                {
                    m_Member_List = memberCardUsingForm.m_memberList;
                }

                //Account account = new Account();
                set_account();
                account.creditCard = m_money;
                db.Account.InsertOnSubmit(account);
                db.SubmitChanges();

                set_order_paid();
                update_seat_room();
                insert_member_infor();
                db.SubmitChanges();

                BathClass.sendMessageToCamera(db, m_Seats[0].systemId);
                this.DialogResult = DialogResult.OK;
            }
            catch (System.Exception ex)
            {
                handle_exception(ex);
            }
        }
Пример #3
0
        //判断是否需要会员卡
        private bool memberCardNeed()
        {
            if (creditCard.Text != "")
            {
                CardUsingForm memberCardUsingForm = new CardUsingForm(Convert.ToDouble(creditCard.Text));
                if (memberCardUsingForm.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }

                m_Member_List = memberCardUsingForm.m_memberList;
                if (watch)
                {
                    BathClass.sendMessageToCamera(db, m_Seats[0].systemId);
                }
            }

            if (coupon.Text != "" && watch)
            {
                BathClass.sendMessageToCamera(db, m_Seats[0].systemId);
            }

            if (zero.Text != "")
            {
                CustomerChooseForm customerChooseForm = new CustomerChooseForm();
                if (customerChooseForm.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }

                customerId = customerChooseForm.customerId;
                Customer customer = db.Customer.FirstOrDefault(x => x.id.ToString() == customerId);
                customer.money += Convert.ToDouble(zero.Text);
                db.SubmitChanges();
            }

            if (sign.Text != "")
            {
                SignForFreeForm inputSerForm = new SignForFreeForm();
                if (inputSerForm.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }

                signature = inputSerForm.signature;
            }
            return(true);
        }
Пример #4
0
        //判断是否需要会员卡
        private bool memberCardNeed()
        {
            if (creditCard.Text != "")
            {
                CardUsingForm memberCardUsingForm = new CardUsingForm(Convert.ToDouble(creditCard.Text));
                if (memberCardUsingForm.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }

                m_Member_List = memberCardUsingForm.m_memberList;
                if (watch)
                {
                    if (!BathClass.sendMessageToCamera(dao, m_Seats[0].systemId))
                    {
                        BathClass.printErrorMsg("发送消息给摄像头失败,请重试!");
                        return(false);
                    }
                }
            }

            if (coupon.Text != "" && watch)
            {
                if (!BathClass.sendMessageToCamera(dao, m_Seats[0].systemId))
                {
                    BathClass.printErrorMsg("发送消息给摄像头失败,请重试!");
                    return(false);
                }
            }

            if (zero.Text != "")
            {
                CustomerChooseForm customerChooseForm = new CustomerChooseForm();
                if (customerChooseForm.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }

                customerId = customerChooseForm.customerId;

                string cmd_str = "update [Customer] set money=isnull(money,0)+" + zero.Text + " where id=" + customerId.ToString();
                if (!dao.execute_command(cmd_str))
                {
                    BathClass.printErrorMsg("客户累计金额失败,请重试!");
                    return(false);
                }
                ////Customer customer = db.Customer.FirstOrDefault(x => x.id.ToString() == customerId);
                ////customer.money += Convert.ToDouble(zero.Text);
                ////db.SubmitChanges();
            }

            if (sign.Text != "")
            {
                SignForFreeForm inputSerForm = new SignForFreeForm();
                if (inputSerForm.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }

                signature = inputSerForm.signature;
            }
            return(true);
        }