コード例 #1
0
        public static string GetApproverRecords(string UserID)
        {
            Console.Write(UserID);
            Valid_User objgetvaluation = new Valid_User();

            objgetvaluation.UserID = UserID;
            //objgetvaluation.BorrowerID = ID;
            var    javaScriptSerializer = new JavaScriptSerializer();
            string strjson = javaScriptSerializer.Serialize(objgetvaluation);
            //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":8022");
            Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/GetApproverRecords");
            //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":3000/GetApproverRecordsWEB");
            //GetApproverRecords
            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);
            //return "";
        }
コード例 #2
0
 public static string loaddropdowns(string parentid, string paramname, string accesstype)
 {
     try
     {
         Valid_User objgetvaluation = new Valid_User();
         Params     objparam        = new Params();
         objparam.ParentParamID = parentid;
         objparam.ParamName     = paramname;
         objparam.Access        = accesstype;
         var    javaScriptSerializer = new JavaScriptSerializer();
         string strjson     = javaScriptSerializer.Serialize(objparam);
         Uri    urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/LoadRegPageDropdown");
         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("0");
     }
 }
コード例 #3
0
 public static string GetRejValuationList(string Rejapp)
 {
     try
     {
         Console.Write(Rejapp);
         Valid_User objgetvaluation = new Valid_User();
         objgetvaluation.ValuationID  = Rejapp;
         objgetvaluation.UserID       = HttpContext.Current.Session["UserID"].ToString();
         objgetvaluation.Organization = HttpContext.Current.Session["OrgType"].ToString();
         var    javaScriptSerializer = new JavaScriptSerializer();
         string strjson = javaScriptSerializer.Serialize(objgetvaluation);
         //Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + ":8021");
         Uri urlTemplate = new Uri(ConfigurationManager.AppSettings["ServerAddress"].ToString() + "/GetRejectValuationList");
         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);
     }
 }
コード例 #4
0
        public void Loginauthentication(string resultstr)
        {
            var page = "~/ValuRite/landingpage.aspx";

            if (resultstr.Equals("0"))
            {
                hdnresp.Value = "Invalid Credentials";
                //hdnIsvalidUser.Value = "0";
            }
            else
            {
                JavaScriptSerializer js = new JavaScriptSerializer();
                Console.Write(resultstr.ToString());
                Valid_User Objvalid_User = js.Deserialize <Valid_User>(resultstr.ToString());
                Session["UserStatus"] = Objvalid_User.UserStatus;

                if (Session["UserStatus"].ToString() == "InActive")
                {
                    hdnresp.Value = "User is not Active";
                    var message = hdnresp.Value;
                    //hdnIsvalidUser.Value = "0";
                }
                else
                {
                    Session["UserType"]   = Objvalid_User.UserType;
                    Session["UserID"]     = Objvalid_User.UserID;
                    usersession           = Session["UserID"].ToString();
                    Session["UserRole"]   = Objvalid_User.UserRole;
                    Session["status"]     = Objvalid_User.status;
                    Session["UserName"]   = Objvalid_User.UserName;
                    Session["OrgType"]    = Objvalid_User.Organization;
                    Session["Uploadmage"] = Objvalid_User.Imagename;
                    Session["forpass"]    = "******";
                    //hdnIsvalidUser.Value = "1";
                    // string IsvalidUser = UserSession1(Objvalid_User.UserID, randomNum.ToString(), "check");



                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "alertFunc();", true);
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "key11", "alert('TEST');", true);
                    //ScriptManager.RegisterStartupScript(this, GetType(), "ShowStat", "javascript:alert('Record is not updated');", true);
                    //ScriptManager.RegisterStartupScript(Page, this.GetType(), "DatePickerScript", "javascript:alert('Record is not updated');", true);

                    // System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Web.UI.Page), "Script", "myFunction();", true);
                    //Page.ClientScript.RegisterStartupScript(this.GetType(),"alert", "myFunction();", true);
                    //myTimer = new System.Timers.Timer(1000);
                    //myTimer.Elapsed += OnTimedEvent;
                    //myTimer.AutoReset = true;
                    //myTimer.Enabled = true;
                    //myTimer.Stop();
                    //myTimer.Dispose();


                    // For Self Registration
                    //Session["NewRegistration"] = "false";
                    //Session["Anonymous"] = "0";
                    FormsAuthentication.SetAuthCookie(Objvalid_User.UserID, true);
                    string sKey  = txtusrid.Text + txtpaswd.Text;
                    string sUser = Convert.ToString(Cache[sKey]);
                    FormsAuthentication.SetAuthCookie(sUser, true);
                    Session["user"] = txtusrid.Text + txtpaswd.Text;

                    if (Objvalid_User.status.Equals("false"))
                    {
                        Session["hdnpwdupdate"] = "false";
                        Response.Redirect(page, false);
                        Context.ApplicationInstance.CompleteRequest();
                    }
                    else
                    {
                        Session["hdnpwdupdate"] = "true";

                        //ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "alert('TEST');", true);

                        if (Objvalid_User.UserType == "Appraiser" || Objvalid_User.UserType == "Lender")
                        {
                            if (Objvalid_User.UserType == "Lender" && Objvalid_User.UserRole == "Admin")
                            {
                                Response.Redirect("~/ValuRite/UserConfig.aspx", false);
                                Context.ApplicationInstance.CompleteRequest();
                            }
                            else
                            {
                                Response.Redirect("~/ValuRite/ApplicationQueue.aspx?SessionID=" + randomNum, false);
                                Context.ApplicationInstance.CompleteRequest();
                            }
                        }
                        else
                        {
                            //Response.Redirect(page);
                            Response.Redirect(page, false);
                            Context.ApplicationInstance.CompleteRequest();
                        }
                    }
                }
            }
            txtpaswd.Text = "";
            txtusrid.Text = "";
        }