public JsonResult Delete(int?id) { try { if (id > 0) { Customers_Property branchProperty = new Customers_Property(); branchProperty.idx = int.Parse(id.ToString()); objCustomer = new Customers_BLL(id); Customers_BLL branhcBll = new Customers_BLL(branchProperty); var flag = branhcBll.Delete(id); return(Json(new { data = "Deleted", success = flag, statuscode = 200 }, JsonRequestBehavior.AllowGet)); //if (flag1.Rows.Count > 0) //{ //if (true) //{ // bool flag = objVendorsBLL.Delete(id); // return Json(new { data = "Deleted", success = flag, 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)); } }