/**
         * Get Date of Open Reports
         */
        protected void getObjects()
        {
            bool          blViewAll      = false;
            int           intNguoiDungID = (int)Commons.CheckUserInfo.GetUserId();
            List <string> lstRights      = ATCL_Commons.getRulesOfUser(entities);

            if (lstRights != null && lstRights.Count > 0)
            {
                if (lstRights.Contains(ATCL_Rules.RULE_LD_PTSPDVPM) || lstRights.Contains(ATCL_Rules.RULE_TK_PTSPDVPM))
                {
                    blViewAll = true;
                }
            }


            var lstOpenReports = entities.TBL_TIMESHEET.Where(x => (x.TT_XOA == false) && (blViewAll ? true : x.ID_NGUOI_TAO == intNguoiDungID)
                                                              )
                                 .Select(y => new TBL_TIMESHEET_VIEW()
            {
                ID                 = y.ID,
                ID_NGUOI_TAO       = y.ID_NGUOI_TAO,
                NGAY_BAO_CAO       = y.NGAY_BAO_CAO,
                KHO_KHAN_KIEN_NGHI = y.KHO_KHAN_KIEN_NGHI,
                SANG_KIEN          = y.SANG_KIEN
            }).OrderByDescending(z => z.NGAY_BAO_CAO).ToList();

            grvObjects.DataSource = lstOpenReports;
            grvObjects.DataBind();
        }
Exemple #2
0
        /**
         * Get Date of Open Reports
         */
        protected void getObjects()
        {
            bool          blViewAll      = false;
            int           intNguoiDungID = (int)Commons.CheckUserInfo.GetUserId();
            List <string> lstRights      = ATCL_Commons.getRulesOfUser(entities);

            if (lstRights != null && lstRights.Count > 0)
            {
                if (lstRights.Contains(ATCL_Rules.RULE_LD_PTSPDVPM) || lstRights.Contains(ATCL_Rules.RULE_TK_PTSPDVPM))
                {
                    blViewAll = true;
                }
            }
            blViewAll = true;


            var lstObjs = entities.TBL_HE_THONG.Where(x => (x.TT_XOA == false) && (blViewAll ? true : x.ID_NGUOI_TAO == intNguoiDungID) &&
                                                      (x.TT_DBHD == 1)
                                                      )
                          .Select(y => new TBL_HE_THONG_VIEW()
            {
                ID                    = y.ID,
                MA_HE_THONG           = y.MA_HE_THONG,
                TEN                   = y.TEN,
                MO_TA                 = y.MO_TA,
                ID_NGUOI_TAO          = y.ID_NGUOI_TAO,
                NGAY_BAT_DAU_LAM      = y.NGAY_BAT_DAU_LAM,
                NGAY_NGHIEM_THU_TT    = y.NGAY_NGHIEM_THU_TT,
                ID_PM                 = y.ID_PM,
                ID_PRODUCT_OWNER      = y.ID_PRODUCT_OWNER,
                ID_LOAI_TRIEN_KHAI_DA = y.ID_LOAI_TRIEN_KHAI_DA,
                ID_PHAM_VI_DA         = y.ID_PHAM_VI_DA,
                ID_TIEN_DO            = y.ID_TIEN_DO,
                ID_TRANG_THAI_DA      = y.ID_TRANG_THAI_DA
            }).OrderByDescending(z => z.NGAY_NGHIEM_THU_TT).ToList();

            grvObjects.DataSource = lstObjs;
            grvObjects.DataBind();
        }