Exemple #1
0
        public string GetColor(DateTime mettingTime, int documentID)
        {
            if (documentID <= 0)
            {
                if (HolidayServices.GetBusinessDays(mettingTime, DateTime.Now) > 3)
                {
                    return("text-out-term");
                }
                else
                {
                    return("");
                }
            }
            else
            {
                Document document = DocumentServices.GetById(documentID);

                if (HolidayServices.GetBusinessDays(mettingTime, document.ReleaseDate) > 3)
                {
                    return("text-out-term");
                }
                else
                {
                    return("");
                }
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Authenticator.CheckRole(UserRole.ChuyenVienVPUBNDTinh))
            {
                RequestDetail.BindData(RequestServices.LaySoLieuThongKe(MaNguoiTheoDoi: Sessions.UserID).WrapInList());

                NoDocumentOnTime = MettingServices.GetList()
                                   ?.Where(item => item.StaffID == Sessions.UserID)
                                   ?.Where(item => (item.DocumentID <= 0 && HolidayServices.GetBusinessDays(item.Time, DateTime.Now) <= 3)).Count() ?? 0;

                NoDocumentLate = MettingServices.GetList()
                                 ?.Where(item => item.StaffID == Sessions.UserID)
                                 ?.Where(item => (item.DocumentID <= 0 && HolidayServices.GetBusinessDays(item.Time, DateTime.Now) > 3)).Count() ?? 0;

                DocumentOnTime = MettingServices.GetList()
                                 ?.Where(item => item.StaffID == Sessions.UserID)
                                 ?.Where(item => (item.DocumentID > 0 && HolidayServices.GetBusinessDays(item.Time, item.Document.ReleaseDate) <= 3)).Count() ?? 0;

                DocumentLate = MettingServices.GetList()
                               ?.Where(item => item.StaffID == Sessions.UserID)
                               ?.Where(item => (item.DocumentID > 0 && HolidayServices.GetBusinessDays(item.Time, item.Document.ReleaseDate) > 3)).Count() ?? 0;
            }
            else if (Authenticator.CheckRole(UserRole.LanhDaoUBNDTinh, UserRole.LanhDaoVPUBNDTinh))
            {
                RequestDetail.BindData(RequestServices.LaySoLieuThongKe(MaLanhDao: Sessions.UserID).WrapInList());

                NoDocumentOnTime = MettingServices.GetList()
                                   ?.Where(item => item.PresidentID == Sessions.UserID)
                                   ?.Where(item => (item.DocumentID <= 0 && HolidayServices.GetBusinessDays(item.Time, DateTime.Now) <= 3)).Count() ?? 0;

                NoDocumentLate = MettingServices.GetList()
                                 ?.Where(item => item.PresidentID == Sessions.UserID)
                                 ?.Where(item => (item.DocumentID <= 0 && HolidayServices.GetBusinessDays(item.Time, DateTime.Now) > 3)).Count() ?? 0;

                DocumentOnTime = MettingServices.GetList()
                                 ?.Where(item => item.PresidentID == Sessions.UserID)
                                 ?.Where(item => (item.DocumentID > 0 && HolidayServices.GetBusinessDays(item.Time, item.Document.ReleaseDate) <= 3)).Count() ?? 0;

                DocumentLate = MettingServices.GetList()
                               ?.Where(item => item.PresidentID == Sessions.UserID)
                               ?.Where(item => (item.DocumentID > 0 && HolidayServices.GetBusinessDays(item.Time, item.Document.ReleaseDate) > 3)).Count() ?? 0;
            }
            else if (Sessions.AgencyID > 0)
            {
                RequestDetail.BindData(RequestServices.LaySoLieuThongKe(MaDonVi: Sessions.AgencyID).WrapInList());
            }
        }