Esempio n. 1
0
    protected void gvSubProduct_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string pid = gvSubProduct.DataKeys[e.RowIndex].Value.ToString();

        ado.ExecuteNonQueryByQuery("delete from subproduct where sid=" + pid);
        BindGrid();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();

        ds = ado.Get_DataSet("select uid from users where userid='" + txtUID.Text.Trim() + "' and password='******'");

        if (ds.Tables[0].Rows.Count > 0)
        {
            ado.ExecuteNonQueryByQuery("update users set password='******' where uid='" + ds.Tables[0].Rows[0][0].ToString() + "'");
            smslabel.Text = "<font color=green>Your password has been changed successfully.</font>";
        }
        else
        {
            smslabel.Text = "<font color=red>Invalid User ID/Password</font>";
        }
    }
Esempio n. 3
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string Gender = "Female";
        string Query  = "";
        int    flag   = 0;

        if (rdGender.SelectedIndex == 0)
        {
            Gender = "Male";
        }
        if (Request.QueryString["Change"] == null)
        {
            Query = "insert into users (FirstName,MiddleName,LastName,Gender,UserID,Password,Address,Mobile,Phone,MailId,AltMailID,UserType) " +
                    " values('" + txtFirstName.Text.Trim() + "','" + txtMName.Text.Trim() + "','" + txtLName.Text.Trim() + "','" + Gender + "','" + txtUserID.Text.Trim() + "','" + txtPass.Text.Trim() + "','" + txtAddress.Text.Trim() + "','" + txtMobile.Text.Trim() + "','" + txtPhone.Text.Trim() + "','" + txtEmail.Text.Trim() + "','" + txtAEmail.Text.Trim() + "',1)";
        }
        else if (Request.QueryString["Change"].ToString() == "1")
        {
            Query = "update users set FirstName='" + txtFirstName.Text.Trim() + "',MiddleName='" + txtMName.Text.Trim() + "',LastName='" + txtLName.Text.Trim() + "',Gender='" + Gender + "',Address='" + txtAddress.Text.Trim() + "',Mobile='" + txtMobile.Text.Trim() + "',Phone='" + txtPhone.Text.Trim() + "',MailId='" + txtEmail.Text.Trim() + "',AltMailID='" + txtAEmail.Text.Trim() + "' where uid=" + Session["UID"].ToString();
            flag  = 1;
        }
        int result = ado.ExecuteNonQueryByQuery(Query);

        if (result > 0)
        {
            if (flag == 0)
            {
                lblMessage.Text = "<font color=green>Your registration has been successfully done.</font>";
            }
            else
            {
                lblMessage.Text = "<font color=green>Your profile has been updated successfully.</font>";
                Response.Redirect("UserProfile.aspx");
            }
            ClearControls();
        }
        else
        {
            lblMessage.Text = "<font color=red>Some error has occurred.</font>";
        }
    }
Esempio n. 4
0
 public int Save(string Query)
 {
     return(ado.ExecuteNonQueryByQuery(Query));
 }