public static object GetChartOverview(string UserID, string Usertype, string OrgType) { try { Userlist Objcreateuser = new Userlist(); Objcreateuser.OrgType = OrgType; var checkusertype = Usertype; if (checkusertype == "Lender") { Objcreateuser.LenderID = UserID; Objcreateuser.AppraiserID = ""; } else { Objcreateuser.AppraiserID = UserID; Objcreateuser.LenderID = ""; } // Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":5004"); Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/GenerateQueuePage"); // Uri urlTemplate = new Uri("http://localhost" + ":3000/GenerateQueuePage"); // GenerateQueuePage 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(); ApplicationQueue ApplicationQueue = new ApplicationQueue(); ApplicationQueue.Address = null; ApplicationQueue.Location = null; string strjson = js.Serialize(Objcreateuser); StringContent htpcontent = new StringContent(strjson, Encoding.UTF8, "application/json"); var response = client.PostAsync("", htpcontent).Result; string resultContent = response.Content.ReadAsStringAsync().Result.ToString(); IList <ApplicationQueue> AppQueue = js.Deserialize <IList <ApplicationQueue> >(resultContent); Console.Write(AppQueue.Count); return(AppQueue); } catch (Exception ex) { Console.WriteLine(ex.Message); return(ex); } }
public void GetUserlist() { try { //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":5003"); Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/GetUserlist"); //GetUserlist Userlist usrdet = new Userlist(); usrdet.UserID = Session["UserID"].ToString(); usrdet.UserType = Session["UserType"].ToString(); usrdet.UserRole = Session["UserRole"].ToString(); usrdet.CompanyName = Session["CompName"].ToString(); usrdet.UserName = Session["UserName"].ToString(); var javaScriptSerializer = new JavaScriptSerializer(); string jsonString = javaScriptSerializer.Serialize(usrdet); 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(jsonString, Encoding.UTF8, "application/json"); var response = client.PostAsync("", htpcontent).Result; var receiveStream = response.Content.ReadAsStringAsync(); responsejson = receiveStream.Result; if (responsejson != "0") { populatedropdown(); } else { Nodata(0, 0, 0); } } catch (Exception ex) { Trace.Write(ex.Message); } }
public void GetInvoiceReceipt() { try { Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/getInvoiceReceipt"); // Uri urlTemplate = new Uri("http://localhost" + ":3000/getInvoiceReceipt"); //GetUserlist Userlist usrdet = new Userlist(); usrdet.UserID = Session["UserID"].ToString(); usrdet.OrgType = Session["OrgType"].ToString(); var javaScriptSerializer = new JavaScriptSerializer(); string jsonString = javaScriptSerializer.Serialize(usrdet); 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(jsonString, Encoding.UTF8, "application/json"); var response = client.PostAsync("", htpcontent).Result; var receiveStream = response.Content.ReadAsStringAsync().Result; if (receiveStream == "0") { Page.ClientScript.RegisterStartupScript(this.GetType(), "No Lenders", "bootbox.alert('No Data Available');", true); Page.ClientScript.RegisterStartupScript(this.GetType(), "disable searchbutton", "$('#btngenfile').attr('disabled','disabled')", true); //btngenfile } else { JavaScriptSerializer js = new JavaScriptSerializer(); Userlist[] Params = js.Deserialize <Userlist[]>(receiveStream.ToString()); foreach (var param in Params) { string strtitle = "UserID : " + param.UserID + "<br />"; strtitle += "UserType : " + param.UserType + "<br />"; strtitle += "UserRole : " + param.UserRole + "<br />"; strtitle += "UserName : "******"<br />"; if (param.OrgType != "") { strtitle += "Organization : " + param.OrgType + "<br />"; } if (param.ContactDetails.PhoneNo != "") { strtitle += "PhoneNo : " + param.ContactDetails.PhoneNo + "<br />"; } strtitle += "MobileNo : " + param.ContactDetails.MobileNo + "<br />"; strtitle += "EmailID : " + param.ContactDetails.EmailID + "<br />"; strtitle += "AddressLine1 : " + param.Address.AddressLine1 + "<br />"; if (param.Address.AddressLine2 != "") { strtitle += "AddressLine2 : " + param.Address.AddressLine2 + "<br />"; } if (param.Address.Landmark != "") { strtitle += "Landmark : " + param.Address.Landmark + "<br />"; } strtitle += "Area : " + param.Address.AddArea + "<br />"; strtitle += "Country / State / City : " + param.Address.Country + " / " + param.Address.State + " / " + param.Address.City + "<br />"; strtitle += "Pincode : " + param.Address.Pincode + "<br />"; ListItem test = new ListItem { Text = param.UserName, Value = param.UserName }; test.Attributes.Add("title", strtitle); ddllendlist.Items.Add(test); } Page.ClientScript.RegisterStartupScript(this.GetType(), "Lenderddl", " $('#ddllendlist').customselect({}); ", true); Page.ClientScript.RegisterStartupScript(this.GetType(), "Lenderattr", " fncpyattr('ddllendlist'); ", true); } } catch (Exception ee) { Console.Write(ee); } }