public static List <Users> GetData()
        {
            DDL          dbCall   = new DDL();
            List <Users> lstUsers = dbCall.GetUsers();

            return(lstUsers);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            int      output  = 0;
            Products product = new Products();

            product.PartyName    = txtPartyName.Text;
            product.MaterialType = txtMaterialType.Text;
            product.Color        = txtColor.Text;
            product.ProductCost  = Convert.ToInt64(txtProductCost.Text);
            product.Quantity     = Convert.ToInt64(txtQuantity.Text);

            DDL dBCall = new DDL();

            output            = dBCall.AddStudent(product);
            lblOutput.Visible = true;
            if (output > 0)
            {
                ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript: fnShowMessage('Record saved successfully'); ", true);
                Response.Redirect("~/ProductDetails.aspx");
            }
            else
            {
                ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript: fnShowMessage('Record already exists with the PartyName'); ", true);
            }

            //AddStudent
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("~/LoginInfo.aspx");
            }
            DDL          dl      = new DDL();
            List <Users> lstUser = dl.GetUsers();

            rvDisplayUser.DataSource = lstUser;
            rvDisplayUser.DataBind();
        }
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            int output = 0;

            string name     = txtName.Text;
            int    age      = Convert.ToInt32(txtAge.Text);
            long   mobileNo = Convert.ToInt64(txtMobileNo.Text);
            string email    = txtEmail.Text;

            DDL dl = new DDL();

            output = dl.RegisterUser(name, age, mobileNo, email);

            if (output > 0)
            {
                ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript: fnShowMessage('Record saved successfully'); ", true);
            }
            else
            {
                ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript: fnShowMessage('Record already exists'); ", true);
            }
        }