public ActionResult Edit(long id) { try { ViewReplaceModel model = _iProductReplaceManager.GetReplaceById(id); return(View(model)); } catch (Exception exception) { Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }
public ActionResult UpdateCliaimedBatteryDeliveryStatus(long id) { try { ViewReplaceModel model = _iProductReplaceManager.GetReplaceById(id); List <ViewReplaceDetailsModel> products = _iProductReplaceManager.GetReplaceProductListById(id).ToList(); model.Products = products; return(View(model)); } catch (Exception exception) { Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }
public ActionResult Delivery(FormCollection collection) { try { int branchId = Convert.ToInt32(Session["BranchId"]); var transport = collection["ownTransport"]; bool isOwnTransport = transport != null; int deliverebyUserId = ((ViewUser)Session["user"]).UserId; int receiveId = Convert.ToInt32(collection["ReceiveId"]); var replace = _iProductReplaceManager.GetReplaceById(receiveId); var received = _iServiceManager.GetDeliverableServiceProductById(receiveId); received.CompanyId = Convert.ToInt32(Session["CompanyId"]); var filePath = GetTempReplaceProductXmlFilePath(receiveId); //if the file is exists read the file var barcodeList = _iProductManager.GetScannedProductListFromTextFile(filePath).ToList(); var aDelivery = new Delivery { IsOwnTransport = isOwnTransport, TransactionRef = received.ReceiveRef, InvoiceRef = received.ReceiveRef, DeliveredByUserId = deliverebyUserId, Transportation = collection["Transportation"], DriverName = collection["DriverName"], DriverPhone = collection["DriverPhone"], TransportationCost = Convert.ToDecimal(collection["TransportationCost"]), VehicleNo = collection["VehicleNo"], DeliveryDate = Convert.ToDateTime(collection["DeliveryDate"]).Date, CompanyId = received.CompanyId, ToBranchId = received.BranchId, DistributionPointId = branchId, InvoiceId = received.ReceiveId, FromBranchId = received.BranchId }; string result = _iInventoryManager.SaveReplaceDeliveryInfo(barcodeList, aDelivery, 2, replace); if (result.StartsWith("S")) { System.IO.File.Create(filePath).Close(); return(RedirectToAction("WarrantyReplaceList")); } return(View()); } catch (Exception exception) { TempData["Error"] = exception.Message; Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }
public ActionResult Delivery(long id) { try { var stock = _iInventoryManager.GetStockProductInFactory(); Session["Factory_stock12"] = stock; ViewReplaceModel model = _iProductReplaceManager.GetReplaceById(id); List <ViewReplaceDetailsModel> products = _iProductReplaceManager.GetReplaceProductListById(id).ToList(); model.Products = products; return(View(model)); } catch (Exception exception) { Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }