public string UpdateChains(int id, string name) { object result = null; string strReturn = string.Empty; try { eChains obj = new eChains(); obj = BL_Chains.GetSingleRecordById(id); obj.sChainName = name; obj.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId; int i = BL_Chains.UpdateRecord(obj); if (i == 1) { result = new { st = 1, msg = clsUtils.ErrorMsg("Chain", 2) }; } else if (i == 2) { result = new { st = 0, msg = clsUtils.ErrorMsg("Chain", 0) }; } else { result = new { st = 0, msg = clsUtils.ErrorMsg("Chain", 3) }; } } catch (Exception) { result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) }; } strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result); return(strReturn); }
public string AddChains(string name) { object result = null; string strReturn = string.Empty; try { eChains eObj = new eChains(); eObj.sChainName = name; eObj.dtActionDate = DateTime.Now; eObj.cStatus = "A"; eObj.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId; int i = BL_Chains.AddRecord(eObj); if (i == 1) { result = new { st = 1, msg = clsUtils.ErrorMsg("Chain", 1) }; } else if (i == 2) { result = new { st = 0, msg = clsUtils.ErrorMsg("Chain", 0) }; } else { result = new { st = 0, msg = clsUtils.ErrorMsg("Chain", 3) }; } } catch (Exception) { result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) }; } strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result); return(strReturn); }