private void ucJobFeesAddEdit_VisibleChanged(object sender, EventArgs e)
        {
            Connection con = new Findstaff.Connection();

            connection = con.dbConnection();
            if (this.Visible == true)
            {
                connection.Open();
                cmd = "Select Jorder_id from joborder_t where cntrctstat = 'Active';";
                com = new MySqlCommand(cmd, connection);
                dr  = com.ExecuteReader();
                while (dr.Read())
                {
                    cbJobOrder1.Items.Add(dr[0]);
                }
                dr.Close();
                cmd = "Select feename from genfees_t;";
                com = new MySqlCommand(cmd, connection);
                dr  = com.ExecuteReader();
                while (dr.Read())
                {
                    cbFees1.Items.Add(dr[0]);
                }
                dr.Close();
                connection.Close();
            }
        }
Esempio n. 2
0
        private void ucJobFeesAddEdit_VisibleChanged(object sender, EventArgs e)
        {
            Connection con = new Findstaff.Connection();

            connection = con.dbConnection();
            connection.Open();
            cmd = "select jo.jorder_id'Job Order ID', count(jf.fee_id)'No. of Fees' from joborder_t jo join jobfees_t jf on jo.jorder_id = jf.jorder_id";
            using (connection)
            {
                using (MySqlDataAdapter adapter = new MySqlDataAdapter(cmd, connection))
                {
                    DataSet ds = new DataSet();
                    adapter.Fill(ds);
                    dgvJobFees.DataSource = ds.Tables[0];
                }
            }
            connection.Close();
        }