public ActionResult Delete(int Id) { var orderDao = new OrderDao(); var result = orderDao.DeleteOrder(Id); if (result) { SetNotification("Xoá Order thành công", "success"); RedirectToAction("Index", "Order"); } else { ModelState.AddModelError("", "Xoá Order không thành công "); } return(View()); }
public ActionResult Delete(int id) { if (Session["UserLogin"] != null) { UserLogin em = (UserLogin)Session["UserLogin"]; AuthorizationDao au = new AuthorizationDao(); if (au.CheckAccess(em.GroupEmployeeID, 12) == true) { OrderDao order_dao = new OrderDao(); order_dao.DeleteOrder(id); return(RedirectToAction("List", new { RequiredPage = 1 })); } else { return(RedirectToAction("Error", "Error")); } } else { return(RedirectToAction("Index", "Login", new { Area = "" })); } }
/// <summary> /// 清除指定批次数据 /// </summary> /// <param name="orderDate"></param> /// <param name="batchNo"></param> public void ClearSchedule(string orderDate, int batchNo) { using (PersistentManager pm = new PersistentManager()) { //AS_BI_BATCH BatchDao batchDao = new BatchDao(); batchDao.UpdateExecuter("0", "0", orderDate, batchNo); batchDao.UpdateIsValid(orderDate, batchNo, "0"); //AS_SC_CHANNELUSED ChannelScheduleDao csDao = new ChannelScheduleDao(); csDao.DeleteSchedule(orderDate, batchNo); //AS_SC_LINE LineScheduleDao lsDao = new LineScheduleDao(); lsDao.DeleteSchedule(orderDate, batchNo); //AS_SC_PALLETMASTER,AS_SC_ORDER OrderScheduleDao osDao = new OrderScheduleDao(); osDao.DeleteSchedule(orderDate, batchNo); //AS_I_ORDERDETAIL,AS_I_ORDERMASTER OrderDao orderDao = new OrderDao(); orderDao.DeleteOrder(orderDate, batchNo); //AS_SC_STOCKMIXCHANNEL StockChannelDao scDao = new StockChannelDao(); scDao.DeleteSchedule(orderDate, batchNo); //AS_SC_SUPPLY SupplyDao supplyDao = new SupplyDao(); supplyDao.DeleteSchedule(orderDate, batchNo); //AS_SC_HANDLESUPPLY HandleSupplyDao handleSupplyDao = new HandleSupplyDao(); handleSupplyDao.DeleteHandleSupply(orderDate, batchNo); } }
/// <summary> /// 删除订单 /// </summary> /// <param name="orderNum"></param> /// <returns></returns> public BaseMessage DeleteOrder(string orderNum) { return(orderDao.DeleteOrder(orderNum)); }
/// <summary> /// 刪除 Order /// </summary> /// <param name="orderID">訂單編號</param> public void DelOrder(int orderID) { OrderDao orderDao = new OrderDao(); orderDao.DeleteOrder(orderID); }