public Operation Delete(AnFAdjustment objadjustment) { Operation objOperation = new Operation { Success = true, Message = "Deleted successfully." }; _AnfAdvanceAdjustmentRepository.Delete(objadjustment); try { _UnitOfWork.Commit(); } catch (Exception) { objOperation.Success = false; objOperation.Message = "Delete not successful."; } return objOperation; }
public ActionResult SaveAdjustment(AnFAdjustment adjustmentEntry) { int companyId = Convert.ToInt32(Session["companyId"]); int userid = Convert.ToInt32(Session["userId"]); int financialYearId = Convert.ToInt32(Session["financialYear"]); Operation objOperation = new Operation(); if (ModelState.IsValid) { if (adjustmentEntry.Id == 0) { if ((bool)Session["Add"]) { adjustmentEntry.SecCompanyId = companyId; adjustmentEntry.CmnFinancialYearId = financialYearId; adjustmentEntry.CreatedBy = userid; adjustmentEntry.CreatedDate = DateTime.Now.Date; objOperation = _advancetAdjustmentService.Save(adjustmentEntry); } else { objOperation.OperationId = -2; objOperation.Success = false; } } else { if ((bool)Session["Edit"]) { adjustmentEntry.SecCompanyId = companyId; adjustmentEntry.CmnFinancialYearId = financialYearId; adjustmentEntry.ModifiedBy = userid; adjustmentEntry.ModifiedDate = DateTime.Now.Date; objOperation = _advancetAdjustmentService.Update(adjustmentEntry); } else { objOperation.OperationId = -2; objOperation.Success = false; } } } return Json(objOperation, JsonRequestBehavior.DenyGet); }
public Operation Save(AnFAdjustment objadjustment) { Operation objOperation = new Operation { Success = true, Message = "Saved successfully." }; int Id = _AnfAdvanceAdjustmentRepository.AddEntity(objadjustment); objOperation.OperationId = Id; try { _UnitOfWork.Commit(); } catch (Exception ex) { objOperation.Success = false; objOperation.Message = "Save not successful."; } return objOperation; }