Exemple #1
0
        protected void EditConsultant()
        {
            try
            {
                var  usnM            = Session["username"].ToString();
                var  regiNM          = Session["myRNo"].ToString();
                var  namecontactPs   = TextBxcont.Text;
                var  currPostn       = TextBoposition.Text;
                var  postTow         = txtPostalTown.Text;
                var  PhoneN          = TextBoxphone.Text;
                var  siteonWeb       = TextBoxweb.Text;
                var  postaAddress    = TextBxpostalAdd.Text;
                var  postCode        = "";
                bool kcdfb4          = false;
                int  statusofProject = 0;

                int TorF = rdoBtnListYesNo.SelectedIndex;
                switch (TorF)
                {
                case 0:
                    kcdfb4 = true;
                    break;

                case 1:
                    kcdfb4          = false;
                    statusofProject = 0;
                    break;

                default:
                    KCDFAlert.ShowAlert("Please select Yes or No!");
                    break;
                }

                int statS = rdBtnStatus.SelectedIndex;
                switch (statS)
                {
                case 0:
                    statusofProject = Convert.ToInt32(rdBtnStatus.SelectedValue);
                    break;

                case 1:
                    statusofProject = Convert.ToInt32(rdBtnStatus.SelectedValue);
                    break;

                case 2:
                    statusofProject = Convert.ToInt32(rdBtnStatus.SelectedValue);
                    break;

                default:
                    statusofProject = 0;
                    break;
                }
                if (ddlPostalCode.SelectedIndex == 0)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itsABitch", "alert('Please select Postal Code!!!');", true);
                    ddlPostalCode.Focus();
                    return;
                }
                else
                {
                    postCode = ddlPostalCode.SelectedItem.Text;
                }

                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;
                if (sup.FnEditConsultant(usnM, regiNM, PhoneN, namecontactPs, currPostn, postCode, postTow, postaAddress, kcdfb4, statusofProject, siteonWeb) == true)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itsABitch", "alert('Your Profile Edited Successfully!!');", true);
                    LoadMyProfile();
                }
            }
            catch (Exception Ec)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itsABitch", "alert('" + Ec.Message + "');", true);
            }
        }