Exemplo n.º 1
0
        protected void btnValidateInfo_OnClick(object sender, EventArgs e)
        {
            try
            {
                var tobevalidated = Session["edit_id"].ToString();
                //KCDFAlert.ShowAlert(tobevalidated);
                var usNM = Session["username"].ToString();

                var     credentials = new NetworkCredential(ConfigurationManager.AppSettings["W_USER"], ConfigurationManager.AppSettings["W_PWD"], ConfigurationManager.AppSettings["DOMAIN"]);
                Portals sup         = new Portals();
                sup.Credentials     = credentials;
                sup.PreAuthenticate = true;
                bool myValid = sup.FnValidatSubmitConsultant(usNM, tobevalidated);
                switch (myValid)
                {
                case true:
                    txtValidate.Text        = "ALL UPLOADS AVAILABLE";
                    txtValidate.ForeColor   = Color.GhostWhite;
                    txtValidate.BackColor   = Color.ForestGreen;
                    btnValidateInfo.Enabled = false;
                    // hdnTxtValidit.Value = "isValid";
                    Session["validOR"] = "isValid";
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itsABitch", "alert('All Uploads available, you can submit your application: " + hdnTxtValidit.Value + "');", true);
                    break;

                case false:
                    txtValidate.Text      = "PLEASE COMPLETE THE APPLICATION FIRST";
                    txtValidate.BackColor = Color.Red;
                    txtValidate.ForeColor = Color.GhostWhite;
                    // hdnTxtValidit.Value = "isInValid";
                    Session["validOR"] = "isInValid";
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itsABitch", "alert('No uploads yet!, you cannot submit anything: " + hdnTxtValidit.Value + "');", true);
                    break;
                }
            }
            catch (Exception ex)
            {
                KCDFAlert.ShowAlert(ex.Message);
                txtValidate.Text      = "PLEASE UPLOAD ALL DOCUMENTS";
                txtValidate.BackColor = Color.Red;
                txtValidate.ForeColor = Color.GhostWhite;
            }
        }