protected override void UpdateObject()
        {
            Metting metting = MettingServices.GetById(IntId);

            if (metting != null)
            {
                metting.DocumentID = VanBan.SelectedValue.ToInteger();
                MettingServices.Update(metting);
            }

            Redirector.Redirect(ViewNames.Province.DanhSachCuocHop);
        }
示例#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());
            }
        }
示例#3
0
        protected override void GetDataList()
        {
            if ("uid".ToUrlInteger() > 0)
            {
                if ("type".ToUrlString().Equals("nodoc"))
                {
                    switch ("status".ToUrlString())
                    {
                    case "late":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) > 3)).ToList();
                        break;

                    case "ontime":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) <= 3)).ToList();
                        break;

                    default:
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => item.DocumentID <= 0).ToList();
                        break;
                    }
                }
                else if ("type".ToUrlString().Equals("havedoc"))
                {
                    switch ("status".ToUrlString())
                    {
                    case "late":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) > 3)).ToList();
                        break;

                    case "ontime":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) <= 3)).ToList();
                        break;

                    default:
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => item.DocumentID > 0).ToList();
                        break;
                    }
                }
                else
                {
                    switch ("status".ToUrlString())
                    {
                    case "late":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) > 3) || (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) > 3)).ToList();
                        break;

                    case "ontime":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger())
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) <= 3) || (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) <= 3)).ToList();
                        break;

                    default:
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.StaffID == "uid".ToUrlInteger() || item.PresidentID == "uid".ToUrlInteger()).ToList();
                        break;
                    }
                }
            }
            else
            {
                if ("type".ToUrlString().Equals("nodoc"))
                {
                    switch ("status".ToUrlString())
                    {
                    case "late":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) > 3)).ToList();
                        break;

                    case "ontime":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) <= 3)).ToList();
                        break;

                    default:
                        BaseCollection = MettingServices.GetList();
                        break;
                    }
                }
                else if ("type".ToUrlString().Equals("havedoc"))
                {
                    switch ("status".ToUrlString())
                    {
                    case "late":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) > 3)).ToList();
                        break;

                    case "ontime":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) <= 3)).ToList();
                        break;

                    default:
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => item.DocumentID > 0).ToList();
                        break;
                    }
                }
                else
                {
                    switch ("status".ToUrlString())
                    {
                    case "late":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) > 3) || (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) > 3)).ToList();
                        break;

                    case "ontime":
                        BaseCollection = MettingServices.GetList()
                                         ?.Where(item => (item.DocumentID <= 0 && GetBusinessDays(item.Time, DateTime.Now) <= 3) || (item.DocumentID > 0 && GetBusinessDays(item.Time, item.Document.ReleaseDate) <= 3)).ToList();
                        break;

                    default:
                        BaseCollection = MettingServices.GetList();
                        break;
                    }
                }
            }
        }