示例#1
0
        public bool AddSubSubAccount(SubSubAccount account)
        {
            int maxAccountNo = _iAccountGateway.GetMaxSubSubAccountNoBySubAccountCode(account.SubAccountCode);

            account.SubSubAccountCode = account.SubAccountCode + (maxAccountNo + 1);
            int rowAffected = _iAccountGateway.AddSubSubAccount(account);

            return(rowAffected > 0);
        }
 public ActionResult AddSubSubAccount(SubSubAccount account)
 {
     try
     {
         var user = (ViewUser)Session["user"];
         account.UserId = user.UserId;
         bool result = _iAccountsManager.AddSubSubAccount(account);
         if (result)
         {
             return(RedirectToAction("SubSubAccountList"));
         }
         List <AccountHead> accountHeads = _iAccountsManager.GetAllChartOfAccountList().ToList();
         ViewBag.AccountHeadCode   = new SelectList(accountHeads, "AccountHeadCode", "AccountHeadName");
         ViewBag.SubAccountCode    = new SelectList(new List <SubAccount>(), "SubAccountCode", "SubAccountName");
         ViewBag.SubSubAccountCode = new SelectList(new List <SubSubAccount>(), "SubSubAccountCode", "SubSubAccountName");
         return(View());
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }