コード例 #1
0
        private void Parttime_Click(object sender, EventArgs e)
        {
            GridPart.Show();
            GridShow.Hide();
            GridFull.Hide();
            string          sql = "SELECT *,EMP_TIMEWORK * EMP_CHG_HOUR AS TOTAL FROM EMPLOYEE WHERE EMP_TYPE = 'P'";
            MySqlConnection con = new MySqlConnection("host = angsila.informatics.buu.ac.th; user = cs57160477; password = cs57160477; database = cs57160477");
            MySqlCommand    cmd = new MySqlCommand(sql, con);

            con.Open();
            GridPart.Rows.Clear();
            MySqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                string code  = reader.GetString("EMP_CODE");
                string fname = reader.GetString("EMP_FNAME");
                string lname = reader.GetString("EMP_LNAME");
                string hour  = reader.GetString("EMP_TIMEWORK");
                string chg   = reader.GetString("EMP_CHG_HOUR");
                string total = reader.GetString("TOTAL");
                GridPart.Rows.Add(code, fname, lname, hour, chg, total);
            }
            con.Close();
        }
コード例 #2
0
 private void Form7_Load(object sender, EventArgs e)
 {
     GridFull.Hide();
     GridPart.Hide();
 }