private void initMain() { t.Interval = 1000; //in milliseconds t.Tick += new EventHandler(this.t_Tick); t.Start(); //this will use t_Tick() method thucHienCaID = "" + DateTime.Now.Day + "" + DateTime.Now.Month + "" + DateTime.Now.Year + ((DateTime.Now.Hour < 19) ? "S" : "C"); DBKip ntb = new DBKip(); ntb.updateComboBoxIdOnly(cbKip); DBKetNoi.initializeInstance(); DBKetNoi dbmg = DBKetNoi.getInstance(); SqlConnection con = dbmg.openDatabase(); string sql = "SELECT * FROM NhanVien ORDER BY MAKIP "; SqlDataAdapter dataadapter = new SqlDataAdapter(sql, con); DataSet ds = new DataSet(); dataadapter.Fill(ds, "NhanVien"); dGCaKip.DataSource = ds; dGCaKip.DataMember = "NhanVien"; dbmg.closeDatabase(); }
void resetFeilds() { DBKip ntb = new DBKip(); ntb.updateComboBoxIdOnly(cbKipNV); ntb.updateGridData(dGKip); DBKip dbKip = new DBKip(); dbKip.updateGridData(dGKip); DBNhanVien dbnv = new DBNhanVien(); dbnv.updateGridData(dGNhanVien); }