Ejemplo n.º 1
0
        public ActionResult Create()
        {
            //DatabaseName = "RetailManagement";
            //CompanyName = "RetailManagement";
            //FinancialYear = "RetailManagement";
            DatabaseName  = "A2ZRetail";
            CompanyName   = "A2ZRetail";
            FinancialYear = "A2ZRetail";
            MainApplication model = new MainApplication()
            {
                companydetails = new Company(),
            };
            string  mssgbox = string.Empty;
            Company company = _companyService.getLastInsertedCompany();
            int     lastid  = 0;
            int     length  = 0;

            if (company != null)
            {
                lastid = company.companyId;
                lastid = lastid + 1;
                length = lastid.ToString().Length;
            }
            else
            {
                lastid = 1;
                length = 1;
            }
            string catCode = _utilityservice.getName("COM", length, lastid);

            model.companydetails.CompanyCode = catCode;
            model.companydetails.StateList   = _stateservice.GetStateByCountry(1);
            var banklist = _compbankservice.getBankDetailsByCompanyCode(catCode);

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            if (banklist.Count() != 0)
            {
                _compbankservice.ExecuteProcedure(catCode);
            }
            return(View(model));
        }