Пример #1
0
        private string GetLoanDisbursementCode()
        {
            //AFLA2018000001
            int maxLoanId = 1;

            if (db.LoanDisbursements.Count() > 0)
            {
                maxLoanId = db.LoanDisbursements.Max(x => x.LoanDisbursementId) + 1;
            }

            return("AFLD" + DateTime.Now.Year.ToString() + Common.AddAdditionalZero(maxLoanId.ToString()));
        }
Пример #2
0
        private string GetBranchCode()
        {
            //AFLA2018000001
            int maxBranchId = 1;

            if (db.Branches.Count() > 0)
            {
                maxBranchId = db.Branches.Max(x => x.BranchId) + 1;
            }

            return("AFBO" + DateTime.Now.Year.ToString() + Common.AddAdditionalZero(maxBranchId.ToString()));
        }
Пример #3
0
        //
        // GET: /Client/Create

        public ActionResult Create()
        {
            ViewBag.BranchId = new SelectList(db.Branches, "BranchId", "BranchCode");
            ViewBag.GenderId = new SelectList(db.Genders, "GenderId", "Gender1");
            ViewBag.UserId   = new SelectList(db.Users, "Id", "UserName");

            #region Create Client Code
            //AF20180001001
            int maxClientId = 1;
            if (db.Clients.Count() > 0)
            {
                maxClientId = db.Clients.Max(x => x.ClientId) + 1;
            }

            ViewBag.ClientCode = "AFC" + DateTime.Now.Year + Common.AddAdditionalZero(maxClientId.ToString());

            #endregion


            return(View());
        }