Example #1
0
        //显示信息
        private void setStatus(BathDBDataContext dc)
        {
            double money = 0;

            population.Text   = m_Seats.Sum(x => x.population).ToString();
            money             = BathClass.get_rooms_expenses(dc, m_Seats, LogIn.connectionString);
            seatText.Text     = "";
            openTime.Text     = "";
            timeSpan.Text     = "";
            expense.Text      = money.ToString();
            moneyPayable.Text = money.ToString();
        }
Example #2
0
        //插入账单数据库
        private void insert_account(BathDBDataContext dc, ref Account account, string name)
        {
            account.text           = string.Join(";", m_Seats.OrderBy(x => x.text).Select(x => x.text).ToArray());
            account.systemId       = string.Join(";", m_Seats.OrderBy(x => x.text).Select(x => x.systemId).ToArray());
            account.openTime       = string.Join(";", m_Seats.OrderBy(x => x.text).Select(x => x.openTime.ToString()).ToArray());
            account.openEmployee   = string.Join(";", m_Seats.OrderBy(x => x.text).Select(x => x.openEmployee).ToArray());
            account.payTime        = GeneralClass.Now;
            account.payEmployee    = LogIn.m_User.id;
            account.server         = BathClass.get_rooms_expenses(dc, m_Seats, LogIn.connectionString);
            account.serverEmployee = name;
            account.macAddress     = BathClass.getMacAddr_Local();

            dc.Account.InsertOnSubmit(account);
            dc.SubmitChanges();
        }
Example #3
0
        //对话框载入
        private void PayForm_Load(object sender, EventArgs e)
        {
            BathClass.change_input_en();
            watch             = BathClass.ToBool(db.Options.FirstOrDefault().启用结账监控);
            m_money           = BathClass.get_rooms_expenses(db, m_Seats, LogIn.connectionString);
            moneyPayable.Text = m_money.ToString();
            changes.Text      = (-m_money).ToString();

            for (int i = 0; i < m_Seats.Count; i++)
            {
                if (m_keeps[i])
                {
                    continue;
                }
                m_Seats_Real.Add(m_Seats[i]);
            }
            //money_real = BathClass.get_seats_expenses(m_Seats_Real, LogIn.connectionString);
        }
Example #4
0
        //会员打折
        private void memberTool_Click(object sender, EventArgs e)
        {
            double money_pre = Convert.ToDouble(moneyPayable.Text);
            MemberPromotionOptionForm memberPromotionOptionForm = new MemberPromotionOptionForm(m_Seats);

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

            var dc = new BathDBDataContext(LogIn.connectionString);

            m_Member = memberPromotionOptionForm.m_Member;
            double money = BathClass.get_rooms_expenses(dc, m_Seats, LogIn.connectionString);

            moneyPayable.Text = money.ToString();
            discount_money    = money_pre - money;

            dgvExpense_show(dc);
        }