コード例 #1
0
ファイル: Profile.aspx.cs プロジェクト: ryyap/CSCClient
        protected void Button1_Click(object sender, EventArgs e)
        {
            string id = "";
            id = (string)(Session["ID"]);
            int userID = Int32.Parse(id);
            int count;

            string inUser;
            string inDOB;
            string inEmail;
            string inPass;

            inUser =  usernameText.Text;
            inDOB = dobText.Text;
            inEmail = emailText.Text;
            inPass = passwordText.Text;

            profileservice.UserProfileWebService svc = new profileservice.UserProfileWebService();
            count = svc.updateUserProfile(userID, inPass,inUser, inDOB, inEmail );
            if (count == 1)
            {
                Label1.Text = "Success";
            }
            else {
                Label1.Text = "Fail";
            }
            passwordText.Text="";

        }
コード例 #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string id = "";
            id = (string)(Session["ID"]);
            int userID = Int32.Parse(id);
            string inNewPass;
            string inOldPass;
            int count;

            inNewPass = newPasswordText.Text;
            inOldPass = oldPasswordText.Text;

            profileservice.UserProfileWebService svc = new profileservice.UserProfileWebService();
           count = svc.changePassword(userID,inOldPass,inNewPass);
           if (count == 1)
           {
               Label1.Text = "Your password has been successfully changed!";
           }
           else
           {
               Label1.Text = "Fail";
           }

           newPasswordText.Text="";
           oldPasswordText.Text="";
           TextBox2.Text = "";
        }
コード例 #3
0
ファイル: Profile.aspx.cs プロジェクト: ryyap/CSCClient
        protected void Page_Load(object sender, EventArgs e)
        {
            passwordText.Attributes["type"] = "password";
            if (!IsPostBack)
            {
                string id ="";
                id= (string)(Session["ID"]);

                int userID = Int32.Parse(id);
                profileservice.UserProfileWebService svc = new profileservice.UserProfileWebService();
                DataSet workDS = new DataSet();
                workDS = svc.getUserProfile(userID);

                usernameText.Text = workDS.Tables[0].Rows[0]["Username"].ToString();
                dobText.Text = workDS.Tables[0].Rows[0]["DateOfBirth"].ToString();
                emailText.Text = workDS.Tables[0].Rows[0]["Email"].ToString();
            }

            bool val1 = (System.Web.HttpContext.Current.User != null) && System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
            if (val1 == true)
            {
                lblUser.Visible = true;
                lblUser.Text = Context.User.Identity.Name;
                lblLogin.Visible = false;
                lblGallery.Visible = true;
                lblLogout.Visible = true;
                lblChangePassword.Visible = true;
                lblProfile.Visible = true;

            }
            else
            {
                lblUser.Text = "";
                lblUser.Visible = false;
                lblLogin.Visible = true;
                lblLogout.Visible = false;
                lblGallery.Visible = false;
                lblChangePassword.Visible = false;
                lblProfile.Visible = false;
            }
        }