public ActionResult ModifyInvoiceContent([DataSourceRequest] DataSourceRequest request, ConfigInvoiceContentModel model) { if (model != null && ModelState.IsValid) { var service = new ConfigInvoiceContentSevice(); var cost = DataTransfer.Transfer<Config_Invoice_Content>( model, typeof(ConfigInvoiceContentModel)); service.Modify(cost); } return Json(new[] { model }.ToDataSourceResult(request, ModelState)); }
public ActionResult AddInvoiceContent([DataSourceRequest] DataSourceRequest request, ConfigInvoiceContentModel model) { try { if (model != null) { var service = new ConfigInvoiceContentSevice(); var invoice = DataTransfer.Transfer<Config_Invoice_Content>( model, typeof(ConfigInvoiceContentModel)); model.ID = service.Add(invoice); } return Json(new[] { model }.ToDataSourceResult(request, ModelState)); } catch { return View(); } }