Example #1
0
 /// <summary>
 /// Updates the current page and runs the read page function
 /// Called outside
 /// </summary>
 public void UpdatePage(Page _newPage, PageOption _option)
 {
     character.GetComponent <Animator>().SetTrigger(_option.triggerA.ToString());
     currentPage = _newPage;
     ReadResources(_option);
     ReadPage();
 }
Example #2
0
        public async Task <PageResult <InfoLogDto> > GetInfoLogPageListAsync(PageOption pageOption, string controllerName = null, string actionName = null)
        {
            Expression <Func <Sys_Info_Log, bool> > exp = p => true;

            if (!string.IsNullOrEmpty(controllerName))
            {
                exp = exp.And(c => c.ControllerName == controllerName);
            }
            if (!string.IsNullOrEmpty(actionName))
            {
                exp = exp.And(c => c.ActionName == actionName);
            }
            var query = await _unitOfWork.SysInfoLogRep.QueryAsync(exp);

            var dtoQuery = query.Select(c => new InfoLogDto()
            {
                ID             = c.ID,
                ActionName     = c.ActionName,
                ControllerName = c.ControllerName,
                HttpStatusCode = c.HttpStatusCode,
                IPAddress      = c.IPAddress.Replace("::1", "localhost").Replace("::ffff:", ""),
                UserID         = c.UserID,
                LoginName      = c.LoginName,
                Method         = c.HttpType,
                Parameter      = c.Parameters,
                SystemName     = c.SystemName,
                Url            = c.URL,
                OperateTime    = c.OperateTime
            });
            var pageList = new PageResult <InfoLogDto>(dtoQuery, pageOption);

            return(pageList);
        }
Example #3
0
        public async Task <PageResult <ErrorLogDto> > GetErrorLogPageListAsync(PageOption pageOption, string controllerName = null, string actionName = null)
        {
            Expression <Func <Sys_Error_Log, bool> > exp = p => true;

            if (!string.IsNullOrEmpty(controllerName))
            {
                exp = exp.And(c => c.ControllerName == controllerName);
            }
            if (!string.IsNullOrEmpty(actionName))
            {
                exp = exp.And(c => c.ActionName == actionName);
            }
            var query = await _unitOfWork.SysErrorLogRep.QueryAsync(exp);

            var dtoQuery = query.Select(c => new ErrorLogDto()
            {
                ID             = c.ID,
                ActionName     = c.ActionName,
                ControllerName = c.ControllerName,
                IpAddress      = c.IPAddress,
                UserID         = c.UserID,
                LoginName      = c.LoginName,
                HttpType       = c.HttpType,
                Parameter      = c.Parameters,
                SystemName     = c.SystemName,
                Url            = c.URL,
                ErrorMessage   = c.ErrorSource,
                Message        = c.Message
            });
            var pageList = new PageResult <ErrorLogDto>(dtoQuery, pageOption);

            return(pageList);
        }
Example #4
0
 public async Task <IPagedList <BuyOutLoan> > PageByLoanBorrower(PageOption pageOption, long loanBorrowerId)
 {
     return(await entity.Where(e => e.LoanBorrowerId == loanBorrowerId)
            .Include(e => e.LoanBorrower)
            .OrderByDescending(e => e.Id)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
Example #5
0
 public async Task <IPagedList <ExistingLoan> > PageByLoanBorrower(PageOption pageOption, long loanBorrowerId)
 {
     return(await this.entity
            .Where(e => e.LoanBorrowerId == loanBorrowerId)
            .OrderByDescending(e => e.DisbursalDate)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
 public async Task <IPagedList <ImageGroup> > PageByLoanApplication(PageOption pageOption, long loanApplicationId)
 {
     return(await entity
            .Where(e => e.LoanApplicationId == loanApplicationId)
            .OrderBy(e => e.Label)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
 public async Task <IPagedList <SavingsDeposit> > PageByLoanBorrower(PageOption pageOption, long loanBorrowerId)
 {
     return(await this.context.SavingsDeposits
            .Include(e => e.DailyBalances)
            .Where(e => e.LoanBorrowerId == loanBorrowerId)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
Example #8
0
 public async Task <IPagedList <IEntity> > PaginateAsync(PageOption pageOption)
 {
     return(await this.entity
            .AsNoTracking()
            .OrderByDescending(e => e.Id)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
 public new async Task <IPagedList <SavingsDeposit> > PaginateAsync(PageOption pageOption)
 {
     return(await this.entity
            .Include(e => e.DailyBalances)
            .OrderByDescending(e => e.Id)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
Example #10
0
        public ActionResult Index(MeetingSearch search)
        {
            var             dataSet  = imeeting.GetMeetingList(search.MeetingType, search.PageIndex ?? 1, PageSize);
            List <mMeeting> modeList = null;

            try
            {
                if (dataSet != null)
                {
                    int count = GetDataSetCount(dataSet.Tables[1]);
                    modeList = GetDataSetList(dataSet.Tables[0]);

                    PageOption pageOption = new PageOption()
                    {
                        PageIndex = Convert.ToInt32(search.PageIndex),
                        PageSize  = (count + PageSize - 1) / PageSize,
                        PageCount = count,
                        PageType  = search.PageType
                    };

                    ViewBag.pageOption = pageOption;
                }
            }
            catch (Exception ex)
            {
                log.Error("Index-" + DateTime.Now.ToString(), ex);
            }

            if (search.PageType == 1)
            {
                return(PartialView("Table", modeList));
            }
            return(View(modeList));
        }
Example #11
0
        public async Task <PageResult> GetPageListAsync(PageOption pageOption, string strSearch = null)
        {
            Expression <Func <Sys_Dept, bool> > exp = p => true;

            if (!string.IsNullOrEmpty(strSearch))
            {
                exp = exp.And(c =>
                              c.ID.ToString().Contains(strSearch) ||
                              c.Name.Contains(strSearch) ||
                              c.Code.Contains(strSearch));
            }
            var query = from item in _unitOfWork.SysDeptRep.Query.Where(exp)
                        join tItem in _unitOfWork.SysDeptRep.Query
                        on item.ParentID equals tItem.ID into temp
                        from pItem in temp.DefaultIfEmpty()
                        select new DeptDto()
            {
                DeptID     = item.ID,
                DeptName   = item.Name,
                ParentID   = item.ParentID,
                ParentName = pItem.Name,
                Code       = item.Code,
                Sort       = item.Sort
            };

            return(await query.ToPageResultAsync(pageOption));
        }
Example #12
0
        public async Task <PageResult> GetPageListAsync(PageOption pageOption, string strSearch = null)
        {
            Expression <Func <Sys_Menu, bool> > exp = p => true;

            if (!string.IsNullOrEmpty(strSearch))
            {
                exp = exp.And(c =>
                              c.ID.ToString().Contains(strSearch) ||
                              c.Name.Contains(strSearch));
            }
            var query = from menu in _unitOfWork.SysMenuRep.Query.Where(exp)
                        join tItem in _unitOfWork.SysMenuRep.Query
                        on menu.ParentID equals tItem.ID into temp
                        from pMenu in temp.DefaultIfEmpty()
                        select new MenuDto()
            {
                MenuID     = menu.ID,
                MenuName   = menu.Name,
                ParentID   = menu.ParentID,
                ParentName = pMenu.Name,
                URL        = menu.URL,
                Sort       = menu.Sort,
                Icon       = menu.Icon
            };

            return(await query.ToPageResultAsync(pageOption));
        }
Example #13
0
        public void OnGet(int?current, int?size, string q, List <int> tags)
        {
            FilterTags = tags;

            var po = new PageOption();

            po.Current = current ?? 1;
            po.Size    = size ?? 15;
            int skipNum = (po.Current - 1) * po.Size;

            IQueryable <Project> query;
            IQueryable <int>     pidList = null;
            bool hasTag = tags.Count > 0;

            if (hasTag)
            {
                IQueryable <ProjectTag> projectList = _context.ProjectTag;
                foreach (var item in tags)
                {
                    projectList = projectList.Where(t => t.TagId == item);
                }
                pidList = projectList.Select(t => t.ProjectId);
            }

            query = from p in _context.Project
                    where (string.IsNullOrEmpty(q) || (p.Name.Contains(q) || p.Title.Contains(q) || p.Description.Contains(q) || p.Address.Contains(q))) &&
                    (!hasTag || pidList.Contains(p.Id))
                    orderby p.AddTime descending
                    select p;

            po.Count   = query.Count();
            Project    = query.Skip(skipNum).Take(po.Size).ToList();
            PageOption = po;
        }
 public new async Task <IPagedList <LoanApplication> > PaginateAsync(PageOption pageOption)
 {
     return(await this.entity
            .AsNoTracking()
            .Include(e => e.LoanBorrowers)
            .OrderByDescending(e => e.Id)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
 public async Task <IPagedList <CreditInvestigation> > PageByLoanBorrower(PageOption pageOption, long loanBorrowerId)
 {
     return(await this.entity
            .Include(x => x.LoanBorrower)
            .Where(x => x.LoanBorrowerId == loanBorrowerId)
            .OrderByDescending(e => e.Id)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
 public async new Task <IPagedList <BusinessTypeExpenseGroup> > PaginateAsync(PageOption pageOption)
 {
     return(await this.entity
            .Include(e => e.BusinessType)
            .OrderByDescending(e => e.Id)
            .AsNoTracking()
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
Example #17
0
 public new async Task <IPagedList <BusinessCostOfSale> > PaginateAsync(PageOption pageOption)
 {
     return(await this.entity
            .AsNoTracking()
            .Include(e => e.Business)
            .OrderByDescending(e => e.Id)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
Example #18
0
 public async Task <IPagedList <Business> > PageByLoanApplication(PageOption pageOption, long loanApplicationId)
 {
     return(await this.entity
            .Include(e => e.BusinessType)
            .Where(e => e.LoanApplicationId == loanApplicationId)
            .OrderByDescending(e => e.Id)
            .AsNoTracking()
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
 public async Task <IPagedList <LoanApplication> > PageUserApplications(PageOption pageOption, string userName)
 {
     return(await this.entity
            .AsNoTracking()
            .Include(e => e.LoanBorrowers)
            .Where(e => e.UserLoanApplications.Any(u => u.CreatedBy == userName) || e.CreatedBy == userName)
            .OrderByDescending(e => e.Id)
            .ToPagedListAsync(pageOption.Page, pageOption.PageSize));
 }
        public async Task <IPagedList <ImageGroupResponse> > PageByLoanApplication(PageOption pageOption, long loanApplicationId)
        {
            IPagedList <ImageGroup> entities = await repository.PageByLoanApplication(pageOption, loanApplicationId);

            IEnumerable <ImageGroupResponse> entitiesDTO = mapper.Map <IEnumerable <ImageGroupResponse> >(entities);

            IPagedList <ImageGroupResponse> pagedDTO = new StaticPagedList <ImageGroupResponse>(entitiesDTO, entities.GetMetaData());

            return(pagedDTO);
        }
Example #21
0
        public async Task <IPagedList <BusinessResponseDTO> > PageByLoanApplication(PageOption pageOption, long loanApplicationId)
        {
            IPagedList <Business> entities = await this.repository.PageByLoanApplication(pageOption, loanApplicationId);

            IEnumerable <BusinessResponseDTO> entitiesDTO = mapper.Map <IEnumerable <BusinessResponseDTO> >(entities);

            IPagedList <BusinessResponseDTO> pagedDTO = new StaticPagedList <BusinessResponseDTO>(entitiesDTO, entities.GetMetaData());

            return(pagedDTO);
        }
Example #22
0
        public async Task <IPagedList <SavingsDepositResponse> > PageByLoanBorrower(PageOption pageOption, long loanBorrowerId)
        {
            IPagedList <SavingsDeposit> entities = await this.repository.PageByLoanBorrower(pageOption, loanBorrowerId);

            IEnumerable <SavingsDepositResponse> entitiesDTO = mapper.Map <IEnumerable <SavingsDepositResponse> >(entities);

            IPagedList <SavingsDepositResponse> pagedDTO = new StaticPagedList <SavingsDepositResponse>(entitiesDTO, entities.GetMetaData());

            return(pagedDTO);
        }
        public async Task <IPagedList <IEntityResponseDTO> > PaginateAsync(PageOption pageOption)
        {
            IPagedList <IEntity> entities = await this.repository.PaginateAsync(pageOption);

            IEnumerable <IEntityResponseDTO> entitiesDTO = mapper.Map <IEnumerable <IEntityResponseDTO> >(entities);

            IPagedList <IEntityResponseDTO> pagedDTO = new StaticPagedList <IEntityResponseDTO>(entitiesDTO, entities.GetMetaData());

            return(pagedDTO);
        }
        public async Task <IPagedList <IEntityResponse> > PageByLoanBorrower(PageOption pageOption, long loanBorrowerId)
        {
            IPagedList <IEntity> entities = await repository.PageByLoanBorrower(pageOption, loanBorrowerId);

            IEnumerable <IEntityResponse> entitiesDto = mapper.Map <IEnumerable <IEntityResponse> >(entities);

            IPagedList <IEntityResponse> pagedDto = new StaticPagedList <IEntityResponse>(entitiesDto, entities.GetMetaData());

            return(pagedDto);
        }
Example #25
0
        public async Task <PageResult> GetPageListAsync(int deptId, PageOption pageOption, string strSearch = null)
        {
            Expression <Func <Sys_User, bool> > exp = p => true;

            if (!string.IsNullOrEmpty(strSearch))
            {
                exp = exp.And(p =>
                              p.ID.ToString().Contains(strSearch) ||
                              p.Name.Contains(strSearch) ||
                              p.LoginName.Contains(strSearch) ||
                              p.Code.Contains(strSearch));
            }
            IQueryable <UserDto> query = null;

            if (deptId == 0)
            {
                query = from user in _unitOfWork.SysUserRep.Query.Where(exp)
                        join i in _unitOfWork.SysDeptRep.Query
                        on user.DeptID equals i.ID into list
                        from dept in list.DefaultIfEmpty()
                        select new UserDto
                {
                    UserID    = user.ID,
                    UserName  = user.Name,
                    DeptID    = user.DeptID,
                    DeptName  = dept.Name,
                    Code      = user.Code,
                    LoginName = user.LoginName,
                    Sex       = user.Sex,
                    Remark    = user.Remark
                };
            }
            else
            {
                var deptService = new DeptService(_unitOfWork);
                var deptList    = new List <DeptDto>();
                deptList.Add(deptService.Init(deptId).Data);
                deptService.GetDeptByParentId(deptList, deptId);
                query = from user in _unitOfWork.SysUserRep.Query.Where(exp)
                        join dept in deptList
                        on user.DeptID equals dept.DeptID
                        select new UserDto
                {
                    UserID    = user.ID,
                    UserName  = user.Name,
                    DeptID    = user.DeptID,
                    DeptName  = dept.DeptName,
                    Code      = user.Code,
                    LoginName = user.LoginName,
                    Sex       = user.Sex,
                    Remark    = user.Remark
                };
            }
            return(await query.ToPageResultAsync(pageOption));
        }
Example #26
0
        public async Task <PageResult> GetUserPageListAsync(int roleId, PageOption pageOption, string strSearch = null, bool except = false)
        {
            IQueryable <UserDto> query = null;

            if (except)
            {
                query = from user in _unitOfWork.SysUserRep.Query
                        join i in _unitOfWork.SysRoleUserRep.Query.Where(p => p.RoleID == roleId)
                        on user.ID equals i.UserID into list
                        from roleUser in list.DefaultIfEmpty()
                        where roleUser == null
                        join j in _unitOfWork.SysDeptRep.Query
                        on user.DeptID equals j.ID into list2
                        from dept in list2.DefaultIfEmpty()
                        select new UserDto
                {
                    UserID    = user.ID,
                    UserName  = user.Name,
                    Code      = user.Code,
                    LoginName = user.LoginName,
                    DeptID    = user.DeptID,
                    DeptName  = dept.Name
                };
            }
            else
            {
                query = from roleUser in _unitOfWork.SysRoleUserRep.Query.Where(p => p.RoleID == roleId)
                        join user in _unitOfWork.SysUserRep.Query
                        on roleUser.UserID equals user.ID
                        join i in _unitOfWork.SysDeptRep.Query
                        on user.DeptID equals i.ID into list
                        from dept in list.DefaultIfEmpty()
                        select new UserDto
                {
                    UserID    = user.ID,
                    UserName  = user.Name,
                    Code      = user.Code,
                    LoginName = user.LoginName,
                    DeptID    = user.DeptID,
                    DeptName  = dept.Name
                };
            }
            Expression <Func <UserDto, bool> > exp = p => true;

            if (!string.IsNullOrEmpty(strSearch))
            {
                exp = exp.And(c =>
                              c.UserID.ToString().Contains(strSearch) ||
                              c.UserName.Contains(strSearch) ||
                              c.Code.Contains(strSearch) ||
                              c.LoginName.Contains(strSearch));
            }
            query = query.Where(exp);
            return(await query.ToPageResultAsync(pageOption));
        }
Example #27
0
        /// <summary>
        /// Handles the SelectedIndexChanged event of the listBoxOptions control.
        /// Show the correct control in right area
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void listBoxOptions_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListBox listBox = (ListBox)sender;

            //Clear current option control
            splitContainer1.Panel2.Controls.Clear();
            //Set the new control
            PageOption pageOption = (PageOption)listBox.SelectedItem;

            splitContainer1.Panel2.Controls.Add(pageOption.ControlToShow);
        }
        public async Task <IActionResult> FindBorrower([FromQuery] PageOption pageOption, long loanBorrowerId, string session = "")
        {
            IPagedList <SavingsDepositResponse> data = await this.savingsDepositService.PageByLoanBorrower(pageOption, loanBorrowerId);

            PagedListMetaData metaData = data.GetMetaData();

            PagedDataResponse pagedData = new PagedDataResponse {
                Data = data, MetaData = metaData
            };

            return(Ok(pagedData));
        }
Example #29
0
        public async Task <IActionResult> Paginate([FromQuery] PageOption pageOption)
        {
            IPagedList <IEntity> data = await this.eFRepository.PaginateAsync(pageOption);

            PagedListMetaData metaData = data.GetMetaData();

            PagedDataResponse pagedData = new PagedDataResponse {
                Data = data, MetaData = metaData
            };

            return(Ok(pagedData));
        }
Example #30
0
        public async Task <IActionResult> FindCustomerExistingLoans([FromQuery] PageOption pageOption, long savingsId, string session = "")
        {
            IPagedList <SavingsDailyBalanceResponse> data = await this.savingsDailyBalanceService.PageBySavingsId(pageOption, savingsId);

            PagedListMetaData metaData = data.GetMetaData();

            PagedDataResponse pagedData = new PagedDataResponse {
                Data = data, MetaData = metaData
            };

            return(Ok(pagedData));
        }
Example #31
0
        public Navigation WithOptions(PageOption options)
        {
            this.Options = this.Options.Set(options);

            return this;
        }
Example #32
0
        public Navigation ClearOptions(PageOption option)
        {
            this.Options = this.Options.Clear(option);

            return this;
        }
Example #33
0
		/// <summary>
		/// Gets the page option informations.
		/// </summary>
		/// <param name="aPageOption">An available page option.</param>
		/// <exception cref="T:System.ArgumentException">Throw if aPageOption is not defined</exception>
		/// <returns>Instance of PageOption with correct title and control to show</returns>
		private PageOption GetPageOption (AvailablePageOption aPageOption) {
			PageOption pageOption = new PageOption();
			#region switch définissant pageOption.Title et pageOption.ControlToShow
			switch (aPageOption) {
				case AvailablePageOption.Database:
					pageOption.Title = "Serveur MySQL";
					pageOption.ControlToShow = panelConfigDatabase;
					break;

				case AvailablePageOption.Directories:
					pageOption.Title = "Dossiers à surveiller";
					pageOption.ControlToShow = tableLayoutPanelConfigDirectories;
					break;

				case AvailablePageOption.Extensions:
					pageOption.Title = "Extensions audio/vidéo";
					pageOption.ControlToShow = labelNotYetDefinedPanel;
					break;

				case AvailablePageOption.General:
					pageOption.Title = "Options générales";
					pageOption.ControlToShow = panelConfigMainOptions;
					break;

				case AvailablePageOption.ID3:
					pageOption.Title = "Tags ID3";
					pageOption.ControlToShow = labelNotYetDefinedPanel;
					break;

				case AvailablePageOption.Queries:
					pageOption.Title = "Requêtes SQL";
					pageOption.ControlToShow = labelNotYetDefinedPanel;
					break;

				default:
					throw new ArgumentException("This option page must be defined in MainForm.GetPageOption(aPageOption) method.");
			}
			#endregion
			return pageOption;
		}
        private void ClonePageOption(PageOption pageOption, PageProperties newPage)
        {
            var newPageOption = new PageOption
            {
                Key = pageOption.Key,
                Type = pageOption.Type,
                Value = pageOption.Value,
                Page = newPage,
                CustomOption = pageOption.CustomOption
            };

            if (newPage.Options == null)
            {
                newPage.Options = new List<PageOption>();
            }

            newPage.Options.Add(newPageOption);
            repository.Save(newPageOption);
        }