//数量 private void btnNumber_Click(object sender, EventArgs e) { if (dgvExpense.CurrentCell == null) { GeneralClass.printErrorMsg("需要输入订单!"); return; } int orderId = Convert.ToInt32(dgvExpense.CurrentRow.Cells[0].Value); var order = db.Orders.FirstOrDefault(x => x.id == orderId); if (order == null) { GeneralClass.printErrorMsg("输入订单编号错误!"); return; } InputServerId inputServerForm = new InputServerId("输入点单数量", true); if (inputServerForm.ShowDialog() != DialogResult.OK) { return; } double unit = order.money / order.number; order.number = Convert.ToInt32(inputServerForm.number); order.money = unit * order.number; db.SubmitChanges(); dgvExpense_show(); }
//点击菜式 private void btnMenu_Click(object sender, EventArgs e) { YouSoftBathGeneralClass.Menu menu = db.Menu.FirstOrDefault(x => x.name == ((Button)sender).Text); Orders order = new Orders(); order.menu = menu.name; order.text = m_Seat.text; order.systemId = m_Seat.systemId; order.number = 1; order.money = menu.price; order.inputTime = GeneralClass.Now; order.inputEmployee = m_Employee.id.ToString(); order.paid = false; //m_Seat.money += menu.price; if (menu.technician) { InputServerId techForm = new InputServerId("", false); if (techForm.ShowDialog() != DialogResult.OK) { GeneralClass.printErrorMsg("需要选择技师!"); return; } order.technician = techForm.emplyee.id.ToString(); //var tech = db.Employee.FirstOrDefault(x => x.id.ToString() == technicianForm.m_tId); } db.Orders.InsertOnSubmit(order); db.SubmitChanges(); m_Orders.Add(order); //findComboOfOrder(order); find_combo(); dgvExpense_show(); }
//数量 private void btnNumber_Click(object sender, EventArgs e) { if (dgvExpense.CurrentCell == null) { GeneralClass.printErrorMsg("需要输入订单!"); return; } int orderId = Convert.ToInt32(dgvExpense.CurrentRow.Cells[0].Value); var order = db.Orders.FirstOrDefault(x => x.id == orderId); if (order == null) { GeneralClass.printErrorMsg("输入订单编号错误!"); return; } InputServerId inputServerForm = new InputServerId("输入点单数量", true); if (inputServerForm.ShowDialog() != DialogResult.OK) return; double unit = order.money / order.number; order.number = Convert.ToInt32(inputServerForm.number); order.money = unit * order.number; db.SubmitChanges(); dgvExpense_show(); }