protected void SaveBtn_Click(object sender, EventArgs e)
        {
            UK_Film_Location_Class.UserDetails objUser = new UK_Film_Location_Class.UserDetails();

            HttpCookie myTestCookie = new HttpCookie("UKFilmLocationAdmin");
            myTestCookie = Request.Cookies["UKFilmLocationAdmin"];

            objUser.getUserFromEmail(myTestCookie.Value);

            objUser.FirstName = FirstName.Text;
            objUser.LastName = LastName.Text;
            objUser.Email = Email.Text;
            objUser.Password = Password.Text;

            objUser.Save();
        }
Ejemplo n.º 2
0
        protected void SaveBtn_Click(object sender, EventArgs e)
        {
            // Check Fields

            bool isOK = true;

            if (string.IsNullOrEmpty(FirstName.Text)) isOK = false;
            if (string.IsNullOrEmpty(LastName.Text)) isOK = false;
            if (string.IsNullOrEmpty(Email.Text)) isOK = false;
            if (string.IsNullOrEmpty(Password.Text)) isOK = false;

            if (!isOK) ErrorLabel.Text = "<div class=\"alert alert-danger\" role=\"alert\"><strong>Save Failed!</strong> Please check the details and try again.</div>";
            else
            {
                UK_Film_Location_Class.UserDetails objUser = new UK_Film_Location_Class.UserDetails();

                if (!string.IsNullOrEmpty(UserID.Value))
                {
                    objUser.getUserFromID(UserID.Value);
                }

                objUser.FirstName = FirstName.Text;
                objUser.LastName = LastName.Text;
                objUser.Email = Email.Text;
                objUser.Password = Password.Text;

                if (isAgent.Checked) objUser.isAgent = true;
                else objUser.isAgent = false;

                objUser.Address = Address.Text;
                objUser.Street = Street.Text;
                objUser.Town = Town.Text;
                objUser.County = County.Text;
                objUser.Postcode = Postcode.Text;
                objUser.Country = Country.Text;

                objUser.Save();

                Response.Redirect("/users.aspx");
            }
        }