public ActionResult SaveProductOrServiceType(AnFProductOrServiceType anFProductOrServiceType) { Operation objOperation = new Operation { Success = false }; if (ModelState.IsValid) { if (anFProductOrServiceType.Id == 0) { if ((bool)Session["Add"]) { objOperation = _ccService.SaveAnFProductOrServiceType(anFProductOrServiceType); } else { objOperation.OperationId = -1; } } else { if ((bool)Session["Edit"]) { objOperation = _ccService.UpdateAnFProductOrServiceType(anFProductOrServiceType); } else { objOperation.OperationId = -2; } } } return Json(objOperation, JsonRequestBehavior.DenyGet); }
public Operation DeleteAnFProductOrServiceType(AnFProductOrServiceType objAnFProductOrServiceType) { Operation objOperation = new Operation { Success = true, OperationId = objAnFProductOrServiceType.Id }; _AnFProductOrServiceTypeRepository.Delete(objAnFProductOrServiceType); try { _UnitOfWork.Commit(); } catch (Exception) { objOperation.Success = false; } return objOperation; }
public Operation SaveAnFProductOrServiceType(AnFProductOrServiceType objAnFProductOrServiceType) { Operation objOperation = new Operation { Success = true }; long Id = _AnFProductOrServiceTypeRepository.AddEntity(objAnFProductOrServiceType); objOperation.OperationId = Id; try { _UnitOfWork.Commit(); } catch (Exception ex) { objOperation.Success = false; } return objOperation; }