//消费录入 private void orderTool_Click(object sender, EventArgs e) { BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); return; } List <int> sLst = new List <int>(); sLst.Add(2); sLst.Add(6); var inputSeatForm = new InputRoomForm(sLst); if (inputSeatForm.ShowDialog() != DialogResult.OK) { return; } var seat = db_new.HotelRoom.FirstOrDefault(x => x.text == inputSeatForm.m_Seat.text); seat.ordering = true; db_new.SubmitChanges(); var orderForm = new HotelRoomOrderForm(inputSeatForm.m_Seat); orderForm.ShowDialog(); seat.ordering = false; db_new.SubmitChanges(); }
//消费录入 private void toolOrder_Click(object sender, EventArgs e) { if (m_Seat == null) { BathClass.printErrorMsg("先选择手牌!"); return; } var dc = new BathDBDataContext(LogIn.connectionString); if (!BathClass.getAuthority(dc, LogIn.m_User, "完整点单") && !BathClass.getAuthority(dc, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); return; } var orderForm = new HotelRoomOrderForm(m_Seat); orderForm.ShowDialog(); dgvExpense_show(dc); setStatus(dc); }
//F6开牌 private void tool_open_seat() { BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); string text = tSeat.Text; tSeat.Text = ""; m_HotelRoom = db_new.HotelRoom.FirstOrDefault(x => x.text == text || x.oId == text); if (m_HotelRoom == null) { BathClass.printErrorMsg("手牌不可用!"); return; } switch (m_HotelRoom.status) { case 1: //可用 case 3: //已经结账 BathClass.printErrorMsg("手牌未开牌"); break; case 2: //正在使用 case 7: //押金离场 if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); break; } if (m_HotelRoom.paying.HasValue && m_HotelRoom.paying.Value) { BathClass.printErrorMsg("正在结账!"); break; } m_HotelRoom.ordering = true; db_new.SubmitChanges(); HotelRoomOrderForm orderForm = new HotelRoomOrderForm(m_HotelRoom); orderForm.ShowDialog(); m_HotelRoom.ordering = false; db_new.SubmitChanges(); break; case 4: //锁定 BathClass.printErrorMsg("手牌已经锁定!"); break; case 5: //停用 BathClass.printErrorMsg("手牌已经停用!"); break; case 6: //警告 HotelRoomOrderCheckForm orderCheckForm = new HotelRoomOrderCheckForm(m_HotelRoom); orderCheckForm.ShowDialog(); break; case 8: BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } tSeat.Text = ""; }
//点击台位按钮 private void btn_Click(object sender, EventArgs e) { Button btn = sender as Button; btn.Enabled = false; btn.Enabled = true; BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); m_HotelRoom = db_new.HotelRoom.FirstOrDefault(x => x.text == btn.Text); int status = m_HotelRoom.status; switch (status) { case 1: //可用 case 3: //已经结账 BathClass.printErrorMsg("手牌未开牌"); break; case 2: //正在使用 case 7: //押金离场 if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); break; } if (m_HotelRoom.paying.HasValue && m_HotelRoom.paying.Value) { BathClass.printErrorMsg("正在结账!"); break; } m_HotelRoom.ordering = true; db_new.SubmitChanges(); var orderForm = new HotelRoomOrderForm(m_HotelRoom); orderForm.ShowDialog(); m_HotelRoom.ordering = false; db_new.SubmitChanges(); break; case 4: //锁定 BathClass.printErrorMsg("手牌已经锁定!"); break; case 5: //停用 BathClass.printErrorMsg("台位已经停用!"); break; case 6: //警告 var orderCheckForm = new HotelRoomOrderCheckForm(m_HotelRoom); orderCheckForm.ShowDialog(); break; case 8: BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } }
//消费录入 private void orderTool_Click(object sender, EventArgs e) { BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); return; } List<int> sLst = new List<int>(); sLst.Add(2); sLst.Add(6); var inputSeatForm = new InputRoomForm(sLst); if (inputSeatForm.ShowDialog() != DialogResult.OK) return; var seat = db_new.HotelRoom.FirstOrDefault(x => x.text == inputSeatForm.m_Seat.text); seat.ordering = true; db_new.SubmitChanges(); var orderForm = new HotelRoomOrderForm(inputSeatForm.m_Seat); orderForm.ShowDialog(); seat.ordering = false; db_new.SubmitChanges(); }
//F6开牌 private void tool_open_seat() { if (tSeat.Text == "") { return; } BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); string text = tSeat.Text; tSeat.Text = ""; var seat1 = db_new.HotelRoom.FirstOrDefault(x => x.text == text); var seat2 = db_new.HotelRoom.FirstOrDefault(x => x.oId == text); if (seat1 == null && seat2 == null) { BathClass.printErrorMsg("手牌不可用!"); return; } if (seat1 != null) { var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == seat1.typeId); switch (seat1.status) { case 1: //可用 case 3: //已经结账 if (!BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号开牌) && mtype.menuId != null) { BathClass.printErrorMsg("不允许手工输入手牌号开牌!"); break; } open_seat(seat1, db_new); break; case 2: //正在使用 case 7: //押金离场 if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够"); break; } seat1.ordering = true; db_new.SubmitChanges(); var orderForm = new HotelRoomOrderForm(m_Seat); orderForm.ShowDialog(); seat1.ordering = false; db_new.SubmitChanges(); break; case 4: //锁定 BathClass.printErrorMsg("台位已经锁定!"); break; case 5: //停用 BathClass.printErrorMsg("台位已经停用!"); break; case 6: //警告 var orderCheckForm = new HotelRoomOrderCheckForm(m_Seat); orderCheckForm.ShowDialog(); break; case 8: BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } } else if (seat2 != null) { var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == seat2.typeId); switch (seat2.status) { case 1: //可用 case 3: //已经结账 open_seat(seat2, db_new); break; case 2: //正在使用 case 7: //押金离场 if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够"); break; } seat2.ordering = true; db_new.SubmitChanges(); var orderForm = new HotelRoomOrderForm(m_Seat); orderForm.ShowDialog(); seat2.ordering = false; db_new.SubmitChanges(); break; case 4: //锁定 BathClass.printErrorMsg("台位已经锁定!"); break; case 5: //停用 BathClass.printErrorMsg("台位已经停用!"); break; case 6: //警告 var orderCheckForm = new HotelRoomOrderCheckForm(m_Seat); orderCheckForm.ShowDialog(); break; case 8: BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } } }
//点击台位按钮 private void btn_Click(object sender, EventArgs e) { Button btn = sender as Button; btn.Enabled = false; btn.Enabled = true; BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); m_Seat = db_new.HotelRoom.FirstOrDefault(x => x.text == btn.Text); var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == m_Seat.typeId); switch (m_Seat.status) { case 1: //可用 case 3: //已经结账 if (!BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号开牌) && mtype.menuId != null) { BathClass.printErrorMsg("不允许手工输入手牌号开牌!"); break; } open_seat(m_Seat, db_new); break; case 2: //正在使用 case 7: //押金离场 if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够"); break; } m_Seat.ordering = true; db_new.SubmitChanges(); var orderForm = new HotelRoomOrderForm(m_Seat); orderForm.ShowDialog(); m_Seat.ordering = false; db_new.SubmitChanges(); break; case 4: //锁定 break; case 5: //停用 BathClass.printErrorMsg("台位已经停用!"); break; case 6: //警告 var orderCheckForm = new HotelRoomOrderCheckForm(m_Seat); orderCheckForm.ShowDialog(); break; case 8: //重新结账 BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } }
//点击台位按钮 private void btn_Click(object sender, EventArgs e) { Button btn = sender as Button; btn.Enabled = false; btn.Enabled = true; BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); m_HotelRoom = db_new.HotelRoom.FirstOrDefault(x => x.text == btn.Text); int status = m_HotelRoom.status; switch (status) { case 1://可用 case 3://已经结账 BathClass.printErrorMsg("手牌未开牌"); break; case 2://正在使用 case 7://押金离场 if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); break; } if (m_HotelRoom.paying.HasValue && m_HotelRoom.paying.Value) { BathClass.printErrorMsg("正在结账!"); break; } m_HotelRoom.ordering = true; db_new.SubmitChanges(); var orderForm = new HotelRoomOrderForm(m_HotelRoom); orderForm.ShowDialog(); m_HotelRoom.ordering = false; db_new.SubmitChanges(); break; case 4://锁定 BathClass.printErrorMsg("手牌已经锁定!"); break; case 5://停用 BathClass.printErrorMsg("台位已经停用!"); break; case 6://警告 var orderCheckForm = new HotelRoomOrderCheckForm(m_HotelRoom); orderCheckForm.ShowDialog(); break; case 8: BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } }
//F6开牌 private void tool_open_seat() { BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); string text = tSeat.Text; tSeat.Text = ""; m_HotelRoom = db_new.HotelRoom.FirstOrDefault(x => x.text == text || x.oId == text); if (m_HotelRoom == null) { BathClass.printErrorMsg("手牌不可用!"); return; } switch (m_HotelRoom.status) { case 1://可用 case 3://已经结账 BathClass.printErrorMsg("手牌未开牌"); break; case 2://正在使用 case 7://押金离场 if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") && !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); break; } if (m_HotelRoom.paying.HasValue && m_HotelRoom.paying.Value) { BathClass.printErrorMsg("正在结账!"); break; } m_HotelRoom.ordering = true; db_new.SubmitChanges(); HotelRoomOrderForm orderForm = new HotelRoomOrderForm(m_HotelRoom); orderForm.ShowDialog(); m_HotelRoom.ordering = false; db_new.SubmitChanges(); break; case 4://锁定 BathClass.printErrorMsg("手牌已经锁定!"); break; case 5://停用 BathClass.printErrorMsg("手牌已经停用!"); break; case 6://警告 HotelRoomOrderCheckForm orderCheckForm = new HotelRoomOrderCheckForm(m_HotelRoom); orderCheckForm.ShowDialog(); break; case 8: BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } tSeat.Text = ""; }