public ActionResult SaveProductOrServiceTax(AnFProductOrServiceTax anFProductOrServiceTax) { Operation objOperation = new Operation { Success = false }; if (ModelState.IsValid) { if (anFProductOrServiceTax.Id == 0) { if ((bool)Session["Add"]) { objOperation = _ccService.SaveAnFProductOrServiceTax(anFProductOrServiceTax); } else { objOperation.OperationId = -1; } } else { if ((bool)Session["Edit"]) { objOperation = _ccService.UpdateAnFProductOrServiceTax(anFProductOrServiceTax); } else { objOperation.OperationId = -2; } } } return Json(objOperation, JsonRequestBehavior.DenyGet); }
public Operation DeleteAnFProductOrServiceTax(AnFProductOrServiceTax objAnFProductOrServiceTax) { Operation objOperation = new Operation { Success = true, OperationId = objAnFProductOrServiceTax.Id }; _AnFProductOrServiceTaxRepository.Delete(objAnFProductOrServiceTax); try { _UnitOfWork.Commit(); } catch (Exception) { objOperation.Success = false; } return objOperation; }
public Operation SaveAnFProductOrServiceTax(AnFProductOrServiceTax objAnFProductOrServiceTax) { Operation objOperation = new Operation { Success = true }; long Id = _AnFProductOrServiceTaxRepository.AddEntity(objAnFProductOrServiceTax); objOperation.OperationId = Id; try { _UnitOfWork.Commit(); } catch (Exception ex) { objOperation.Success = false; } return objOperation; }