protected void Button1_Click(object sender, EventArgs e)
 {
     Models.Connection   gcon = new Models.Connection();
     Models.ClearTextBox ct   = new Models.ClearTextBox();
     Models.Categories   cat  = new Models.Categories();
     cat.CatName = TextBox1.Text;
     cat.Add(cat);
     Response.Write("<script>alert('Successfully Inserted Category')</script>");
     //Response.Redirect("AdminHome.aspx");
     ct.ClearTextbox(TextBox1);
 }
Exemple #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Models.ClearTextBox ct = new Models.ClearTextBox();
     Models.Admin        ad = new Models.Admin();
     ad.email    = TextBox1.Text;
     ad.Name     = TextBox2.Text;
     ad.password = TextBox3.Text;
     ad.signUp(ad);
     Response.Write("<script>alert('Successfully Registered')</script>");
     Response.Redirect("AdminHome.aspx");
     ct.ClearTextbox(TextBox1, TextBox2, TextBox3);
 }
Exemple #3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Models.ClearTextBox ct    = new Models.ClearTextBox();
     Models.Users        users = new Models.Users();
     users.firstName = TextBox1.Text;
     users.lastName  = TextBox2.Text;
     users.email     = TextBox3.Text;
     users.password  = TextBox4.Text;
     users.address   = TextBox5.Text;
     users.city      = TextBox6.Text;
     users.state     = TextBox7.Text;
     users.pin       = TextBox8.Text;
     users.mobile    = TextBox9.Text;
     users.signUp(users);
     Response.Write("<script>alert('Successfully Registered')</script>");
     Response.Redirect("Login.aspx");
     ct.ClearTextbox(TextBox1, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, TextBox8, TextBox9);
 }
Exemple #4
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            Models.Connection   gcon = new Models.Connection();
            Models.ClearTextBox ct   = new Models.ClearTextBox();
            Models.Products     pro  = new Models.Products();
            pro.name        = TextBox1.Text;
            pro.description = TextBox2.Text;
            pro.price       = Convert.ToInt32(TextBox3.Text);
            pro.quantity    = Convert.ToInt32(TextBox4.Text);
            SqlCommand    com = new SqlCommand("select Cid from CategoryView where CategoryName ='" + DropDownList1.Text + "'", gcon.getConnection());
            SqlDataReader rd  = com.ExecuteReader();

            while (rd.Read())
            {
                pro.categoryID = Convert.ToInt32(rd["Cid"].ToString());
            }
            pro.path = Label1.Text;
            pro.Add(pro);
            Response.Write("<script>alert('Successfully Inserted Product')</script>");
            //Response.Redirect("AdminHome.aspx");
            ct.ClearTextbox(TextBox1, TextBox2, TextBox3, TextBox4);
            Label1.Text     = "";
            Image1.ImageUrl = "";
        }