Пример #1
0
        public static string saveparamdetails(string ParamValue, string ParamID, string ParentParamID, string ParamName, string Editable, string Status, string Update, string UserAccess)
        {
            paramdetails prmdetails = new paramdetails();

            prmdetails.ParamName     = ParamName;
            prmdetails.ParamID       = ParamID;
            prmdetails.ParentParamID = ParentParamID;
            prmdetails.ParamValue    = ParamValue;
            prmdetails.Editable      = Editable;
            prmdetails.ParamStatus   = Status;
            prmdetails.Update        = Update;
            prmdetails.UserAccess    = UserAccess;
            //Saveparamdetails
            //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":6046");
            Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/Saveparamdetails");
            var client      = new HttpClient();

            client.BaseAddress = urlTemplate;
            client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
            client.Timeout = TimeSpan.FromMilliseconds(600000);
            JavaScriptSerializer js     = new JavaScriptSerializer();
            string        strjson       = js.Serialize(prmdetails);
            StringContent htpcontent    = new StringContent(strjson, Encoding.UTF8, "application/json");
            var           response      = client.PostAsync("", htpcontent).Result;
            string        resultContent = response.Content.ReadAsStringAsync().Result.ToString();

            return(resultContent);
        }
Пример #2
0
        public static string GetParamdetailsonchange(string ParamID)
        {
            paramdetails prmdetails = new paramdetails();

            prmdetails.ParamID = ParamID;
            //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() +":6045");
            Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/GetParamonchange");
            var client      = new HttpClient();

            client.BaseAddress = urlTemplate;
            client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
            client.Timeout = TimeSpan.FromMilliseconds(600000);
            JavaScriptSerializer js     = new JavaScriptSerializer();
            string        strjson       = js.Serialize(prmdetails);
            StringContent htpcontent    = new StringContent(strjson, Encoding.UTF8, "application/json");
            var           response      = client.PostAsync("", htpcontent).Result;
            string        resultContent = response.Content.ReadAsStringAsync().Result.ToString();

            return(resultContent);
        }