//设置账单 private void set_account() { //account.text = string.Join("|", m_Seats_Real.OrderBy(x => x.text).Select(x => x.text).ToArray()); //account.systemId = string.Join("|", m_Seats_Real.OrderBy(x => x.text).Select(x => x.systemId).ToArray()); //account.openTime = string.Join("|", m_Seats_Real.OrderBy(x => x.text).Select(x => x.openTime.ToString()).ToArray()); //account.openEmployee = string.Join("|", m_Seats_Real.OrderBy(x => x.text).Select(x => x.openEmployee).ToArray()); account.departmentId = 1; 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.ToString(); account.macAddress = BathClass.getMacAddr_Local(); if (m_promotion_Member != null) { account.promotionMemberId = m_promotion_Member.CI_CardNo; account.promotionAmount = m_discount_money; } if (m_Member_List != null) { account.memberId = string.Join("|", m_Member_List.Keys.ToArray()); } }
//插入账单数据库 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(); }
//对话框载入 private void CashierForm_Load(object sender, EventArgs e) { try { this.Location = new Point(0, 0); ptTimeList.Items.Add(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); var cpts = db.CashPrintTime.OrderByDescending(x=>x.time).Select(x=>x.time); macAdd = BathClass.getMacAddr_Local(); foreach (var cpt in cpts) ptTimeList.Items.Add(cpt.ToString("yyyy-MM-dd HH:mm:ss")); ptTimeList.SelectedIndex = 0; } catch (System.Exception ex) { BathClass.printErrorMsg(ex.Message); this.Close(); } }