Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            frm_employee frm = new frm_employee();

            Cursor.Current = Cursors.WaitCursor;
            frm.dataGridView1.DataSource = null;
            frm.dataGridView1.DataSource = client.getCleint();
            for (int i = 0; i < client.get_role_and_department().Rows.Count; i++)
            {
                frm.combo_role.Items.Add(client.get_role_and_department().Rows[i][1]);
                frm.combo_department.Items.Add(client.get_role_and_department().Rows[i][2]);
            }


            List <object> departments = new List <object>();

            foreach (object o in frm.combo_department.Items)
            {
                if (!departments.Contains(o))
                {
                    departments.Add(o);
                }
            }
            frm.combo_department.Items.Clear();
            frm.combo_department.Items.AddRange(departments.ToArray());

            List <object> roles = new List <object>();

            foreach (object o in frm.combo_role.Items)
            {
                if (!roles.Contains(o))
                {
                    roles.Add(o);
                }
            }
            frm.combo_role.Items.Clear();
            frm.combo_role.Items.AddRange(roles.ToArray());

            for (int i = 0; i < client.get_type_of_salary().Rows.Count; i++)
            {
                frm.combo_type_of_salary.Items.Add(client.get_type_of_salary().Rows[i][0]);
            }

            if (frm.combo_type_of_salary.Items.Count != 0)
            {
                frm.combo_department.SelectedIndex     = 0;
                frm.combo_role.SelectedIndex           = 0;
                frm.combo_type_of_salary.SelectedIndex = 0;
            }

            //frm.txt_am_shift_value.Text = client.getConstants(Convert.ToInt32(txt_role_dept_id.Text))().Rows[0][4].ToString();
            // frm.txt_pm_shift_value.Text = client.getConstants(Convert.ToInt32(txt_role_dept_id.Text))().Rows[0][5].ToString();
            frm.txt_month.Text = dateTimePicker1.Value.Month.ToString();
            frm.txt_year.Text  = dateTimePicker1.Value.Year.ToString();
            Cursor.Current     = Cursors.Default;

            frm.ShowDialog();
        }
Beispiel #2
0
      private void button1_Click_1(object sender, EventArgs e)
      {
          frm_employee frm = new frm_employee();

          for (int i = 0; i < dataGridView1.Rows.Count; i++)
          {
              bool is_checked = Convert.ToBoolean(dataGridView1.Rows[i].Cells[0].Value);
              if (is_checked == true)
              {
                  client.add_piad_sallary(Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value), dateTimePicker1.Value, Convert.ToDouble(dataGridView1.Rows[i].Cells[5].Value), comb_month.SelectedItem.ToString(), combo_year.SelectedItem.ToString());
                  client.update_client_sallary_state(Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value), dateTimePicker1.Value.Month.ToString(), dateTimePicker1.Value.Year.ToString(), "received");
              }
          }

          dataGridView1.Update();
          MessageBox.Show("تم التسليم بنجاح");
      }
Beispiel #3
0
        public frm_add_employee(Form callingForm)
        {
            mainForm = callingForm as frm_employee;

            InitializeComponent();
        }