Ejemplo n.º 1
0
        public virtual void OnClick(Object sender, EventArgs e)
        {
            User          user          = new User(userId.Text, password.Text, phone.Text, mail.Text, ButtonRadio.SelectedItem.ToString());
            SqlConnection sqlConnection = Connection.getDetails();
            Repositary    repositary    = new Repositary();
            int           retRows       = repositary.AddAdmin(sqlConnection, user);

            if (retRows >= 1)
            {
                Response.Redirect("Jewellary.aspx");
            }
            else
            {
                Response.Write("Not Registered...");
            }
        }
        public virtual void OnClicks(Object sender, EventArgs e)
        {
            User          users         = new User(userId.Text, password.Text, ButtonRadio.SelectedItem.ToString());
            SqlConnection sqlConnection = Connection.getDetails();
            Repositary    repositary    = new Repositary();
            int           retRows       = repositary.Login(sqlConnection, users);

            if (retRows == 1)
            {
                string message = "Login successfully.";
                string script  = "window.onload = function(){ alert('";
                script += message;
                script += "')};";
                ClientScript.RegisterStartupScript(this.GetType(), "SuccessMessage", script, true);
            }
            else
            {
                Response.Write("Login failed...");
            }
        }