public DataTable TimKiem(DateTime InputNgayDauTuan) { try { string sql = "select llv.*, nv.NAME from LICH_LAM_VIEC llv, DM_NHAN_VIEN nv where nv.ID = llv.NV_ID and NGAY_DAU_TUAN = @NGAY_DAU_TUAN order by nv.NAME"; ds = new DataSet(); db = HelpDB.getDatabase(); cmd = db.GetSQLStringCommand(sql); db.AddInParameter(cmd, "@NGAY_DAU_TUAN", System.Data.DbType.DateTime, InputNgayDauTuan); db.LoadDataSet(cmd, ds, "LICH_LAM_VIEC"); return ds.Tables[0]; } catch (Exception ex) { throw new Exception(ex.Message); } }
public DataTable getLichMoiNhat() { string sql = "SELECT llv.*,nv.NAME " + "FROM LICH_LAM_VIEC llv , DM_NHAN_VIEN nv " + "WHERE nv.ID = llv.NV_ID " + "AND llv.NGAY_DAU_TUAN = (SELECT MAX(llv1.NGAY_DAU_TUAN) FROM LICH_LAM_VIEC llv1) " + "AND 1=1 ORDER BY nv.NAME DESC"; db = HelpDB.getDatabase(); ds = db.LoadDataSet(sql,"AA"); if (ds != null) return ds.Tables[0]; return null; }
public bool Exist_LichTuanNhanVien(DateTime Ngay, long NV_ID) { string sql = "select * from LICH_LAM_VIEC where NV_ID = @NV_ID and NGAY_DAU_TUAN = @NGAY"; db = HelpDB.getDatabase(); cmd = db.GetSQLStringCommand(sql); db.AddInParameter(cmd, "@NV_ID", DbType.Int64, NV_ID); db.AddInParameter(cmd, "@NGAY", DbType.DateTime, Ngay); if (db.LoadDataSet(cmd, "AA").Tables[0].Rows.Count > 0) return true; return false; }
public DataTable getLichCoDinh() { try { string sql = "select llv.*, nv.NAME " + "from LICH_LAM_VIEC llv, DM_NHAN_VIEN nv " + "where nv.ID = llv.NV_ID " + "and NGAY_DAU_TUAN is null order by nv.NAME"; ds = new DataSet(); db = HelpDB.getDatabase(); cmd = db.GetSQLStringCommand(sql); db.LoadDataSet(cmd, ds, "LICH_LAM_VIEC"); return ds.Tables[0]; } catch (Exception ex) { throw new Exception(ex.Message); } }
public bool Exist_LCDNhanVien(long NV_ID) { string sql = "select * from LICH_LAM_VIEC where NV_ID = @NV_ID and NGAY_DAU_TUAN is null"; db = HelpDB.getDatabase(); cmd = db.GetSQLStringCommand(sql); db.AddInParameter(cmd, "@NV_ID", DbType.Int64, NV_ID); DataSet ds = new DataSet(); db.LoadDataSet(cmd, ds, "AA"); if (ds.Tables[0].Rows.Count > 0) return true; return false; }