public JsonResult AddBank(int CountryId, string BankName, string BankPhoneNo, string BankAddress, string ContactPersonPhoneNo, string ContactPersonMobileNo, string ContactPerson, string ContactPersonEmail) { bool check = false; JsonResult result = new JsonResult(); { check = _bankmanagementser.VerifyBankInput(BankName, BankAddress, BankPhoneNo, ContactPerson); if (check == true) { BankManagementsModel model = new BankManagementsModel(); model.BankName = BankName; model.BankAddress = BankAddress; model.CountryId = CountryId; model.PhoneNo = BankPhoneNo; model.ContactPerson = ContactPerson; model.ContactPersonPhoneNo = ContactPersonPhoneNo; model.ContactPersonMobileNo = ContactPersonMobileNo; model.ContactPersonEmail = ContactPersonEmail; _bankmanagementser.CreateBank(model); result.Data = _bankmanagementser.GetLastBankId(); return(result); } result.Data = null; return(result); } }
public ActionResult Index() { BankManagementsModel model = new BankManagementsModel(); model.BankList = _pro.List(); return(View(model)); }
public BankManagementsModel Create(BankManagementsModel model, out ActionResponse _ores) { if (IsExists(model.BankId, model.BankName) == false) { Banks obj = new Banks { BankName = model.BankName, BankAddress = model.BankAddress, PhoneNo = model.PhoneNo, ContactPerson = model.ContactPerson, ContactPersonPhoneNo = model.ContactPersonPhoneNo, ContactPersonMobileNo = model.ContactPersonMobileNo, ContactPersonEmail = model.ContactPersonEmail, CountryId = model.CountryId }; _ent.AddToBanks(obj); _ent.SaveChanges(); model.BankId = obj.BankId; _res.ActionMessage = String.Format(Resources.Message.SuccessfullySaved, "Bank detail"); _res.ErrNumber = 0; _res.ErrSource = "DataBase"; _res.ErrType = "App"; _res.ResponseStatus = true; } else { _res.ActionMessage = String.Format(Resources.Message.AlreadyExist, "Bank detail"); _res.ErrNumber = 1001; _res.ErrSource = "DataBase"; _res.ErrType = "App"; _res.ResponseStatus = true; } _ores = _res; return(model); }
public ActionResult Create(BankManagementsModel model) { _pro.Create(model, out _res); _pro.FillDdl(model); return(View("Edit", model)); //return View("Index", model); }
public ActionResult Detail(int id, BankManagementsModel obj) { BankManagementsModel model = new BankManagementsModel(); if (Request.IsAjaxRequest()) { model = _pro.BranchDetail(id, out _res); return(PartialView("BranchDetails", model)); } return(RedirectToAction("Index")); }
public ActionResult Edit(int?id) { if (Request.IsAjaxRequest()) { _model = _pro.BranchDetail(id, out _res); return(PartialView("EditBranch", _model)); } _model = _pro.BankDetail(id, out _res); _model.GetAllBranch = _pro.BranchList(id); _pro.FillDdl(_model); return(View(_model)); }
public ActionResult Detail(int?id) { if (Request.IsAjaxRequest()) { _model = _pro.BranchDetail(id, out _res); return(PartialView("BranchDetails", _model)); } _model = _pro.BankDetail(id, out _res); _model.GetAllBranch = _pro.BranchList(id); ViewData["Bank"] = _model.BankName; return(View(_model)); }
public void UpdateBranch(BankManagementsModel model) { BankBranches result = ent.BankBranches.Where(x => x.BankBranchId == model.BankBranchId).FirstOrDefault(); result.BranchAddress = model.BranchAddress; result.BranchName = model.BranchName; result.ContactPerson = model.BranchContactPerson; result.PhoneNumber = model.BranchPhoneNumber; result.ContactPersonPhoneNo = model.BranchContactPhoneNo; result.ContactPersonEmail = model.BranchContactEmail; result.CountryId = model.BranchCountryId; ent.ApplyCurrentValues(result.EntityKey.EntitySetName, result); ent.SaveChanges(); }
public BranchManagementsModel ConverToBranch(BankManagementsModel model) { BranchManagementsModel item = new BranchManagementsModel { BankId = model.BankId, BranchAddress = model.BranchAddress, CountryId = model.BranchCountryId, BranchName = model.BranchName, BranchPhoneNumber = model.BranchPhoneNumber, BranchContactPerson = model.BranchContactPerson, BranchContactEmail = model.BranchContactEmail, BranchContactPhoneNo = model.BranchContactPhoneNo, }; return(item); }
public BankManagementsModel BranchDetail(int?Id, out ActionResponse _ores) { if (Id != null) { BankBranches result = new BankBranches(); result = _ent.BankBranches.Where(x => x.BankBranchId == Id).FirstOrDefault(); if (result != null) { BankManagementsModel model = new BankManagementsModel { BranchName = result.BranchName, BranchAddress = result.BranchAddress, BranchContactPerson = result.ContactPerson, BranchContactEmail = result.ContactPersonEmail, BranchContactPhoneNo = result.ContactPersonPhoneNo, BankName = result.Banks.BankName, BranchPhoneNumber = result.PhoneNumber, BranchCountryName = result.Countries.CountryName, BranchCountryId = result.CountryId, BankBranchId = result.BankBranchId, BankId = result.BankId, }; _ores = _res; return(model); } else { _res.ActionMessage = String.Format(Resources.Message.InvalidOperation, "Branch"); _res.ErrNumber = 1005; _res.ErrSource = "DataBase"; _res.ErrType = "App"; _res.ResponseStatus = true; _ores = _res; return(_model); } } else { _res.ActionMessage = String.Format(Resources.Message.InvalidOperation, "Branch"); _res.ErrNumber = 1005; _res.ErrSource = "DataBase"; _res.ErrType = "App"; _res.ResponseStatus = true; _ores = _res; return(_model); } }
public void CreateBranch(BankManagementsModel model) { BankBranches obj = new BankBranches { BankId = model.BankId, CountryId = model.CountryId, BranchName = model.BranchName, BranchAddress = model.BranchAddress, PhoneNumber = model.BranchPhoneNumber, ContactPerson = model.BranchContactPerson, ContactPersonPhoneNo = model.BranchContactPerson, ContactPersonEmail = model.BranchContactEmail }; ent.AddToBankBranches(obj); ent.SaveChanges(); }
public void CreateBank(BankManagementsModel model) { Banks obj = new Banks { BankName = model.BankName, BankAddress = model.BankAddress, PhoneNo = model.PhoneNo, ContactPerson = model.ContactPerson, ContactPersonPhoneNo = model.ContactPersonPhoneNo, ContactPersonMobileNo = model.ContactPersonMobileNo, ContactPersonEmail = model.ContactPersonEmail, CountryId = model.CountryId }; ent.AddToBanks(obj); ent.SaveChanges(); }
public BankManagementsModel GetDetailsOfBank(int BankId) { var result = ent.Banks.Where(x => x.BankId == BankId).FirstOrDefault(); BankManagementsModel model = new BankManagementsModel { BankId = result.BankId, BankName = result.BankName, BankAddress = result.BankAddress, PhoneNo = result.PhoneNo, ContactPerson = result.ContactPerson, ContactPersonPhoneNo = result.ContactPersonPhoneNo, ContactPersonMobileNo = result.ContactPersonMobileNo, ContactPersonEmail = result.ContactPersonEmail }; return(model); }
public void UpdateBanks(BankManagementsModel model) { Banks result = ent.Banks.Where(x => x.BankId == model.BankId).FirstOrDefault(); Banks item = new Banks { BankId = model.BankId, BankName = model.BankName, BankAddress = model.BankAddress, PhoneNo = model.PhoneNo, ContactPerson = model.ContactPerson, ContactPersonPhoneNo = model.ContactPersonPhoneNo, ContactPersonMobileNo = model.ContactPersonMobileNo, ContactPersonEmail = model.ContactPersonEmail, CountryId = model.CountryId }; ent.ApplyCurrentValues(result.EntityKey.EntitySetName, item); ent.SaveChanges(); }
public ActionResult SaveBranch(FormCollection fc) { //foreach (var key in fc.AllKeys) //{ // var value = fc[key]; // // etc. //} var value = fc["BranchCountryId"]; // int a = int.Parse(value.Split(',').ElementAtOrDefault(0)); // int a = Convert.ToInt32((value.Split(',')).ElementAt(0)); // int b = Convert.ToInt32((value.Split(','))); BankManagementsModel model = new BankManagementsModel(); model.BranchName = fc["BranchName"].Split(',')[0]; model.BranchCountryId = Convert.ToInt32(fc["BranchCountryId"].Split(',').ElementAtOrDefault(0)); model.BranchPhoneNumber = fc["BranchPhoneNumber"].Split(',').ElementAtOrDefault(0); model.BranchAddress = fc["BranchAddress"]; model.BranchContactPhoneNo = fc["BranchContactPhoneNo"].Split(',').ElementAtOrDefault(0); model.BranchContactPerson = fc["BranchContactPerson"].Split(',').ElementAtOrDefault(0); model.BranchContactEmail = fc["BranchContactEmail"].Split(',').ElementAtOrDefault(0); model.BankId = Convert.ToInt32(fc["BankId"]); bool check = false; int a = model.BankId; check = _bankmanagementser.VerifyBranchInput(model.BankId, model.BranchName, model.BranchAddress, model.BranchCountryId, model.BranchPhoneNumber); if (check == true) { model.Branch = _bankmanagementser.ConverToBranch(model); _bankmanagementser.CreateBranch(model.Branch); model.GetAllBranch = _bankmanagementser.BranchList(a); ViewData["Countries"] = _generalProvider.GetCountryList(); return(View("Edit", model)); } else { return(RedirectToAction("Index")); } }
public ActionResult Edit(BankManagementsModel model, int id) { bool check = false; // model.hfCheckBankOrBranch = model.hfCheckBankOrBranch.Split(',').ElementAtOrDefault(0); int a = id; if (model.hfCheckBankOrBranch == 1) { model.BranchName = model.BranchName.Split(',').ElementAtOrDefault(0); model.BranchAddress = model.BranchAddress.Split(',')[0]; model.BranchContactPerson = model.BranchContactPerson.Split(',').ElementAtOrDefault(0); model.BranchContactPhoneNo = model.BranchContactPhoneNo.Split(',').ElementAtOrDefault(0); model.BranchPhoneNumber = model.BranchPhoneNumber.Split(',').ElementAtOrDefault(0); model.BranchContactEmail = model.BranchContactEmail.Split(',').ElementAtOrDefault(0); check = _pro.VerifyBranchInput(model.BankBranchId, model.BranchName, model.BranchAddress, model.BranchCountryId, model.BranchPhoneNumber); if (check == true) { _pro.UpdateBranch(model); model.GetAllBranch = _pro.BranchList(id); ViewData["Countries"] = _gpro.GetCountryList(); return(View("Edit", model)); } else { return(PartialView("BranchList")); } } else { model.BankId = id; check = _pro.VerifyBankInput(model.BankName, model.BankAddress, model.PhoneNo, model.ContactPerson); if (check == true) { _pro.UpdateBanks(model); return(RedirectToAction("Index")); } else { return(RedirectToAction("Index")); } } }
public BankManagementsModel BankDetail(int?Id, out ActionResponse _ores) { if (Id != null) { var result = _ent.Banks.Where(x => x.BankId == Id).FirstOrDefault(); if (result != null) { BankManagementsModel model = new BankManagementsModel { BankId = result.BankId, BankName = result.BankName, BankAddress = result.BankAddress, PhoneNo = result.PhoneNo, ContactPerson = result.ContactPerson, ContactPersonPhoneNo = result.ContactPersonPhoneNo, ContactPersonMobileNo = result.ContactPersonMobileNo, ContactPersonEmail = result.ContactPersonEmail }; _ores = _res; return(model); } else { _res.ActionMessage = String.Format(Resources.Message.InvalidOperation, "Bank"); _res.ErrNumber = 1005; _res.ErrSource = "DataBase"; _res.ErrType = "App"; _res.ResponseStatus = true; _ores = _res; return(_model); } } else { _res.ActionMessage = String.Format(Resources.Message.InvalidOperation, "Bank"); _res.ErrNumber = 1005; _res.ErrSource = "DataBase"; _res.ErrType = "App"; _res.ResponseStatus = true; _ores = _res; return(_model); } }
public IEnumerable <BankManagementsModel> GetBanksList() { var result = ent.Banks; List <BankManagementsModel> model = new List <BankManagementsModel>(); foreach (var item in result) { BankManagementsModel obj = new BankManagementsModel { BankId = item.BankId, BankName = item.BankName, BankAddress = item.BankAddress, PhoneNo = item.PhoneNo, ContactPerson = item.ContactPerson, ContactPersonPhoneNo = item.ContactPersonPhoneNo, ContactPersonMobileNo = item.ContactPersonMobileNo, ContactPersonEmail = item.ContactPersonEmail }; model.Add(obj); } return(model); }
public BankManagementsModel GetDetailsOfBranch(int BankBranchId) { BankBranches result = new BankBranches(); result = ent.BankBranches.Where(x => x.BankBranchId == BankBranchId).FirstOrDefault(); BankManagementsModel model = new BankManagementsModel { BranchName = result.BranchName, BranchAddress = result.BranchAddress, BranchContactPerson = result.ContactPerson, BranchContactEmail = result.ContactPersonEmail, BranchContactPhoneNo = result.ContactPersonPhoneNo, BankName = result.Banks.BankName, BranchPhoneNumber = result.PhoneNumber, BranchCountryName = result.Countries.CountryName, BranchCountryId = result.CountryId, BankBranchId = result.BankBranchId, BankId = result.BankId, }; return(model); }
public BankManagementsModel FillDdl(BankManagementsModel model) { model.ddlCountriesList = new SelectList(_gpro.GetCountryList(), "CountryId", "CountryName"); return(model); }
public ActionResult Create(FormCollection fc, BankManagementsModel model) { _pro.FillDdl(_model); return(View(_model)); }