public ActionResult DeleteSupplierQuotation(string quotationNo) { var result = false; string message = string.Empty; try { result = new NetStock.BusinessFactory.QuotationBO().DeleteQuotation(new NetStock.Contract.Quotation { QuotationNo = quotationNo, ModifiedBy = Session["DEFAULTUSER"].ToString() }); TempData["isSaved"] = result; if (result) { TempData["resultMessage"] = string.Format("Supplier Quotation [{0}] Deleted Successfully", quotationNo); } else { TempData["resultMessage"] = "Unable to DELETE the Record!"; } } catch (Exception ex) { TempData["isSaved"] = false; TempData["resultMessage"] = string.Format("Error Occurred {0}", ex.Message.ToString()); ModelState.AddModelError("Error", ex.Message); } return(RedirectToAction("SupplierQuotationList")); }
public ActionResult SearchSupplierQuotation(string quotationNo, string productDescription) { NetStock.Contract.Quotation quotation = null; if (quotationNo == "NEW") { quotation = new Contract.Quotation(); quotation.QuotationDate = quotation.EffectiveDate = quotation.ExpiryDate = DateTime.Now; quotation.QuotationItems = new List <Contract.QuotationItem>(); quotation.Status = true; } else { var quotationBO = new NetStock.BusinessFactory.QuotationBO(); quotation = quotationBO.GetQuotation(new Contract.Quotation { QuotationNo = quotationNo }, productDescription); if (quotation == null) { quotation = new Contract.Quotation(); quotation.QuotationDate = quotation.EffectiveDate = quotation.ExpiryDate = DateTime.Now; quotation.QuotationItems = new List <Contract.QuotationItem>(); } } quotation.CustomersList = Utility.GetCustomerList(true); quotation.ProductsList = Utility.GetProductList(); quotation.CurrencyCodeList = Utility.GetCurrencyItemList(); return(View("SupplierQuotation", quotation)); }
public ActionResult StandardRateProfile(string quotationNo) { var quotation = new NetStock.Contract.Quotation(); quotation.QuotationNo = string.Format("STANDARD_{0}", Session["BranchId"].ToString()); quotation.CustomerCode = "NONE"; quotation.EffectiveDate = DateTime.Today.Date; quotation.ExpiryDate = DateTime.Today.Date; quotation.QuotationDate = DateTime.Today.Date; quotation = new NetStock.BusinessFactory.QuotationBO().GetQuotation(new Contract.Quotation { QuotationNo = string.Format("STANDARD_{0}", Session["BranchId"].ToString()) }); if (quotation == null) { quotation = new NetStock.Contract.Quotation(); quotation.QuotationNo = quotationNo; quotation.CustomerCode = "NONE"; quotation.EffectiveDate = DateTime.Today.Date; quotation.ExpiryDate = DateTime.Today.Date; quotation.QuotationDate = DateTime.Today.Date; quotation.QuotationItems = new List <Contract.QuotationItem>(); } quotation.ProductsList = Utility.GetProductList(); quotation.CurrencyCodeList = Utility.GetCurrencyItemList(); return(View("StandardQuotation", quotation)); }
public ActionResult SupplierQuotationList() { var lstQuotation = new NetStock.BusinessFactory.QuotationBO() .GetList(Convert.ToInt16(Session["BranchId"])) .Where(q => !q.QuotationNo.Contains("STANDARD") && q.QuotationType == Utility.SUPPLIERQUOTATION && q.Status == true).ToList(); return(View("SupplierQuotationList", lstQuotation)); //return View(Customers); }
public ActionResult SaveStandardRateProfile(NetStock.Contract.Quotation quotation) { try { var format = "dd/MM/yyyy"; // your datetime format var dateTimeConverter = new IsoDateTimeConverter { DateTimeFormat = format }; quotation.Status = true; quotation.QuotationNo = string.Format("STANDARD_{0}", Session["BranchId"].ToString()); quotation.CreatedBy = Session["DEFAULTUSER"].ToString(); quotation.ModifiedBy = Session["DEFAULTUSER"].ToString(); quotation.QuotationType = Utility.CUSTOMERQUOTATION; quotation.BranchID = Convert.ToInt16(Session["BranchId"]); //quotation.QuotationItems = quotation.QuotationItems.Where(x => x.RecordStatus != 3).ToList(); var result = new NetStock.BusinessFactory.QuotationBO().SaveQuotation(quotation); TempData["isSaved"] = result; if (result) { TempData["resultMessage"] = "Quotation saved successfully"; } else { TempData["resultMessage"] = "Unable to Save the Record!"; } } catch (Exception ex) { TempData["isSaved"] = false; TempData["resultMessage"] = string.Format("Error Occurred {0}", ex.Message.ToString()); ModelState.AddModelError("Error", ex.Message); } return(RedirectToAction("StandardRateProfile", new { quotationNo = quotation.QuotationNo })); }
public ActionResult SaveCustomerQuotation(NetStock.Contract.Quotation quotation) { var message = string.Empty; var result = false; try { quotation.Status = true; quotation.CreatedBy = Session["DEFAULTUSER"].ToString(); quotation.ModifiedBy = Session["DEFAULTUSER"].ToString(); quotation.QuotationType = Utility.CUSTOMERQUOTATION; quotation.BranchID = Convert.ToInt16(Session["BranchId"]); result = new NetStock.BusinessFactory.QuotationBO().SaveQuotation(quotation); if (result) { message = string.Format("Quotation {0} saved successfully ", quotation.QuotationNo); } else { message = "Unable to Save Quotation"; } TempData["isSaved"] = true; TempData["resultMessage"] = message; } catch (Exception ex) { message = string.Format("Unable to Save Quotation. Error Code : {0} ", ex.Message); TempData["isSaved"] = false; TempData["resultMessage"] = message; } return(RedirectToAction("CustomerQuotationList")); }