public JsonResult DeleteBank(int?id) { try { if (id > 0) { Bank_Property branchProperty = new Bank_Property(); branchProperty.idx = int.Parse(id.ToString()); objBanlBLL = new Bank_BLL(branchProperty); var flag1 = objBanlBLL.Delete(id); //if (flag1.Rows.Count > 0) //{ //bool flag = objCustomerTypeBLL.Delete(id); return(Json(new { data = "Deleted", success = flag1, statuscode = 200 }, JsonRequestBehavior.AllowGet)); //else //{ // return Json(new { data = "Mian Branch Cannot be Delete ", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet); //} //} // return Json(new { data = "Process Completed ", success = true, statuscode = 200 }, JsonRequestBehavior.AllowGet); } else { return(Json(new { data = "Error Occur", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet)); } }
public ActionResult AddNewVendorBank(int?id) { if (Session["LOGGEDIN"] != null) { objVendorBanksProperty = new LP_VendorBanks_Property(); Bank_BLL objBanlBLL = new Bank_BLL(); Vendors_BLL objVendorBLL = new Vendors_BLL(); objVendorBanksProperty.BankList = Helper.ConvertDataTable <Bank_Property>(objBanlBLL.ViewAll()); objVendorBanksProperty.VendorList = Helper.ConvertDataTable <Vendors_Property>(objVendorBLL.ViewAll()); if (id > 0) { objVendorBanksProperty.idx = Convert.ToInt32(id); objVendorBanksBLL = new LP_VendorBanks_BLL(objVendorBanksProperty); DataTable dt = objVendorBanksBLL.SelectOne(); objVendorBanksProperty.bankIdx = int.Parse(dt.Rows[0]["bankIdx"].ToString()); objVendorBanksProperty.vendorIdx = int.Parse(dt.Rows[0]["vendorIdx"].ToString()); objVendorBanksProperty.accountTitle = dt.Rows[0]["accountTitle"].ToString(); objVendorBanksProperty.accountNumber = dt.Rows[0]["accountNumber"].ToString(); objVendorBanksProperty.ibanNumber = dt.Rows[0]["ibanNumber"].ToString(); return(PartialView("AddNewVendorBank", objVendorBanksProperty)); } else { return(PartialView("AddNewVendorBank", objVendorBanksProperty)); } } else { return(RedirectToAction("Login", "Account")); } }
public ActionResult AddNewBank(int?id) { if (Session["LOGGEDIN"] != null) { objbankproperty = new Bank_Property(); try { if (id > 0) { objbankproperty.idx = Convert.ToInt32(id); objBanlBLL = new Bank_BLL(objbankproperty); objBanlBLL.SelectOne(); } else { } } catch (Exception ex) { } return(PartialView("_AddNewBank", objbankproperty)); } else { return(RedirectToAction("Login", "Account")); } }
public ActionResult AddCompanyNewBank(int?id) { if (Session["LOGGEDIN"] != null) { objcompanybankproperty = new CompanyBank_Property(); objBanlBLL = new Bank_BLL(); objcompanybankproperty.BankList = Helper.ConvertDataTable <Bank_Property>(objBanlBLL.ViewAll()); try { if (id > 0) { objcompanybankproperty.idx = Convert.ToInt32(id); objcompanybankbll = new CompanyBank_BLL(objcompanybankproperty); objcompanybankbll.SelectOne(); } else { } } catch (Exception ex) { } return(PartialView("_AddCompanyNewBank", objcompanybankproperty)); } else { return(RedirectToAction("Login", "Account")); } }
public JsonResult AddUpdate(Bank_Property objbank) { if (Session["LOGGEDIN"] != null) { try { objbankproperty = new Bank_Property(); objbankproperty = objbank; objbankproperty.visible = 1; objbankproperty.createdByUserIdx = Convert.ToInt32(Session["UID"].ToString()); objbankproperty.creationDate = DateTime.Now; objBanlBLL = new Bank_BLL(objbankproperty); //check existing name if (objBanlBLL.CheckBank() > 0) { return(Json(new { data = objbankproperty, success = true, msg = "Bank Name Already Exist", statuscode = 401, count = 0 }, JsonRequestBehavior.AllowGet)); } else { bool flag; if (objbankproperty.idx > 0) { //update flag = objBanlBLL.Update(); return(Json(new { data = objbankproperty, success = flag, msg = "Success", statuscode = 200, count = 0 }, JsonRequestBehavior.AllowGet)); } else { //add flag = objBanlBLL.Insert(); return(Json(new { data = objbankproperty, success = flag, msg = "Success", statuscode = 200, count = 0 }, JsonRequestBehavior.AllowGet)); } } } catch (Exception ex) { return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet)); } } else { return(Json(new { data = "Session Expired", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet)); } }
public ActionResult AddNewCustomerBank(int?id) { string actionName = this.ControllerContext.RouteData.Values["action"].ToString(); string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString(); string pagename = @"/" + controllerName + @"/" + actionName; var page = (List <LP_Pages_Property>)Session["PageList"]; if (Session["LoggedIn"] != null && Helper.CheckPageAccess(pagename, page) && Session["ISADMIN"] != null && Convert.ToBoolean(Session["ISADMIN"].ToString()) == true) { objCustomerBanksProperty = new LP_CustomerBanks_Property(); Bank_BLL objBanlBLL = new Bank_BLL(); Customers_BLL objVendorBLL = new Customers_BLL(); objCustomerBanksProperty.BankList = Helper.ConvertDataTable <Bank_Property>(objBanlBLL.ViewAll()); objCustomerBanksProperty.CustomerList = Helper.ConvertDataTable <Customers_Property>(objVendorBLL.ViewAllCustomers()); if (id > 0) { objCustomerBanksProperty.idx = Convert.ToInt32(id); objCustomerBanksBLL = new LP_CustomerBanks_BLL(objCustomerBanksProperty); DataTable dt = objCustomerBanksBLL.SelectOne(); objCustomerBanksProperty.bankIdx = int.Parse(dt.Rows[0]["bankIdx"].ToString()); objCustomerBanksProperty.customerIdx = int.Parse(dt.Rows[0]["customerIdx"].ToString()); objCustomerBanksProperty.accountTitle = dt.Rows[0]["accountTitle"].ToString(); objCustomerBanksProperty.accountNumber = dt.Rows[0]["accountNumber"].ToString(); objCustomerBanksProperty.ibanNumber = dt.Rows[0]["ibanNumber"].ToString(); return(PartialView("AddNewCustomerBank", objCustomerBanksProperty)); } else { return(PartialView("AddNewCustomerBank", objCustomerBanksProperty)); } } else { if (Session["LoggedIn"] == null) { return(RedirectToAction("Login", "Account")); } else { return(RedirectToAction("NotAuthorized", "Account")); } } }
public ActionResult AddCompanyNewBank(int?id) { string actionName = this.ControllerContext.RouteData.Values["action"].ToString(); string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString(); string pagename = @"/" + controllerName + @"/" + actionName; var page = (List <LP_Pages_Property>)Session["PageList"]; if (Session["LoggedIn"] != null && Helper.CheckPageAccess(pagename, page) && Session["ISADMIN"] != null && Convert.ToBoolean(Session["ISADMIN"].ToString()) == true) { objcompanybankproperty = new CompanyBank_Property(); objBanlBLL = new Bank_BLL(); objcompanybankproperty.BankList = Helper.ConvertDataTable <Bank_Property>(objBanlBLL.ViewAll()); try { if (id > 0) { objcompanybankproperty.idx = Convert.ToInt32(id); objcompanybankbll = new CompanyBank_BLL(objcompanybankproperty); objcompanybankbll.SelectOne(); } else { } } catch (Exception ex) { } return(PartialView("_AddCompanyNewBank", objcompanybankproperty)); } else { if (Session["LoggedIn"] == null) { return(RedirectToAction("Login", "Account")); } else { return(RedirectToAction("NotAuthorized", "Account")); } } }
public JsonResult GetAllBanks() { if (Session["LOGGEDIN"] != null) { try { objBanlBLL = new Bank_BLL(); var Data = JsonConvert.SerializeObject(objBanlBLL.ViewAll()); return(Json(new { data = Data, success = true, statuscode = 200, count = Data.Length }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet)); } } else { return(Json(new { data = "Session Expired", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet)); } }