public ActionResult ChargeReport(ChargeReportModel model, long id) { try { var user = (ViewUser)Session["user"]; var product = _iServiceManager.GetReceivedServiceProductById(id); ForwardDetails forward = new ForwardDetails { UserId = user.UserId, ForwardDateTime = DateTime.Now, ForwardFromId = product.ForwardedToId, ForwardToId = model.ForwardToId, ReceiveId = model.BatteryReceiveId, ForwardRemarks = model.ForwardRemarks }; if (model.ForwardToId == product.ForwardedToId) { model.ParentId = model.ForwardToId; } model.EntryByUserId = user.UserId; model.ForwardDetails = forward; bool result = _iServiceManager.SaveCharegeReport(model); if (result) { return(RedirectToAction("ProductInChargeSection")); } product.ProductHistory = _iInventoryManager.GetProductHistoryByBarcode(product.Barcode) ?? new ViewProductHistory(); product.ForwardToModels = _iCommonManager.GetAllForwardToModels().ToList(); return(View(product)); } catch (Exception exception) { Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }
//---------------------- Forwarding permission for service battery------------------- public ActionResult AssignForwardPermission() { ViewBag.ActionId = _iCommonManager.GetAllActionList().ToList(); ViewBag.ForwardToId = _iCommonManager.GetAllForwardToModels(); return(View()); }