Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            var chartno      = int.Parse(textBox1.Text);
            var station      = textBox2.Text;
            var datedigitzed = dateTimePicker1.Value.ToString("yyyy/MM/dd");
            int season       = int.Parse(textBox4.Text);
            var dateon       = dateTimePicker2.Value.ToString("yyyy/MM/dd");
            var dateoff      = dateTimePicker3.Value.ToString("yyyy/MM/dd");

            con_db save_chart = new con_db();
            string sql        = "UPDATE  `charts` SET  `st_code` =  '" + station + "',`date_digitized` =  '" + datedigitzed + "',`season` =  '" + season + "',`date_on` =  '" + dateon + "',`date_off` =  '" + dateoff + "' WHERE  `chart_number` =  '" + chartno + "' LIMIT 1";

            if (save_chart.Update(sql))
            {
                MessageBox.Show("Data Updated Successfully");

                Dispose();
                chartmngmnt newform = new chartmngmnt();
                newform.ShowDialog();
            }
            else
            {
                MessageBox.Show("Failed to Update data");
            }
        }
Exemplo n.º 2
0
        private void button5_Click(object sender, EventArgs e)
        {
            con_db updatestation = new con_db();
            string thequery      = "UPDATE  `stations` SET  `st_name` =  '" + textBox2.Text + "',`st_code` =  '" + textBox3.Text + "'";

            if (updatestation.Update(thequery))
            {
                MessageBox.Show("Station Update Successfull");
            }
        }
Exemplo n.º 3
0
        private void queryforupdate()
        {
            try
            {
                string username = textusrername.Text;

                string thequery = ""; //= "INSERT INTO admns (admName, admPass,phone,dob,gender,email) VALUES ('"+username+"','"+password +"','"+phone+"','"+dob+"','"+gender+"','"+email+"')";
                if ((textpassword.Text == textverify.Text) && (textpassword.Text != ""))
                {
                    if (textacceslevel.Text == "Administrator")
                    {
                        thequery = "UPDATE  `admns` SET  `usrname` =  '" + textusrername.Text + "',`usrpswrd` =  '" + textpassword.Text + "',`phone` =  '" + textphone.Text + "',`dob` =  '" + dateTimedob.Text + "',`gender` =  '" + combogender.Text + "' WHERE  `admns`.`usrID` =  '" + globals.rowid + "' LIMIT 1";
                        // thequery = "UPDATE admns SET usrname= '" + textusrername.Text + "', usrpswrd= '" + textpassword.Text + "',phone= '" + textphone.Text + "',dob= '" + dateTimedob.Text + "', gender= '" + combogender.Text + "', email= '" + textemail.Text + "' ";
                    }
                    else if (textacceslevel.Text == "General User")
                    {
                        thequery = "UPDATE  `gnrlusers` SET  `usrname` =  '" + textusrername.Text + "',`usrpswrd` =  '" + textpassword.Text + "',`phone` =  '" + textphone.Text + "',`dob` =  '" + dateTimedob.Text + "',`gender` =  '" + combogender.Text + "' WHERE  `gnrlusers`.`usrID` =  '" + globals.rowid + "' LIMIT 1";
                    }
                    else
                    {
                        labelcantuser.Visible = true;
                    }
                    con_db updateuser = new con_db();

                    if (updateuser.Update(thequery))
                    {
                        MessageBox.Show("User Updated successfully");
                        Populate();
                    }
                    else
                    {
                        MessageBox.Show("User Update failed!!");
                    }
                }
                else
                {
                    labelcantuser.Text    = "Passwords Do Not Match Please Verify Your Password";
                    labelcantuser.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 4
0
        private void changepwd()
        {
            if ((textBox1.Text == textBox2.Text) && (textBox1.Text != ""))
            {
                string sql = "UPDATE gnrlusers SET usrpswrd='" + textBox1.Text + " ' WHERE usrname='" + globals.usernamme + "'";

                con_db changepwd = new con_db();
                if (changepwd.Update(sql))
                {
                    MessageBox.Show("Password Change Successfull");
                    Dispose();
                }
            }

            else
            {
                label3.Visible = true;
                textBox2.Clear();
                textBox1.Focus();
                textBox1.SelectAll();
            }
        }