Esempio n. 1
0
 public static string CreateAppr(string ValuationID, string AppraiserID, string Reassign)
 {
     try
     {
         PropertyDetails Objcreateuser = new PropertyDetails();
         Objcreateuser.AppraiserID = AppraiserID;
         Objcreateuser.UserID      = HttpContext.Current.Session["UserID"].ToString();
         Objcreateuser.ValuationID = ValuationID;
         Objcreateuser.Reassign    = Reassign;
         var    javaScriptSerializer = new JavaScriptSerializer();
         string strjson = javaScriptSerializer.Serialize(Objcreateuser);
         //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":8088");
         Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/CreateAppraisalByAppr");
         //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":3000/CreateAppraisalByApprWEB");
         //CreateAppraisalByAppr
         var client = new HttpClient();
         client.BaseAddress = urlTemplate;
         client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
         client.Timeout = TimeSpan.FromMilliseconds(600000);
         StringContent htpcontent    = new StringContent(strjson, Encoding.UTF8, "application/json");
         var           response      = client.PostAsync("", htpcontent).Result;
         string        resultContent = response.Content.ReadAsStringAsync().Result;
         return(resultContent);
     }
     catch (Exception exp)
     {
         Console.Write(exp.Message);
         return(exp.Message);
     }
 }