public BankDTO CreateBank(BankDTO bank)
        {
            BankDTO dto = _service.CreateBank(bank.Name).ToDTO();

            _service.Save();
            return(dto);
        }
Ejemplo n.º 2
0
        public ActionResult Create(BankEditModel bankEditModel, HttpPostedFileBase UploadImage)
        {
            PopulateDropDownLists(bankEditModel);

            if (ModelState.IsValid)
            {
                bankEditModel.DisplayIconFlags = DisplayIcon.DisplayUploader;

                var upload = false;
                if (string.IsNullOrEmpty(bankEditModel.IconPath))
                {
                    upload = true;
                }
                else if (UploadImage != null)
                {
                    bankEditModel.DisplayIconFlags = DisplayIcon.DisplayUploader | DisplayIcon.DisplayExistingIcon | DisplayIcon.DisplayIconPathPreview;
                    upload = true;
                }

                if (upload)
                {
                    bankEditModel.IconPath = FileUpload.UploadFileToServer(UploadImage, "IconPath", Config.BankIconBasePath, Config.BankIconMaxSize, Config.BankIconAllowedExtensions);
                }

                bankEditModel.DisplayIconFlags = DisplayIcon.DisplayExistingIcon | DisplayIcon.DisplayIconPathPreview;

                _bankService.CreateBank(bankEditModel);

                return(RedirectToAction("Index"));
            }
            return(View(bankEditModel));
        }
Ejemplo n.º 3
0
        public IActionResult Create(CreateBankViewModel model)
        {
            validationService.ValidateBankCreating(model, ModelState);
            if (ModelState.IsValid)
            {
                BankInfo bankInfo = bankService.CreateBankInfo(model);
                bankService.CreateBank(model, bankInfo);

                return(RedirectToAction("Index", "Bank"));
            }
            else
            {
                return(View(model));
            }
        }
Ejemplo n.º 4
0
        public ActionResult Create([ModelBinder(typeof(BankCustomBinder))] BankMaster bankmaster)
        {
            //insert bank name in bank names
            BankName bank = new BankName();

            bank.bankName = bankmaster.bankName;
            _bankNameService.CreateBankName(bank);

            if (bankmaster.MICRCode == "")
            {
                bankmaster.MICRCode = null;
            }

            _bankService.CreateBank(bankmaster);
            var bankdata = _bankService.getLastInsertedBank();
            var BankId   = Encode(bankdata.bankId.ToString());

            return(RedirectToAction("CreateDetails/" + BankId, "Bank"));
        }
Ejemplo n.º 5
0
        public ActionResult ReplicateTheValues()
        {
            string procname = "TruncateTable";

            _CompanyService.TruncateTable(procname);

            //Replicate The Bank Master Values
            var BankMasters = TempData["BankMasters"] as IEnumerable <BankMaster>;

            foreach (var Bank in BankMasters)
            {
                Bank.modifiedon = DateTime.Now;
                _BankService.CreateBank(Bank);
            }

            //Replicate The Client Master Values
            var ClientMasters = TempData["ClientMasters"] as IEnumerable <ClientMaster>;

            foreach (var Client in ClientMasters)
            {
                Client.ModifiedOn = DateTime.Now;
                _ClientMasterService.CreateClient(Client);
            }

            //Replicate The Client Bank Values
            var ClientBanks = TempData["ClientBanks"] as IEnumerable <ClientBankDetail>;

            foreach (var Bank in ClientBanks)
            {
                Bank.ModifiedOn = DateTime.Now;
                _ClientBankDetailService.CreateBankDetails(Bank);
            }

            //Replicate The Designation Master Values
            var DesignationMasters = TempData["DesignationMasters"] as IEnumerable <DesignationMaster>;

            foreach (var Designation in DesignationMasters)
            {
                Designation.ModifiedOn = DateTime.Now;
                _DesignationMasterService.Create(Designation);
            }

            //Replicate The Design Master Values
            var DesignMasters = TempData["DesignMasters"] as IEnumerable <DesignMaster>;

            foreach (var Design in DesignMasters)
            {
                Design.ModifiedOn = DateTime.Now;
                _DesignService.CreateDesign(Design);
            }

            //Replicate The Brand Master Values
            var BrandMasters = TempData["BrandMasters"] as IEnumerable <BrandMaster>;

            foreach (var Brand in BrandMasters)
            {
                Brand.ModifiedOn = DateTime.Now;
                _BrandMasterService.Create(Brand);
            }

            //Replicate The Employee Master Values
            var EmployeeMasters = TempData["EmployeeMasters"] as IEnumerable <EmployeeMaster>;

            foreach (var Employee in EmployeeMasters)
            {
                Employee.ModifiedOn = DateTime.Now;
                _EmployeeMasterService.CreateEmployee(Employee);
            }

            //Replicate The Godown Master Values
            var GodownMasters = TempData["GodownMasters"] as IEnumerable <GodownMaster>;

            foreach (var Godown in GodownMasters)
            {
                Godown.ModifiedOn = DateTime.Now;
                _GodownService.CreateGodown(Godown);
            }

            //Replicate The Godown Address Values
            var GodownAddresses = TempData["GodownAddresses"] as IEnumerable <GodownAddress>;

            foreach (var Address in GodownAddresses)
            {
                _GodownAddressService.CreateGoDown(Address);
            }

            //Replicate The Item Category Values
            var ItemCategory = TempData["ItemCategory"] as IEnumerable <ItemCategory>;

            foreach (var Category in ItemCategory)
            {
                Category.ModifiedOn = DateTime.Now;
                _ItemCategoryService.CreateItemCatgory(Category);
            }

            //Replicate The Item SubCategory Values
            var ItemSubCategory = TempData["ItemSubCategory"] as IEnumerable <ItemSubCategory>;

            foreach (var SubCategory in ItemSubCategory)
            {
                SubCategory.ModifiedOn = DateTime.Now;
                _ItemSubCategoryService.CreateItemCatgory(SubCategory);
            }

            //Replicate The Item Master Values
            var ItemMasters = TempData["ItemMasters"] as IEnumerable <Item>;

            foreach (var Item in ItemMasters)
            {
                Item.modifedOn = DateTime.Now;
                _ItemService.createItem(Item);
            }

            //Replicate The Non Inventory Item Values
            var NonInventoryItems = TempData["NonInventoryItems"] as IEnumerable <NonInventoryItem>;

            foreach (var NonInventoryItem in NonInventoryItems)
            {
                NonInventoryItem.modifedOn = DateTime.Now;
                _NonInventoryItemService.createNonInventoryItem(NonInventoryItem);
            }

            //Replicate The Barcode Numbers Values
            var Barcodes = TempData["BarcodeNumbers"] as IEnumerable <BarcodeNumber>;

            foreach (var Barcode in Barcodes)
            {
                _BarcodeNumberService.CreateBarcode(Barcode);
            }

            //Replicate The Job Worker Values
            var JobWorkers = TempData["JobWorkers"] as IEnumerable <JobWorker>;

            foreach (var JobWorker in JobWorkers)
            {
                JobWorker.ModifiedOn = DateTime.Now;
                _JobWorkerService.Create(JobWorker);
            }

            //Replicate The Job Worker Type Values
            var JobWorkerTypes = TempData["JobWorkerTypes"] as IEnumerable <JobWorkType>;

            foreach (var JobWorkerType in JobWorkerTypes)
            {
                JobWorkerType.ModifiedOn = DateTime.Now;
                _JobWorkTypeService.Create(JobWorkerType);
            }

            ////Replicate The Sales Incentives Values
            //var SalesIncentives = TempData["SalesIncentives"] as IEnumerable<SalesIncentiveMaster>;
            //foreach (var SalesIncentive in SalesIncentives)
            //{
            //    SalesIncentive.ModifiedOn = DateTime.Now;
            //    _SalesIncentiveService.CreateSI(SalesIncentive);
            //}

            //Replicate The Shop Master Values
            var ShopMasters = TempData["ShopMasters"] as IEnumerable <ShopMaster>;

            foreach (var Shop in ShopMasters)
            {
                Shop.ModifiedOn = DateTime.Now;
                _ShopService.Create(Shop);
            }

            //Replicate The Type Of Material Values
            var TypeOfMaterials = TempData["TypeOfMaterials"] as IEnumerable <TypeOfMaterial>;

            foreach (var Material in TypeOfMaterials)
            {
                Material.ModifiedOn = DateTime.Now;
                _TypeOfMaterialService.AddTypeOfMaterial(Material);
            }

            //Replicate The Unit Master Values
            var UnitMasters = TempData["UnitMasters"] as IEnumerable <UnitMaster>;

            foreach (var Unit in UnitMasters)
            {
                Unit.modifiedOn = DateTime.Now;
                _UnitService.createunit(Unit);
            }

            //Replicate The Supplier Master Values
            var SupplierMasters = TempData["SupplierMasters"] as IEnumerable <SupplierMaster>;

            foreach (var Supplier in SupplierMasters)
            {
                Supplier.ModifiedOn = DateTime.Now;
                _SuppliersMasterService.CreateSupplier(Supplier);
            }

            //Replicate The Supplier Bank Values
            var SupplierBanks = TempData["SupplierBanks"] as IEnumerable <SupplierBankDetail>;

            foreach (var Bank in SupplierBanks)
            {
                Bank.ModifiedOn = DateTime.Now;
                _SupplierBankDetailService.CreateBankDetails(Bank);
            }

            //Replicate The Transport Master Values
            var TransportMasters = TempData["TransportMasters"] as IEnumerable <TransportMaster>;

            foreach (var Transport in TransportMasters)
            {
                Transport.ModifiedOn = DateTime.Now;
                _TransportService.CreateTransport(Transport);
            }

            //Replicate The Tranport Bank Values
            var TransportBanks = TempData["TransportBanks"] as IEnumerable <TransportBankDetail>;

            foreach (var Bank in TransportBanks)
            {
                Bank.ModifiedOn = DateTime.Now;
                _TransportBankDetailService.CreateBankDetails(Bank);
            }

            //Replicate The User Values
            var Users = TempData["Users"] as IEnumerable <User>;

            foreach (var User in Users)
            {
                User.ModifiedBy = DateTime.Now;
                _UserService.CreateUser(User);
            }

            //Replicate The Commission Master Values
            var CommissionMasters = TempData["CommissionMasters"] as IEnumerable <CommissionMaster>;

            foreach (var Commission in CommissionMasters)
            {
                Commission.ModifiedOn = DateTime.Now;
                _CommissionService.Create(Commission);
            }

            //Replicate The Module Values
            var Modules = TempData["Modules"] as IEnumerable <Module>;

            foreach (var module in Modules)
            {
                _ModuleService.CreateModule(module);
            }

            //Replicate The UserCredential Values
            var UserCredentials = TempData["UserCredentials"] as IEnumerable <UserCredential>;

            foreach (var usercredential in UserCredentials)
            {
                _UserCredentialService.CreateUserCredential(usercredential);
            }

            //Replicate The Employee Company Values
            var EmployeeCompanies = TempData["EmployeeCompanies"] as IEnumerable <EmployeesCompany>;

            foreach (var EmpComp in EmployeeCompanies)
            {
                _EmployeesCompanyService.Create(EmpComp);
            }

            //CompanyCode = "RetailManagement";
            //CompanyName = "RetailManagement";
            //DatabaseName = "RetailManagement";
            CompanyCode  = "A2ZRetail";
            CompanyName  = "A2ZRetail";
            DatabaseName = "A2ZRetail";
            return(RedirectToAction("ReplicationDone"));
        }
 public ActionResult <Bank> Post(Bank bank)
 {
     return(new JsonResult(_bankService.CreateBank(bank)));
 }
Ejemplo n.º 7
0
 public void Post([FromBody] BankDetails createdObj)
 {
     _BankService.CreateBank(createdObj);
 }
Ejemplo n.º 8
0
        public ActionResult <Bank> CreateBank(Bank bank)
        {
            var newBank = _bankService.CreateBank(bank);

            return(newBank);
        }