Esempio n. 1
0
        public List <Sysdic> GetDicByType(string type)
        {
            string    url   = KNDBsysUrl.BaseInfoUrl.DictionaryUrl.GetDicByType;
            HttpTools tools = new HttpTools();

            tools.AddParam("dictype", type).Build();
            HttpWebResponse res = HttpHelper.CreatePostHttpResponse(url, tools.dic, 3000, null);

            if (res != null)
            {
                string json = DataSwitch.GetResponseString(res);
                PostData <Sysdic, DBNull> postData = DataSwitch.JsonToObj <PostData <Sysdic, DBNull> >(json);
                return(postData.rows);
            }
            return(new List <Sysdic>());
        }
Esempio n. 2
0
        public string GetUserInfo(string name, string post)
        {
            string url = KNDBsysUrl.BaseInfoUrl.UserInfoUrl.GetAllUserInfo;

            HttpTools tools = new HttpTools();

            tools.AddParam("name", name).AddParam("post", post).Build();

            HttpWebResponse res = HttpHelper.CreatePostHttpResponse(url, tools.dic, 3000, null);

            if (res != null)
            {
                return(DataSwitch.GetResponseString(res));
            }
            return("");
        }
Esempio n. 3
0
        public int AddSysVer(SysVer sysVer)
        {
            string    url   = KNDBsysUrl.BaseInfoUrl.SysVerUrl.AddSysVer;
            HttpTools tools = new HttpTools();

            tools.AddParam("sysver", DataSwitch.DataToJson(sysVer)).Build();
            HttpWebResponse res = HttpHelper.CreatePostHttpResponse(url, tools.dic, 3000, null);

            if (res != null)
            {
                string json = DataSwitch.GetResponseString(res);
                PostData <SysVer, SysVer> postData = DataSwitch.JsonToObj <PostData <SysVer, SysVer> >(json);
                if (postData.Msg != General.reFail)
                {
                    return(int.Parse(postData.Msg));
                }
            }
            return(General.intFail);
        }
Esempio n. 4
0
        public bool DleteDictionary(Sysdic sysdic)
        {
            string    url   = KNDBsysUrl.BaseInfoUrl.DictionaryUrl.DeleteSysdic;
            HttpTools tools = new HttpTools();

            tools.AddParam("dic", DataSwitch.DataToJson(sysdic)).Build();
            HttpWebResponse res = HttpHelper.CreatePostHttpResponse(url, tools.dic, 3000, null);

            if (res != null)
            {
                string json = DataSwitch.GetResponseString(res);
                PostData <DBNull, DBNull> postData = DataSwitch.JsonToObj <PostData <DBNull, DBNull> >(json);
                if (postData.Msg != General.reFail)
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 5
0
        public int AddDictionary(Sysdic cSDic)
        {
            string    url   = KNDBsysUrl.BaseInfoUrl.DictionaryUrl.AddDicByType;
            HttpTools tools = new HttpTools();

            tools.AddParam("dic", DataSwitch.DataToJson(cSDic)).Build();
            HttpWebResponse res = HttpHelper.CreatePostHttpResponse(url, tools.dic, 3000, null);

            if (res != null)
            {
                string json = DataSwitch.GetResponseString(res);
                PostData <DBNull, DBNull> postData = DataSwitch.JsonToObj <PostData <DBNull, DBNull> >(json);
                if (postData.Msg != General.reFail)
                {
                    return(int.Parse(postData.Msg));
                }
            }
            return(General.intFail);
        }