예제 #1
0
        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);

            }
        }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
        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);

            }
        }
예제 #5
0
 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;
 }