public bool UpdateFinalcialSetting(FinancialSetting finalcialSetting)
        {
            try
            {
                var dbObj = _finalCrudOperation
                    .GetSingleObject(finalcialSetting.Id);
                dbObj.FoundedYear = finalcialSetting.FoundedYear;
                dbObj.FinalcialPeriod = finalcialSetting.FinalcialPeriod;
                dbObj.CurrencyId = finalcialSetting.CurrencyId;
                dbObj.SharesCurrencyId = finalcialSetting.SharesCurrencyId;
                dbObj.StartingDate = finalcialSetting.StartingDate;
                dbObj.EndingDate = finalcialSetting.EndingDate;
                dbObj.PeriodLockDate = finalcialSetting.PeriodLockDate;
                dbObj.YearLockDate = finalcialSetting.YearLockDate;
                dbObj.SharePrice = finalcialSetting.SharePrice;

                dbObj.State = ObjectState.Modified;
                _finalCrudOperation.UpdateOperation(dbObj);

                return true;
            }
            catch (Exception ex)
            {
                var errorMsg = ex.Message;
                return false;
            }
        }
        public ActionResult Create(FinancialSetting fs)
        {
            var user = uService.GetSingleUserByEmail(HttpContext.User.Identity.Name);
            var AccSet = sService.GetAllByUserId(user.Id);

            var logObj = _companyViewLog.GetLastViewCompanyByUserId(user.Id);
            int companyId = 0;
            if (logObj != null)
            {
                companyId = (int)logObj.CompanyId;
            }
            fs.CompanyId = companyId;
            fs.IsActive = true;
            if (fService.AddFinalcialSetting(fs))
            {
                if (logObj.Companies.CompleteFlag == 1)
                {
                    int flag = 2;
                    comService.UpdateCompleteFlag(companyId, flag);
                    return RedirectToAction("Create", "Invitations", new { Area = "NotificationManagement" });
                }
                TempData.Add("errMsg","Successfully created Financial Settings..");
                return RedirectToAction("MyMhasb", "Users", new { Area = "UserManagement" });
            }
            else
            {
                TempData.Add("errMsg", "Error in creating Financial Settings!!!");
                return RedirectToAction("Create");
            }
        }
        public bool AddFinalcialSetting(FinancialSetting finalcialSetting)
        {
            try
            {
                finalcialSetting.State = ObjectState.Added;
                _finalCrudOperation.AddOperation(finalcialSetting);

                return true;
            }
            catch (Exception ex)
            {

                var errorMsg = ex.Message;
                return false;
            }
        }
 public ActionResult Edit(FinancialSetting fs)
 {
     fs.IsActive = true;
     fService.UpdateFinalcialSetting(fs);
     //return RedirectToAction("MyMhasb", "Users", new { Area = "UserManagement" });
     return RedirectToAction("Index", "FinalcialSetting", new { Area = "OrgSettings" ,id=fs.Id});
 }