public JsonResult AddUpdate(LP_VendorBanks_Property objbank) { if (Session["LOGGEDIN"] != null) { try { if (objbank.idx != 0) { objVendorBanksProperty = new LP_VendorBanks_Property(); objVendorBanksProperty = objbank; objVendorBanksProperty.visible = 1; objVendorBanksProperty.vendorIdx = objbank.vendorIdx; objVendorBanksProperty.bankIdx = objbank.bankIdx; objVendorBanksProperty.accountTitle = objbank.accountTitle; objVendorBanksProperty.accountNumber = objbank.accountNumber; objVendorBanksProperty.ibanNumber = objbank.ibanNumber; objVendorBanksProperty.lastModifiedByUserIdx = Convert.ToInt32(Session["UID"].ToString()); objVendorBanksProperty.lastModificationDate = DateTime.Now.ToString("yyyy-MM-dd"); objVendorBanksBLL = new LP_VendorBanks_BLL(objVendorBanksProperty); bool flag = objVendorBanksBLL.Update(); return(Json(new { data = objVendorBanksProperty, success = flag, msg = "Success", statuscode = 200, count = 0 }, JsonRequestBehavior.AllowGet)); } else { objVendorBanksProperty = new LP_VendorBanks_Property(); objVendorBanksProperty = objbank; objVendorBanksProperty.visible = 1; objVendorBanksProperty.vendorIdx = objbank.vendorIdx; objVendorBanksProperty.bankIdx = objbank.bankIdx; objVendorBanksProperty.accountTitle = objbank.accountTitle; objVendorBanksProperty.accountNumber = objbank.accountNumber; objVendorBanksProperty.ibanNumber = objbank.ibanNumber; objVendorBanksProperty.createdBy = Convert.ToInt32(Session["UID"].ToString()); objVendorBanksProperty.creationDate = DateTime.Now.ToString("yyyy-MM-dd"); objVendorBanksBLL = new LP_VendorBanks_BLL(objVendorBanksProperty); bool flag = objVendorBanksBLL.Insert(); return(Json(new { data = objVendorBanksProperty, 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)); } }