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 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 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 AddNewBank(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) { 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 { if (Session["LoggedIn"] == null) { return(RedirectToAction("Login", "Account")); } else { return(RedirectToAction("NotAuthorized", "Account")); } } }
public Bank_DAL(Bank_Property objbank) { objBankProperty = objbank; }
public Bank_BLL(Bank_Property objbankproperty) { objbank = objbankproperty; }