public virtual ActionResult ToggleArchive(long batchId) { LogI("ToggleArchive begin, batchId=" + batchId); var newStatus = OrderBatchViewModel.ToggleBatchArchive(Db, batchId); return(Json(newStatus, JsonRequestBehavior.AllowGet)); }
public virtual ActionResult LockBatch(long batchId) { LogI("LockBatch, batchId=" + batchId); var result = OrderBatchViewModel.LockBatch(Db, BatchManager, batchId, Time.GetAppNowTime()); return(Json(result, JsonRequestBehavior.AllowGet)); }
public virtual ActionResult CreateBatch(CreateBatchViewModel model) { LogI("CreateBatch begin, orderIds=" + model.OrderIds + ", batchName=" + model.BatchName); var result = OrderBatchViewModel.CreateBatch(Db, BatchManager, model.OrderIds, model.BatchName, Time.GetAppNowTime(), AccessManager.UserId); return(Json(result, JsonRequestBehavior.AllowGet)); }
public virtual ActionResult CheckAddOrdersToBatch(CreateBatchViewModel model) { LogI("CheckAddOrdersToBatch begin, orderIds=" + model.OrderIds + ", batchId=" + model.BatchId); var result = OrderBatchViewModel.CheckAddOrdersToBatch(Db, model.OrderIds); return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public virtual ActionResult ActiveBatches(long?batchId) { LogI("ActiveBatches, batchId=" + batchId); var model = new BatchCollection { Batches = OrderBatchViewModel.GetAllForTabs(Db, batchId) }; if (model.Batches.Any() && model.Batches.All(b => !b.Selected)) { model.Batches.First().Selected = true; } return(View(model)); }
//[AcceptVerbs(HttpVerbs.Post)] public virtual ActionResult UpdateBatch([DataSourceRequest] DataSourceRequest request, OrderBatchViewModel batch) { LogI("UpdateBatch begin, batch=" + batch); if (batch != null && ModelState.IsValid) { OrderBatchViewModel.UpdateBatchName(Db, batch.Id, batch.Name, Time.GetAppNowTime(), AccessManager.UserId); } return(Json(new[] { batch }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet)); }
public virtual ActionResult RemoveFromBatch(long batchId, long orderId) { LogI("RemoveFromBatch begin, batchId=" + batchId + ", orderId=" + orderId); var result = OrderBatchViewModel.RemoveFromBatch(Db, LogService, SystemActions, OrderHistoryService, BatchManager, batchId, orderId, AccessManager.UserId); return(Json(result, JsonRequestBehavior.AllowGet)); }
public virtual ActionResult AddOrdersToBatch(CreateBatchViewModel model) { LogI("CreateBatch begin, orderIds=" + model.OrderIds + ", batchId=" + model.BatchId); var result = OrderBatchViewModel.AddOrdersToBatch(Db, OrderHistoryService, model.BatchId, model.OrderIds, Time.GetAppNowTime(), AccessManager.UserId); return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public virtual ActionResult RemoveMultipleFromBatch(long batchId, string orderIds, long?toBatchId, bool?removeOnHold) { LogI("RemoveMultipleFromBatch begin, batchId=" + batchId + ", orderIds=" + orderIds); var result = OrderBatchViewModel.RemoveMultipleFromBatch(Db, LogService, SystemActions, OrderHistoryService, BatchManager, batchId, orderIds, toBatchId, removeOnHold); return(Json(result, JsonRequestBehavior.AllowGet)); }
public virtual ActionResult GetBatches([DataSourceRequest] DataSourceRequest request, bool?showArchive) { LogI("GetBatches begin, showArchive=" + showArchive); try { var items = OrderBatchViewModel.GetAll(Db.OrderBatches, showArchive ?? false); var dataSource = items.ToDataSourceResult(request); return(new JsonResult { Data = dataSource, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { LogE("GetBatches begin", ex); return(new JsonResult { Data = new List <OrderBatchViewModel>(), JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } }