private void btnDC_Click(object sender, EventArgs e) { int n = 0; Random rd = new Random(); string OrderId = ""; OrderId += DateTime.Now.Year.ToString(); OrderId += DateTime.Now.Month.ToString(); OrderId += DateTime.Now.Day.ToString(); for (int i = 0; i < 6; i++) { OrderId += rd.Next(0, 10).ToString(); } n = OrderManager.InsertOrder(OrderId, Convert.ToInt32(lbTableId.Text)); ScheduleManager.DeleteSchedule(); TableManager.UpdateTypebyTableId(5, lbTableId.Text); TableManager.UpdateTableNowInfo(lbTableId.Text, OrderId, DateTime.Now, 0, null, false); if (n > 0) { // FoodPlayer.Ctlcontrols.stop(); FrmFoodMain drm = new FrmFoodMain(); FrmFoodInfo ffi = new FrmFoodInfo(); drm.lbTable.Text = lbTableId.Text; drm.lbOrderId.Text = OrderId; this.Hide(); drm.Show(); } else { Transmit.FrmFoodMain.Tipsk("打开失败请重试!"); } }
private void timer2_Tick(object sender, EventArgs e) { int TableTypeId = (int)TableManager.SelectTableTypeId(TableId.ToString()); if (TableTypeId == 3) { if (Transmit.FrmFoodMain.llbVIP.Text != "未登录") { int n = OrderManager.InsertPayInfo(TableId, OrderId, VipSumPrice, PayTime, Remarks, IsPay); OrderManager.InsertPay(OrderId, PayTime, IsPay); if (n > 0) { Transmit.FrmPay.FrmPay_Load(sender, e); Transmit.FrmPay.lbSumRmb.Text = "0"; List <Schedule> sd = ScheduleManager.selectScheduleValues(); ScheduleManager.DeleteSchedule(); TableManager.UpdateTableNowInfo(Transmit.FrmMenu.lbTableId.Text, OrderId, PayTime, SumPrice, Remarks, IsPay); for (int i = 0; i < sd.Count; i++) { DateTime dt = Convert.ToDateTime(sd[i].FTime); int mm = dt.Minute; DateTime NowDt = DateTime.Now; DateTime FTime = NowDt.AddMinutes(mm * sd[i].FNumber); string finish = FTime.ToString(); ScheduleManager.InsertSchedule(TableId, sd[i].OrderId, sd[i].FName, finish, sd[i].FNumber, sd[i].IsPay); } } timer2.Enabled = false; this.Close(); } else { int n = OrderManager.InsertPayInfo(TableId, OrderId, SumPrice, PayTime, Remarks, IsPay); OrderManager.InsertPay(OrderId, PayTime, IsPay); if (n > 0) { Transmit.FrmPay.FrmPay_Load(sender, e); Transmit.FrmPay.lbSumRmb.Text = "0"; List <Schedule> sd = ScheduleManager.selectScheduleValues(); ScheduleManager.DeleteSchedule(); TableManager.UpdateTypebyTableId(3, Transmit.FrmMenu.lbTableId.Text); TableManager.UpdateTableNowInfo(Transmit.FrmMenu.lbTableId.Text, OrderId, PayTime, SumPrice, Remarks, IsPay); for (int i = 0; i < sd.Count; i++) { DateTime dt = Convert.ToDateTime(sd[i].FTime); int mm = dt.Minute; DateTime NowDt = DateTime.Now; DateTime FTime = NowDt.AddMinutes(mm * sd[i].FNumber); string finish = FTime.ToString(); ScheduleManager.InsertSchedule(TableId, sd[i].OrderId, sd[i].FName, finish, sd[i].FNumber, sd[i].IsPay); } } timer2.Enabled = false; this.Close(); } } }
public ActionResult <DtoCreateSchedule> Delete([FromRoute] int id) { var deleted = scheduleManager.DeleteSchedule(id); if (deleted != null) { return(Ok(deleted)); } return(BadRequest()); }
private void FrmFoodMain_FormClosing(object sender, FormClosingEventArgs e) { ScheduleManager.DeleteSchedule(); OrderManager.DeletePay(); TableManager.UpdateTypebyTableId(1, Transmit.FrmMenu.lbTableId.Text); }