Пример #1
0
        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);
        }
Пример #2
0
        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);
        }