private void update()
 {
     if (textBox7.Text == string.Empty || textBox3.Text == string.Empty || textBox4.Text == string.Empty || textBox5.Text == string.Empty)
     {
         MessageBox.Show("Please fill all the required fields");
     }
     else
     {
         try
         {
             {
                 int      d1  = int.Parse(textBox3.Text);
                 float    d2  = float.Parse(textBox4.Text);
                 float    d3  = float.Parse(textBox5.Text);
                 DateTime dt1 = DateTime.Parse(dateTimePicker1.Text);
                 Pharmacy_Yasir.update_user_database db = new update_user_database();
                 bool updatestock = db.updatestock(textBox7.Text, comboBox1.Text, d1, d2, d3, dt1);
                 MessageBox.Show("Record Updated Successfully");
                 textBox3.Clear(); textBox7.Clear(); textBox4.Clear(); textBox5.Clear();
                 show();
             }
         }
         catch (Exception)
         {
             MessageBox.Show("Database Error", "Error Code 8", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Пример #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                Pharmacy_Yasir.update_user_database db = new update_user_database();
                int      con            = int.Parse(textBox2.Text);
                DateTime date           = DateTime.Parse(dateTimePicker1.Text);
                bool     updateemployee = db.updateemployee(textBox1.Text, con, textBox3.Text, date, textBox4.Text);


                MessageBox.Show("Record Updated Successfully");
                textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear();
                show();
            }
            catch (Exception)
            {
                MessageBox.Show("Enter name to update", "Error Code 5", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            try

            {
                Pharmacy_Yasir.update_user_database db = new update_user_database();


                bool updatesupplier = db.updatesupplier(textBox1.Text, textBox2.Text, textBox3.Text);



                show();
                textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear();
            }
            catch (Exception)
            {
                MessageBox.Show("Fill all the required fields", "Error Code 5", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == string.Empty)
            {
                MessageBox.Show("Please fill the Required field");
            }
            else
            {
                try
                {
                    Pharmacy_Yasir.update_user_database db = new update_user_database();
                    bool updateemployee = db.updateproduct(comboBox1.Text, comboBox2.Text, textBox1.Text, textBox2.Text);


                    textBox1.Clear(); textBox2.Clear();
                    show();
                }
                catch (Exception)
                {
                    MessageBox.Show("Database Error", "Error Code 5", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }