Ejemplo n.º 1
0
        public ActionResult CreateOrganization()
        {
            var organizationDto   = new OrganizationDto();
            var organizationModel = new OrganizationModel();

            organizationDto = _organizationService.GetAll();

            SelectList    banks       = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_NAME);
            SelectList    accountType = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_ACCOUNT_TYPE);
            BankMasterDal bankService = new BankMasterDal();
            List <BankMasterLookupDto> lstBankMasterLookupDto = bankService.GetLookup(null);

            lstBankMasterLookupDto = lstBankMasterLookupDto.FindAll(l => !l.IsBankAlreadyConsumed);
            OrganizationService  org    = new OrganizationService();
            List <BankMasterDto> lstobj = org.OrganizationGetAllBanksDetails();

            ViewBag.Banks = lstobj;

            //if (Id > 0)
            //{
            //    List<BankMasterDto> lstModel = _bankService.BanksGetByObjectId(Id);
            //    ViewBag.BankDetails = lstModel;
            //}
            ViewBag.ExistedBanks = lstBankMasterLookupDto;
            ViewBag.accountType  = accountType;
            ViewBag.bankNames    = banks;

            if (organizationDto != null && organizationDto.OrgID > 0)
            {
                organizationModel = Mapper.Map <OrganizationDto, OrganizationModel>(organizationDto);
            }

            ViewBag.Result = new ResultDto();
            return(View(organizationModel));
        }
Ejemplo n.º 2
0
        public ActionResult BankMasterLookup()
        {
            int?          groupId        = null;
            BankMasterDal _bankmasterdal = new BankMasterDal();
            bool          isGroup        = GroupInfo != null && GroupInfo.GroupID > 1;

            if (isGroup)
            {
                groupId = GroupInfo.GroupID;
            }
            List <BankMasterLookupDto> bankMasterLookups = _bankmasterdal.GetLookup(groupId);

            ViewBag.isGroup = isGroup;
            return(View("BankLookup", bankMasterLookups));
        }
Ejemplo n.º 3
0
        public ActionResult CreateOrganization(OrganizationModel organizationModel, FormCollection form)
        {
            var resultDto = new ResultDto();

            SelectList    banks       = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_NAME);
            SelectList    accountType = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_ACCOUNT_TYPE);
            BankMasterDal bankservice = new BankMasterDal();
            List <BankMasterLookupDto> lstBankMasterLookupDto = bankservice.GetLookup(null);

            ViewBag.ExistedBanks = lstBankMasterLookupDto;
            ViewBag.accountType  = accountType;
            ViewBag.bankNames    = banks;

            var organizationDto = Mapper.Map <OrganizationModel, OrganizationDto>(organizationModel);

            organizationDto.UserID = UserInfo.UserID;

            if (organizationDto.OrgID == 0)
            {
                resultDto = _organizationService.Insert(organizationDto);
            }
            else
            {
                resultDto = _organizationService.Update(organizationDto);
            }

            if (resultDto.ObjectId > 0)
            {
                organizationDto      = _organizationService.GetAll();
                organizationModel    = Mapper.Map <OrganizationDto, OrganizationModel>(organizationDto);
                resultDto.ObjectCode = organizationDto.OrgCode;

                List <BankMasterDto> lstBanks = GetBanksList(form);
                int OrgID = resultDto.ObjectId;
                resultDto         = _commonService.InsertBankDetails(OrgID, Enums.EntityCodes.ORG, UserInfo.UserID, lstBanks);
                resultDto.Message = resultDto.ObjectId > 0 ? "Organization bank details saved successfully for orgnization code :" + organizationModel.OrgCode : resultDto.Message;
            }

            ViewBag.Result = resultDto;
            ModelState.Clear();
            return(View(organizationModel));
        }
Ejemplo n.º 4
0
        public ActionResult CreateGroupBankDetails(int Id)
        {
            SelectList    banks       = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_NAME);
            SelectList    branches    = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_NAME);
            SelectList    accountType = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_ACCOUNT_TYPE);
            BankMasterDal bankservice = new BankMasterDal();
            List <BankMasterLookupDto> lstBankMasterLookupDto = bankservice.GetLookup(null);

            lstBankMasterLookupDto = lstBankMasterLookupDto.FindAll(l => !l.IsBankAlreadyConsumed);

            // var villages = _dbContext.vi
            // ViewBag.Clusters = (SelectList) clusters;

            if (Id > 0)
            {
                List <BankMasterDto> lstModel = _bankService.BanksGetByObjectId(Id);
                ViewBag.BankDetails = lstModel;
            }
            ViewBag.ExistedBanks = lstBankMasterLookupDto;
            ViewBag.accountType  = accountType;
            ViewBag.bankNames    = banks;
            ViewBag.branches     = branches;
            return(View());
        }
Ejemplo n.º 5
0
        public List <BankMasterDto> GetGroupBanks(int groupID)
        {
            BankMasterDal obj = new BankMasterDal();

            return(obj.GetGroupBanks(groupID));
        }