public ActionResult Save(FormCollection fmdata) { Invoice invoice = new Invoice(); try { invoice.InvoiceNo = Request.Form["InvoiceNo"]; invoice.InvoiceDate = Convert.ToDateTime(Request.Form["InvoiceDate"]); // invoice.ClientID = Request.Form["ClientID"]; invoice.AmountNo = Convert.ToDecimal(Request.Form["AmountNo"]); invoice.AmountText = Request.Form["AmountText"]; // invoice.InvoiceType = Request.Form["InvoiceType"]; invoice.CheckNo = Request.Form["CheckNo"]; invoice.BankName = Request.Form["BankName"]; invoice.ExchangeOfficeName = Request.Form["ExchangeOfficeName"]; invoice.Note = Request.Form["Note"]; if (invoice.ID == 0) { invoiceRepository.Insert(invoice); } else { invoiceRepository.Update(invoice); } return(null);//Json(new { filePath = FileName }, JsonRequestBehavior.DenyGet); } catch (Exception ex) { return(Json("Error occurred. Error details: " + ex.Message)); } }
public int Update(int id, InvoiceUpdateApiModel updated) { return(_InvoiceRespository.Update(id, updated)); }