Exemplo n.º 1
0
        protected void jawn_click(object sender, EventArgs e)
        {
            ServiceReference4.Service1Client client = new
                                                      ServiceReference4.Service1Client();
            string returnString;

            returnString = client.GetData(Convert.ToInt32(textBox1.Text));
            label1.Text  = returnString;
        }
Exemplo n.º 2
0
        protected void btn_Register_Submit(object sender, EventArgs e)
        {
            string theUser  = txtRegisterEmail.Text.Trim();
            string thePass  = txtRegisterPassword.Text.Trim();
            string theName  = txtRegisterName.Text.Trim();
            string thePass2 = txtRegisterPassword2.Text.Trim();
            string theEmail = txtRegisterEmailAddress.Text.Trim();

            ServiceReference4.Service1Client client = new
                                                      ServiceReference4.Service1Client();

            localhost.Service1 get = new localhost.Service1();


            if (validationcheck(theUser, thePass, thePass2, theName) == true)
            {
                //string newPass = passHash(thePass);
                get.userRegister(theUser, thePass, thePass2, theName, theEmail);
                int profid = client.getprofileID(theUser);
                Session["user"] = theUser;
                Session["id"]   = profid;



                //MailMessage mail = new MailMessage();
                //mail.To.Add(theEmail);

                //mail.From = new MailAddress("*****@*****.**");
                //mail.Subject = "Welcome!" + theUser;
                //mail.Body = "Hello!";
                //mail.IsBodyHtml = true;

                //SmtpClient smtp = new SmtpClient();
                //smtp.Host = "smtp.mail.yahoo.com";



                //smtp.Credentials = new System.Net.NetworkCredential
                //   ("*****@*****.**", "ukraine1990");

                //smtp.Port = 587;



                //smtp.EnableSsl = true;

                //smtp.Send(mail);


                Response.Redirect("~/MyProfile.aspx");
            }
        }
        protected void btnGetInfo_Click(object sender, EventArgs e)
        {
            ClearAll();
            ServiceReference4.Service1Client get = new ServiceReference4.Service1Client();

            //localhost.Service1 get = new localhost.Service1();
            int login = (int)Session["id"];

            user newItem = get.getPatientInformation(login);

            txtName.Text      = newItem.theLogin;
            txtGender.Text    = newItem.thePassword;
            txtEthnicity.Text = newItem.theName;
        }
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            string theUser  = txtName.Text.Trim();
            string thePass  = txtGender.Text.Trim();
            string theName  = txtEthnicity.Text.Trim();
            string thePass2 = txtAge.Text.Trim();

            ServiceReference4.Service1Client get = new ServiceReference4.Service1Client();

            get.InsertingtheData(theUser, thePass, thePass2, theName);



            LblResult.Text = "success" + Session["id"] + Session["user"];
        }
Exemplo n.º 5
0
        protected void loginSubmit_Click(object sender, EventArgs e)
        {
            string theUser = txtUserName.Text.ToString().Trim();
            string thePass = txtPassword.Text.ToString().Trim();

            //string newPass = passHash(thePass);


            ServiceReference4.Service1Client get = new ServiceReference4.Service1Client();



            Int32 login = get.loginUser(theUser, thePass);

            if (login == 1)
            {
                int profid = get.getprofileID(theUser);

                Session["id"]   = profid;
                Session["user"] = theUser;


                LblResult.Text = "success" + Session["id"] + Session["user"];

                Response.Redirect("MyProfile.aspx");
            }

            else if (login == -1)
            {
                Response.Redirect("Login.aspx");
                Response.Write("<script>alert('Incorrect User Name')</script>");
                LblResult.Text = "username";
            }

            else
            {
                Response.Redirect("Login.aspx");
                Response.Write("<script>alert('Incorrect Password')</script>");
                LblResult.Text = "password";
            }
        }