Пример #1
0
 public bool SaveBankMaster(BankMasterModel model)
 {
     try
     {
         if (model != null)
         {
             BankMaster BM = new BankMaster();
             BM.id          = 111;
             BM.Bank_Name   = model.Bank_Name;
             BM.IFSC_code   = model.IFSC_code;
             BM.Bank_Branch = model.Bank_Branch;
             BM.Address     = model.Address;
             BM.state       = model.state;
             BM.city        = model.city;
             BM.Contact     = model.Contact;
             BM.DOC         = DateTime.Now;
             BM.DOM         = DateTime.Now;
             BM.IsActive    = true;
             _tRSEntities.BankMasters.Add(BM);
             _tRSEntities.SaveChanges();
             return(true);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
     return(true);
 }
Пример #2
0
 public ActionResult EditPartial(BankMaster bnk)
 {
     bnk.status     = "Active";
     bnk.modifiedon = DateTime.Now;
     _bankService.UpdateBank(bnk);
     return(RedirectToAction("UpdateDetails/" + bnk.bankId, "Bank"));
 }
Пример #3
0
        private void doTransaction(object sender, EventArgs e)
        {
            name = _bankingMDIFormApp._loginName;
            BankMaster bms = new BankMaster(connectionString);

            if (radBtnDeposite.Checked)
            {
                _type  = "D";
                status = bms.performDeposite(name, _type, float.Parse(txtAmount.Text));
                if (status)
                {
                    MessageBox.Show("Amount Deposited Successfully");
                }
                else
                {
                    MessageBox.Show("Something Went wrong");
                }
            }
            if (radBtnWithdraw.Checked)
            {
                _type  = "W";
                status = bms.performWithdraw(name, _type, float.Parse(txtAmount.Text));
                if (status)
                {
                    MessageBox.Show("Amount Withdrawal Successfully");
                }
                else
                {
                    MessageBox.Show("Something Went wrong");
                }
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            BankMaster bankMaster = db.BankMasters.Find(id);

            db.BankMasters.Remove(bankMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "CustomerId,BankId,BankName,BankTypeId,CreatedDate,IsDeleted")] BankMaster bankMaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bankMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bankMaster));
 }
Пример #6
0
        public BankMaster EditBankMaster(BankMaster bankMaster)
        {
            try{
                _context.BankMasters.Update(bankMaster);
                _context.SaveChanges();

                return(bankMaster);
            }
            catch (Exception) {}
            return(null);
        }
        public ActionResult Create([Bind(Include = "CustomerId,BankId,BankName,BankTypeId,CreatedDate,IsDeleted")] BankMaster bankMaster)
        {
            if (ModelState.IsValid)
            {
                db.BankMasters.Add(bankMaster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(bankMaster));
        }
Пример #8
0
        public async Task <BankMaster> CreateBankMaster(BankMaster bankMaster)
        {
            try{
                await _context.BankMasters.AddAsync(bankMaster);

                await _context.SaveChangesAsync();

                return(bankMaster);
            }
            catch (Exception) {}
            return(null);
        }
Пример #9
0
        private void tabName(object sender, EventArgs e)
        {
            BankMaster bms = new BankMaster(connectionString);

            if (bms.checkUser(txtName.Text))
            {
                MessageBox.Show("User Already Registered Pls Login");
                btnRegister.Visible = false;
                return;
            }
            btnRegister.Visible = true;
        }
Пример #10
0
        public IActionResult EditBank([FromBody] BankMaster bankMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var editedBank = _repository.EditBankMaster(bankMaster);

            if (editedBank == null)
            {
                return(BadRequest("Failed to save the bank"));
            }
            return(Ok(editedBank));
        }
        // GET: BankMasters/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BankMaster bankMaster = db.BankMasters.Find(id);

            if (bankMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(bankMaster));
        }
Пример #12
0
        public async Task <IActionResult> CreateBank([FromBody] BankMaster bankMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var savedBank = await _repository.CreateBankMaster(bankMaster);

            if (savedBank == null)
            {
                return(BadRequest("Failed to save the bank"));
            }
            return(Ok(bankMaster));
        }
Пример #13
0
        public static List <BankMaster> FetchBankMasterByZoneKey(BankMaster bankmaster)
        {
            OracleParameterCollection param = new OracleParameterCollection();

            param.Add(new OracleParameter(Common.CMS_SP_INSERT_RESULT_MST.E_KEY, bankmaster.KEY));
            param.Add(new OracleParameter(Common.CMS_SP_INSERT_RESULT_MST.P_OUTTBL, OracleType.Cursor));
            param[Common.CMS_SP_INSERT_RESULT_MST.P_OUTTBL].Direction = ParameterDirection.Output;
            OracleParameter[] Oraparam = new OracleParameter[param.Count];
            param.CopyTo(Oraparam, 0);
            param.Clear();
            var liBankMaster = (List <BankMaster>)OracleHelper.FetchData <BankMaster>(Oraparam, Common.Queries.CMS_SP_GET_BANKZONREG_MST, EnumCommand.DataSource.list).DataSource.Data;

            return(liBankMaster);
        }
Пример #14
0
        public static List <BankMaster> FetchBankMasterBankType(BankMaster objBankdet)
        {
            OracleParameterCollection param = new OracleParameterCollection();

            param.Add(new OracleParameter(Common.POS_SP_GET_GCM_DET.P_IN_CODE, objBankdet.KEY));
            param.Add(new OracleParameter(Common.POS_SP_GET_GCM_DET.P_OUTTBL, OracleType.Cursor));
            param[Common.POS_SP_GET_GCM_DET.P_OUTTBL].Direction = ParameterDirection.Output;
            OracleParameter[] Oraparam = new OracleParameter[param.Count];
            param.CopyTo(Oraparam, 0);
            param.Clear();
            var dafdafs = (List <BankMaster>)OracleHelper.FetchData <BankMaster>(Oraparam, Common.Queries.POS_SP_GET_GCM_DET, EnumCommand.DataSource.list).DataSource.Data;

            return(dafdafs);
        }
Пример #15
0
        public static List <BankMaster> FetchBankBranchMasterRegionZoneStateBankType(BankMaster objBankdet)
        {
            OracleParameterCollection param = new OracleParameterCollection();

            param.Add(new OracleParameter(Common.CMS_SP_REGZONCOLLECTION_LIST.E_KEY, objBankdet.DROPDOWNKEY));
            param.Add(new OracleParameter(Common.CMS_SP_REGZONCOLLECTION_LIST.P_OUTTBL, OracleType.Cursor));
            param[Common.CMS_SP_REGZONCOLLECTION_LIST.P_OUTTBL].Direction = ParameterDirection.Output;
            OracleParameter[] Oraparam = new OracleParameter[param.Count];
            param.CopyTo(Oraparam, 0);
            param.Clear();
            var dafdafs = (List <BankMaster>)OracleHelper.FetchData <BankMaster>(Oraparam, Common.Queries.CMS_SP_REGZONCOLLECTION_LIST, EnumCommand.DataSource.list).DataSource.Data;

            return(dafdafs);
        }
Пример #16
0
        public ActionResult EditBank(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BankMaster bankmaster = db.BankMaster.Find(id);

            if (bankmaster == null)
            {
                return(HttpNotFound());
            }

            return(View(bankmaster));
        }
Пример #17
0
        public ActionResult EditBank(BankMaster bankmaster)
        {
            bool isValid = db.BankMaster.Any(x => (x.BankCode != bankmaster.BankCode) && (x.BankName == bankmaster.BankName));

            if (!isValid)
            {
                db.Entry(bankmaster).State = EntityState.Modified;
                db.SaveChanges();
                ViewBag.success = "Your Record Successfully Updated!";
                return(View());
            }
            else
            {
                ViewBag.error = "Bank Name is Already exist!";
                return(View());
            }
        }
Пример #18
0
        private void btnShowPassbook(object sender, EventArgs e)
        {
            name = _bankingMDIFormApp._loginName;
            BankMaster bms = new BankMaster(connectionString);

            dateStatus = validateDate(dtpFromDate.Value.Date, dtpToDate.Value.Date);

            if (!dateStatus)
            {
                MessageBox.Show("Invalid Date");
            }
            else
            {
                DataTable dataTable = bms.getPassBookData(name, dtpFromDate.Value.Date, dtpToDate.Value.Date);
                dgvViewPassbook.DataSource = dataTable;
            }
        }
Пример #19
0
        public static List <BankMaster> SaveBankMaster(BankMaster bankmaster)
        {
            OracleParameterCollection param = new OracleParameterCollection();

            param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_KEY, bankmaster.KEY));
            param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_BANK_NAME, bankmaster.BANK_DESC));
            param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_BANK_CODE, bankmaster.BANK_CODE));
            param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_BANK_TYPE, bankmaster.BANK_TYPE));
            param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_ACTIVE, bankmaster.BANK_ACTIVE));
            param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_OUT, OracleType.Cursor));
            param[Common.POS_SP_INS_BANK_MASTER.P_OUT].Direction = ParameterDirection.Output;
            OracleParameter[] Oraparam = new OracleParameter[param.Count];
            param.CopyTo(Oraparam, 0);
            param.Clear();
            var liBankMaster = (List <BankMaster>)OracleHelper.FetchData <BankMaster>(Oraparam, Common.Queries.POS_SP_INS_BANK_MASTER, EnumCommand.DataSource.list).DataSource.Data;

            return(liBankMaster);
        }
        // GET: BankMasters/Edit/5
        public ActionResult Edit(int?id)
        {
            List <BankTypeMaster> BankTypeList = new List <BankTypeMaster>();

            BankTypeList = (from State in db.BankTypeMasters select State).ToList();
            //ViewBag.CountryList = CountryList;
            ViewBag.BankTypeId = new SelectList(BankTypeList, "BankTypeId", "BankTypeName");
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BankMaster bankMaster = db.BankMasters.Find(id);

            if (bankMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(bankMaster));
        }
Пример #21
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"));
        }
Пример #22
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            BankMaster bms = new BankMaster(connectionString);

            if (bms.authenticateUser(txtUsername.Text, txtloginPassword.Text))
            {
                MessageBox.Show("loged in, Successfully");

                // btnRegister.Visible = false;
                this._bankingMDIFormApp.openButtonVisible(txtUsername.Text);
                this.Close();
                return;
            }
            else
            {
                MessageBox.Show("Wrong Credentials");
                return;
            }
        }
Пример #23
0
 private void btnRegister_Click(object sender, EventArgs e)
 {
     if (txtName.Text != " " && txtOpeningBalance.Text != " " && txtPassword.Text != "")
     {
         BankMaster bms = new BankMaster(txtName.Text, float.Parse(txtOpeningBalance.Text), txtPassword.Text, connectionString);
         if (bms.registerUser())
         {
             MessageBox.Show("Registered Successfully");
         }
         else
         {
             MessageBox.Show("Something went wrong");
         }
     }
     else
     {
         MessageBox.Show("Fill All Details");
     }
 }
Пример #24
0
        public async Task <Guid> SaveStatus(BankMasterDTO _Dto, Guid Id, int EntityState)
        {
            BankMaster bankmaster = new BankMaster();

            bankmaster = await db.BankMasters.Where(o => o.Id == Id).FirstOrDefaultAsync();

            if (bankmaster.StatusCode == EMPConstants.InActive)
            {
                bankmaster.StatusCode = EMPConstants.Active;
            }
            else if (bankmaster.StatusCode == EMPConstants.Active)
            {
                bankmaster.StatusCode = EMPConstants.InActive;
            }

            if (EntityState == (int)System.Data.Entity.EntityState.Modified)
            {
                bankmaster.LastUpdatedDate = DateTime.Now;
                bankmaster.LastUpdatedBy   = _Dto.UserId;
                db.Entry(bankmaster).State = System.Data.Entity.EntityState.Modified;
            }

            try
            {
                await db.SaveChangesAsync();

                db.Dispose();
                return(bankmaster.Id);
            }

            catch (DbUpdateConcurrencyException)
            {
                if (!BankMasterExists(bankmaster.Id))
                {
                    return(Guid.Empty);
                }
                else
                {
                    throw;
                }
            }
        }
Пример #25
0
        public ActionResult AddBank(string BankName)
        {
            BankMaster obj     = new BankMaster();
            bool       isValid = db.BankMaster.Any(x => x.BankName == BankName);

            if (!isValid)
            {
                obj.BankName = BankName;
                db.BankMaster.Add(obj);
                db.SaveChanges();
                TempData["success"] = "Bank Name is Successfully created!";
                ModelState.Clear();
                return(RedirectToAction("Create"));
            }
            else
            {
                TempData["error"] = "Sorry!Bank Name is already exist!";
                return(RedirectToAction("Create"));
            }
        }
Пример #26
0
 private List<BankMaster> masterBanks(int storeID)
 {
     List<BankMaster> masterBankList = new List<BankMaster>();
     try
     {
         List<StorePaymentMethod> bankDb = _context.StorePaymentMethod.Where(c => c.StoreId == storeID).ToList();
         foreach (StorePaymentMethod b in bankDb)
         {
             Bank bankMaster = _context.Bank.Where(c => c.BankId == b.BankCode).First();
             BankMaster bank = new BankMaster();
             bank.bankId = bankMaster.BankId;
             bank.bankName = bankMaster.Name;
             bank.account = bankMaster.Account;
             masterBankList.Add(bank);
         }
     }
     catch
     {
     }
     return masterBankList;
 }
Пример #27
0
 public static List <BankMaster> FetchListBankBranchMasterSearch(BankMaster objModel)
 {
     try
     {
         OracleParameterCollection param = new OracleParameterCollection();
         param.Add(new OracleParameter(Common.POS_SP_GET_BANKMAPPING_SRCH.E_CODE, objModel.BRANCH_DESC_SEARCH));
         param.Add(new OracleParameter(Common.POS_SP_GET_BANKMAPPING_SRCH.E_BANK_CODE, objModel.BANK_CODE_SEARCH));
         param.Add(new OracleParameter(Common.POS_SP_GET_BANKMAPPING_SRCH.P_OUTTBL, OracleType.Cursor));
         param[Common.POS_SP_GET_BANKMAPPING_SRCH.P_OUTTBL].Direction = ParameterDirection.Output;
         OracleParameter[] Oraparam = new OracleParameter[param.Count];
         param.CopyTo(Oraparam, 0);
         param.Clear();
         var liBankMaster = (List <BankMaster>)OracleHelper.FetchData <BankMaster>(Oraparam, Common.Queries.POS_SP_GET_BANKMAPPING_SRCH, EnumCommand.DataSource.list).DataSource.Data;
         return(liBankMaster);
     }
     catch (Exception ex)
     {
         List <BankMaster> liii = new List <BankMaster>();
         return(liii);
     }
 }
Пример #28
0
        public static List <BankMaster> SaveBankBranchMaster(BankMaster bnkMaster)
        {
            OracleParameterCollection param1 = new OracleParameterCollection();

            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_BRANCHID, bnkMaster.BRANCHID));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_BRANCH_TYPE, bnkMaster.BRANCH_TYPE));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_BANK_CODE, bnkMaster.BANK_CODE));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_BRANCH_CODE, bnkMaster.BRANCH_CODE));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_BRANCH_DESC, bnkMaster.BRANCH_DESC));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_ZONE_CODE, bnkMaster.ZONE_CODE));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_REGION_CODE, bnkMaster.REGION_CODE));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_STATE_CODE, bnkMaster.STATE_CODE));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.E_ACTIVE, bnkMaster.ACTIVE));
            param1.Add(new OracleParameter(Common.CMS_SP_INSERT_BANKBRANCH_MST.P_OUTTBL, OracleType.Cursor));
            param1[Common.CMS_SP_INSERT_BANKBRANCH_MST.P_OUTTBL].Direction = ParameterDirection.Output;
            OracleParameter[] Oraparam1 = new OracleParameter[param1.Count];
            param1.CopyTo(Oraparam1, 0);
            param1.Clear();
            var liRegionMaster1 = (List <BankMaster>)OracleHelper.FetchData <BankMaster>(Oraparam1, Common.Queries.CMS_SP_INSERT_BANKBRANCH_MST, EnumCommand.DataSource.list).DataSource.Data;

            return(liRegionMaster1);
        }
Пример #29
0
 public static List <BankMaster> FetchBankMaster(BankMaster objModel)
 {
     try
     {
         OracleParameterCollection param = new OracleParameterCollection();
         param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_KEY, objModel.KEY));
         param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_BANK_NAME, objModel.BANK_NAME));
         param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_BANK_CODE, objModel.BANK_CODE));
         param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_BANK_TYPE, objModel.BANK_TYPE));
         param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_ACTIVE, objModel.BANK_ACTIVE));
         param.Add(new OracleParameter(Common.POS_SP_INS_BANK_MASTER.P_OUT, OracleType.Cursor));
         param[Common.POS_SP_INS_BANK_MASTER.P_OUT].Direction = ParameterDirection.Output;
         OracleParameter[] Oraparam = new OracleParameter[param.Count];
         param.CopyTo(Oraparam, 0);
         param.Clear();
         var liBankMaster = (List <BankMaster>)OracleHelper.FetchData <BankMaster>(Oraparam, Common.Queries.POS_SP_INS_BANK_MASTER, EnumCommand.DataSource.list).DataSource.Data;
         return(liBankMaster);
     }
     catch (Exception ex)
     {
         List <BankMaster> liii = new List <BankMaster>();
         return(liii);
     }
 }
Пример #30
0
        public async Task <int> Save(BankMasterDTO _Dto, Guid Id, int EntityState)
        {
            BankMaster bankmaster = new BankMaster();

            if (_Dto != null)
            {
                bankmaster.Id                  = Id;
                bankmaster.BankName            = _Dto.BankName;
                bankmaster.BankServiceFees     = _Dto.BankServiceFees;
                bankmaster.MaxFeeLimitDeskTop  = _Dto.MaxFeeLimitDeskTop;
                bankmaster.MaxTranFeeDeskTop   = _Dto.MaxTranFeeDeskTop;
                bankmaster.MaxFeeLimitMSO      = _Dto.MaxFeeLimitMSO;
                bankmaster.MaxTranFeeMSO       = _Dto.MaxTranFeeMSO;
                bankmaster.ActivatedDate       = _Dto.ActivatedDate;
                bankmaster.BankProductDocument = _Dto.BankProductDocument;
                bankmaster.DeActivatedDate     = _Dto.DeActivatedDate;
                bankmaster.Description         = _Dto.Description;
                bankmaster.StatusCode          = EMPConstants.Active;
                bankmaster.BankCode            = _Dto.BankCode;
            }

            if (EntityState == (int)System.Data.Entity.EntityState.Modified)
            {
                var ExistBank = db.BankMasters.Where(o => o.Id != Id && o.BankName == _Dto.BankName).Any();
                if (ExistBank)
                {
                    return(-1);
                }

                bankmaster.LastUpdatedDate = DateTime.Now;
                bankmaster.LastUpdatedBy   = _Dto.UserId;
                db.Entry(bankmaster).State = System.Data.Entity.EntityState.Modified;
            }
            else
            {
                var ExistBank = db.BankMasters.Where(o => o.BankName == _Dto.BankName).Any();
                if (ExistBank)
                {
                    return(-1);
                }
                bankmaster.CreatedBy       = _Dto.UserId;
                bankmaster.CreatedDate     = DateTime.Now;
                bankmaster.LastUpdatedDate = DateTime.Now;
                bankmaster.LastUpdatedBy   = _Dto.UserId;
                db.BankMasters.Add(bankmaster);
            }


            if (_Dto.Entities.ToList().Count > 0)
            {
                if (EntityState == (int)System.Data.Entity.EntityState.Modified)
                {
                    var MapData = db.BankEntityMaps.Where(o => o.BankId == Id).ToList();

                    if (MapData.Count() > 0)
                    {
                        db.BankEntityMaps.RemoveRange(MapData);
                    }
                }

                List <BankEntityMap> _BankEntityMapsList = new List <BankEntityMap>();
                foreach (EntityDTO item in _Dto.Entities)
                {
                    BankEntityMap _BankEntityMap = new BankEntityMap();
                    _BankEntityMap.Id       = Guid.NewGuid();
                    _BankEntityMap.BankId   = bankmaster.Id;
                    _BankEntityMap.EntityId = item.Id;
                    _BankEntityMapsList.Add(_BankEntityMap);
                }

                db.BankEntityMaps.AddRange(_BankEntityMapsList);
            }

            try
            {
                await db.SaveChangesAsync();

                db.Dispose();
                return(1);
            }

            catch (DbUpdateConcurrencyException)
            {
                return(0);
            }
        }