Exemple #1
0
        private void save_transcation()
        {
            string text = this.textBoxName.Text;
            string str2 = this.textBoxP1.Text;
            string str3 = this.textBoxP2.Text;
            string str4 = this.textBox1.Text;

            if (!(!text.Equals("") && str2.Equals(str3)))
            {
                MessageBox.Show("Check Again!");
            }
            else
            {
                string    query   = "Select pass from firoz_center.tbl_user where name='" + text + "';";
                DBConnect connect = new DBConnect();
                string    str6    = connect.SelectSingle(query);
                if (str4.Equals(str6) && str2.Equals(str3))
                {
                    string str7 = "Update firoz_center.tbl_user set pass = '******' where name = '" + text + "'";
                    connect.Update(str7);
                    MessageBox.Show("Updtaed");
                    base.Dispose();
                }
                else
                {
                    MessageBox.Show("Wrong password!");
                }
            }
        }
Exemple #2
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to save changes?", "Save Changes", MessageBoxButtons.YesNo) != DialogResult.No)
            {
                string query;

                query = "Update firoz_center.tbl_party_transcation set invoice_no = '" + textBoxNew.Text + "' where invoice_no='" + textBoxOld.Text + "'";
                dbc.Update(query);

                query = "Update firoz_center.tbl_purchase set invoice_no = '" + textBoxNew.Text + "' where invoice_no='" + textBoxOld.Text + "'";
                dbc.Update(query);

                query = "Update firoz_center.tbl_transcation set invoice_no = '" + textBoxNew.Text + "' where invoice_no='" + textBoxOld.Text + "'";
                dbc.Update(query);

                query = "Update firoz_center.tbl_vehicle set invoice_no = '" + textBoxNew.Text + "' where invoice_no='" + textBoxOld.Text + "'";
                dbc.Update(query);

                new UpdatePurchaseInvoice().Show();
                base.Close();
            }
        }
        private void save_transcation()
        {
            DBConnect connect = new DBConnect();
            string    text    = this.textBoxName.Text;
            string    str2    = this.textBoxAddress.Text;
            string    str3    = this.textBoxContact.Text;
            string    str4    = this.textBoxAC.Text;
            string    query   = "UPDATE firoz_center.tbl_bank_info set name='" + text + "', address='" + str2 + "', contact='" + str3 + "',ac_no='" + str4 + "' where bank_id = '" + this.Bank[0].ElementAt <string>(this.comboBoxBank.SelectedIndex) + "';";

            connect.Update(query);
            base.Dispose();
            MessageBox.Show("Data Updated");
        }
        private void save_transcation()
        {
            string text = this.textBoxName.Text;
            string str2 = this.textBoxAddress.Text;
            string str3 = this.textBoxContact.Text;
            string str4 = this.textBoxPosition.Text;
            string str5 = this.dateTimePicker1.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
            string str6 = this.textBoxSalary.Text;
            string str7 = "Active";

            if (this.checkBox1.Checked)
            {
                str7 = "Active";
            }
            else
            {
                str7 = "Inactive";
            }
            if ((((text.Equals("") || str2.Equals("")) || (str3.Equals("") || str4.Equals(""))) || str5.Equals("")) || str6.Equals(""))
            {
                MessageBox.Show("Check Data Again");
            }
            else
            {
                string query = "update firoz_center.tbl_employee set name='" + text + "', address='" + str2 + "', contact='" + str3 + "', position='" + str4 + "', salary='" + str6 + "', joinDate='" + str5 + "', status='" + str7 + "' where employeeId='" + this.Employee[0].ElementAt <string>(this.comboBoxEmployee.SelectedIndex) + "';";
                dbc.Update(query);
                this.textBoxName.Text     = "";
                this.textBoxContact.Text  = "";
                this.textBoxAddress.Text  = "";
                this.textBoxSalary.Text   = "";
                this.textBoxPosition.Text = "";
                this.checkBox1.Checked    = false;
                this.load_party();
                MessageBox.Show("Data Updated");
            }
        }
        private void buttonSave_Click(object sender, EventArgs e)
        {
            string name = textBoxName.Text;
            string sql  = "";

            if (checkBoxStatus.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `status`='inactive' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `status`='active' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox1.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab1`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab1`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox2.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab2`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab2`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox3.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab3`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab3`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox4.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab4`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab4`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox5.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab5`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab5`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox6.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab6`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab6`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox7.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab7`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab7`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox8.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab8`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab8`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            if (checkBox9.Checked.Equals(true))
            {
                sql = "update firoz_center.tbl_user set `tab9`='True' where name='" + name + "';";
            }
            else
            {
                sql = "update firoz_center.tbl_user set `tab9`='False' where name='" + name + "';";
            }
            dbc.Update(sql);

            MessageBox.Show("User Access Level Updated");
            this.Dispose();
        }