public Operation Delete(CmnFinancialYear objCmnFinancialYear)
        {
            Operation objOperation = new Operation { Success = true, Message = "Deleted successfully." };
            _cmnFinYearRepository.Delete(objCmnFinancialYear);

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception)
            {

                objOperation.Success = false;
                objOperation.Message = "Delete not successful.";
            }
            return objOperation;
        }
 //public int InsertCmnFinantialYear(CmnFinancialYear fy)
 //{
 //    int companyId = Convert.ToInt32(Session["companyId"].ToString());
 //    fy.CmnCompanyId = companyId;
 //    fy.YearClosingStatus = true;
 //    int ret = 0;
 //    if (fy != null)
 //    {
 //        _fyService.Add(fy);
 //        _fyService.Save();
 //    }
 //    return ret;
 //}
 public ActionResult Save(CmnFinancialYear fy)
 {
     int companyId = Convert.ToInt32(Session["companyId"]);
     int userid = Convert.ToInt32(Session["userId"]);
     int moduleId = Convert.ToInt32(Session["moduleId"]);
     fy.CmnCompanyId = companyId;
     Operation objOperation = new Operation();
     if (ModelState.IsValid)
     {
         if (fy.Id == 0)
         {
             if ((bool)Session["Add"])
             {
                 fy.SecModuleId = moduleId;
                 fy.CreatedBy = userid;   //Add by Bably
                 fy.CreatedDate = DateTime.Now.Date; //Add by Bably
                 objOperation = _fyService.Save(fy);
             }
             else
             {
                 objOperation.OperationId = -2;
                 objOperation.Success = false;
             }
         }
         else
         {
             if ((bool)Session["Edit"])
             {
                 fy.ModifiedBy = userid;  //Add by Bably
                 fy.ModifiedDate = DateTime.Now.Date;  //Add by Bably
                 objOperation = _fyService.Update(fy);
             }
             else
             {
                 objOperation.OperationId = -2;
                 objOperation.Success = false;
             }
         }
     }
     return Json(objOperation, JsonRequestBehavior.DenyGet);
 }
        public int Delete(CmnFinancialYear fy)
        {
            int ret = 0;
            if (fy != null)
            {
                _fyService.Delete(fy);

            }

            return ret;
        }
 public void Add(CmnFinancialYear fy)
 {
     _cmnFinYearRepository.AddEntity(fy);
 }
        public Operation Save(CmnFinancialYear objCmnFinancialYear)
        {
            Operation objOperation = new Operation { Success = true,Message="Saved successfully." };

            long Id = _cmnFinYearRepository.AddEntity(objCmnFinancialYear);
            objOperation.OperationId = Id;

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception ex)
            {
                objOperation.Success = false;
                objOperation.Message = "Save not successful.";
            }
            return objOperation;
        }