private void ShowDate() { KJ128NDataBase.DBAcess dbAcess = new KJ128NDataBase.DBAcess(); DataTable dtInStationTable = dbAcess.GetDataSet("select * from KJ128N_RT_InStation_Table order by 发码器地址").Tables[0]; dgvInOutStationInfo.DataSource = dtInStationTable.DefaultView; }
private void timer1_Tick(object sender, EventArgs e) { KJ128NDataBase.DBAcess dbAcess = new KJ128NDataBase.DBAcess(); using (DataSet ds = dbAcess.GetDataSet("Select * from KJ128_RealTimeEmployee_Info_Table")) { dgvRealTimeEmployeeInfo.DataSource=ds.Tables[0].DefaultView; } dgvRealTimeEmployeeInfo.EnableHeadersVisualStyles = false; timer1.Interval = 5000; }
private void timer1_Tick(object sender, EventArgs e) { KJ128NDataBase.DBAcess dbAcess = new KJ128NDataBase.DBAcess(); using (DataSet ds = dbAcess.GetDataSet("Select * from KJ128_RealTimeEmployee_Info_Table")) { dgvRealTimeEmployeeInfo.DataSource = ds.Tables[0].DefaultView; } dgvRealTimeEmployeeInfo.EnableHeadersVisualStyles = false; timer1.Interval = 5000; }
// 将所有菜单添加到表中 private void SetMenuAll(ToolStripItemCollection items) { KJ128NDataBase.DBAcess dba = new KJ128NDataBase.DBAcess(); foreach (ToolStripMenuItem tsi in items) { string str = string.Format("insert into menus1(PMenuID,Title,name) values({2},'{0}','{1}')", tsi.Text.Substring(0, tsi.Text.Length - 4), tsi.Name , tsi.Text.IndexOf("1") > -1 ? "-1" : dba.ExecuteScalarSql("select id from menus1 where name ='" + tsi.OwnerItem.Name + "'")); dba.ExecuteSql(str); System.IO.File.AppendAllText("c:/sql.txt", str + "\r\n", Encoding.Default); if (tsi.DropDownItems.Count > 0) { SetMenuAll(tsi.DropDownItems); } } }
public DataTable GetPhotoTab(int PhotoID) { sqlString = string.Format("select * from Emp_Photo where PhotoID={0}", PhotoID); KJ128NDataBase.DBAcess dbAcess = new KJ128NDataBase.DBAcess(); using (DataSet ds = dbAcess.GetDataSet(sqlString)) { if (ds != null) { return(ds.Tables[0]); } else { return(null); } } }
/// <summary> /// 获取职务Table /// </summary> /// <returns>返回职务Table</returns> public DataTable GetEmpDutyTab() { sqlString = "select DutyID,职务名称 from KJ128N_Duty_Info_Table"; KJ128NDataBase.DBAcess dbAcess = new KJ128NDataBase.DBAcess(); using (DataSet ds = dbAcess.GetDataSet(sqlString)) { if (ds != null) { return(ds.Tables[0]); } else { return(null); } } }
public DataTable GetPhotoTab(int PhotoID) { sqlString = string.Format("select * from Emp_Photo where PhotoID={0}", PhotoID); KJ128NDataBase.DBAcess dbAcess = new KJ128NDataBase.DBAcess(); using (DataSet ds = dbAcess.GetDataSet(sqlString)) { if (ds != null) { return ds.Tables[0]; } else { return null; } } }
/// <summary> /// 获取职务Table /// </summary> /// <returns>返回职务Table</returns> public DataTable GetEmpDutyTab() { sqlString = "select DutyID,职务名称 from KJ128N_Duty_Info_Table"; KJ128NDataBase.DBAcess dbAcess = new KJ128NDataBase.DBAcess(); using (DataSet ds = dbAcess.GetDataSet(sqlString)) { if (ds != null) { return ds.Tables[0]; } else { return null; } } }