public async Task <IActionResult> GatPagerListByWhere(string keyword, int rows, int page, string sidx, string sord, string Id) { if (string.IsNullOrEmpty(sidx)) { sidx = "SortCode"; } if (string.IsNullOrEmpty(sord)) { sord = "ASC"; } PagerEntity <InStockHeadGetDto> entity = await _service.QueryByPagesAsync(rows, page, t => t.OrderNo.Contains((keyword ?? t.OrderNo)), _service.Expression(sidx), sord.ToUpper().Equals("ASC")); List <InStockHeadGetDto> list = await _service.QueryAsync(); if (entity.Entity != null && entity.Entity.Count() > 0) { foreach (var item in entity.Entity) { var customer = await _customerService.QueryByIdAsync(item.CustomId); var warehouse = await _warehouseService.QueryByIdAsync(item.WarehouseId); var owner = await _ownerService.QueryByIdAsync(item.OwnerId); var receivetype = await _receivetypeService.QueryByIdAsync(item.SrTypeId); //item.WarehouseCode = warehouse == null ? "" : warehouse.EnCode; //item.WarehouseName = warehouse == null ? "" : warehouse.FullName; //item.CustomerCode = customer == null ? "" : customer.EnCode; //item.CustomerName = customer == null ? "" : customer.FullName; //item.OwnnerCode = owner == null ? "" : owner.EnCode; //item.OwnnerName = owner == null ? "" : owner.FullName; //item.StrTypeCode = receivetype == null ? "" : receivetype.EnCode; //item.StrTypeName = receivetype == null ? "" : receivetype.FullName; } } //设置返回格式 ReturnEntity RtEntity = new ReturnEntity(); RtEntity.rows = entity.Entity; RtEntity.page = page; RtEntity.records = entity.Total; int Count = entity.Total / rows; //获取除数 int yu = entity.Total % rows; //获取余数 if (yu > 0) //如果余数大于0则加一页,否则不加 { RtEntity.total = Count + 1; } else { RtEntity.total = Count + 0; } return(Ok(Extensions.ToJson(RtEntity))); }
public async Task <IActionResult> GetListByWhere(string keyword, string sidx, string sord, string Id) { if (string.IsNullOrEmpty(sidx)) { sidx = "SortCode"; } if (string.IsNullOrEmpty(sord)) { sord = "ASC"; } PagerEntity <StockGetDto> entity = new PagerEntity <StockGetDto>(); entity = await _service.QueryByPagesAsync( t => t.ProductSKU.Contains((keyword ?? t.ProductSKU)) || t.CustomerId.Contains(keyword ?? t.CustomerId), _service.Expression(sidx), sord.ToUpper().Equals("ASC")); if (entity.Entity != null && entity.Entity.Count() > 0) { foreach (var item in entity.Entity) { var product = await _productService.QueryByIdAsync(item.ProductId); item.ProductName = product == null ? "" : product.FullName; } } return(Ok(Extensions.ToJson(entity.Entity))); }
private static void BindItemInfo(PagerEntity pagerEntity, List <AssessActivity> ans) { var ids = new List <int>(); for (var i = pagerEntity.PageIndex * pagerEntity.PageSize; i < ((pagerEntity.PageIndex + 1) * pagerEntity.PageSize) && i < ans.Count; i++) { ids.Add(ans[i].AssessActivityID); } var items = AssessActivityItemDA.GetByAssessActivityIDs(ids); var papers = AssessActivityPaperDA.GetByAssessActivityIDs(ids); for (var i = pagerEntity.PageIndex * pagerEntity.PageSize; i < ((pagerEntity.PageIndex + 1) * pagerEntity.PageSize) && i < ans.Count; i++) { ans[i].ItsAssessActivityPaper.SubmitInfoes = papers.Where(x => x.AssessActivityID == ans[i].AssessActivityID) .Select(AssessActivityPaperEntity.Convert) .ToList(); foreach (var submitInfoe in ans[i].ItsAssessActivityPaper.SubmitInfoes) { submitInfoe.ItsAssessActivityItems = new List <AssessActivityItem>(); submitInfoe.ItsAssessActivityItems.AddRange( items.Where(x => x.AssessActivityPaperID == submitInfoe.SubmitInfoID) .Select(AssessActivityItemEntity.Convert) .ToList()); } } }
public static List <Reimburse> GetReimburseByCondition(Account loginUser, string employeename, int departmentid, ReimburseStatusEnum statusEnum, ReimburseStatusEnum?exceptStatusEnum, bool?isFillCustomer, int reimburseCategoriesEnumID, decimal?totalcostfrom, decimal?totalcostto, DateTime?applydateFrom, DateTime?applydateTo, DateTime?billtimeFrom, DateTime?billtimeTo, int companyID, int finishStatus, int auth, PagerEntity pagerEntity) { List <int> departmentids = new List <int>(); if (departmentid != -1) { List <Department> departments = BllInstance.DepartmentBllInstance.GetChildDeptList(departmentid); departmentids.Add(departmentid); departmentids.AddRange(departments.Select(x => x.DepartmentID).ToList()); } var reimburseentities = ReimburseDA.GetReimburseByCondition(departmentids, statusEnum, exceptStatusEnum, isFillCustomer, reimburseCategoriesEnumID, totalcostfrom, totalcostto, applydateFrom, applydateTo, billtimeFrom, billtimeTo, companyID, finishStatus); var reimburses = reimburseentities.Select(ReimburseEntity.ConvertToReimburse).ToList(); List <Account> accounts = BllInstance.AccountBllInstance.GetAccountByBaseCondition(employeename, departmentid, -1, null, true, null); accounts = Tools.RemoteUnAuthAccount(accounts, AuthType.HRMIS, loginUser, auth); for (int i = reimburses.Count - 1; i >= 0; i--) { if (!IsContainsAccount(accounts, reimburses[i].ApplierID)) { reimburses.RemoveAt(i); } } var reimbursesids = new List <int>(); for (int i = pagerEntity.PageIndex * pagerEntity.PageSize; i < (pagerEntity.PageIndex + 1) * pagerEntity.PageSize && i < reimburses.Count; i++) { Account account = BllInstance.AccountBllInstance.GetAccountById(reimburses[i].ApplierID); reimburses[i].ApplerName = account.Name; reimburses[i].Department.DepartmentName = account.Dept.DepartmentName; reimbursesids.Add(reimburses[i].ReimburseID); } var items = ReimburseItemDA.GetReimburseItemByReimburseID(reimbursesids); for (int i = pagerEntity.PageIndex * pagerEntity.PageSize; i < (pagerEntity.PageIndex + 1) * pagerEntity.PageSize && i < reimburses.Count; i++) { reimburses[i].ReimburseItems = items.Where(x => x.ReimburseID == reimburses[i].ReimburseID).Select(ReimburseItemEntity.ConvertTo). ToList(); } return(reimburses); }
public override void OnRemove(Item item) { base.OnRemove(item); PagerEntity pagerEnt = this.GetPagerEnt(item, true); if (pagerEnt) { pagerEnt.Kill(BaseNetworkable.DestroyMode.None); } }
public override void OnRemove(Item item) { base.OnRemove(item); PagerEntity pagerEnt = this.GetPagerEnt(item, true); if (!Object.op_Implicit((Object)pagerEnt)) { return; } pagerEnt.Kill(BaseNetworkable.DestroyMode.None); }
public async Task <IActionResult> GatPagerListByWhere(string keyword, string sidx, int rows = 20, int page = 1, string sord = "ASC", string Id = "") { bool isAsc = false; if (sord.ToUpper() == "ASC") { isAsc = true; } if (string.IsNullOrEmpty(sidx)) { sidx = "SordCode"; } //UserGetDto user = await _userService.QueryByIdAsync(Id); //RoleGetDto role = await _roleService.QueryByIdAsync(user.RoleId); //PagerEntity<CustomerGetDto> entity = null; //if (role.IsAdmin) //{ PagerEntity <InventoryClassGetDto> entity = await _service.QueryByPagesAsync(rows, page, t => t.EnCode.Contains((keyword ?? t.EnCode)) || t.FullName.Contains(keyword ?? t.FullName), _service.Expression(sidx), isAsc); //} //else //{ // entity = await _service.QueryByPagesAsync(rows, page, // t => t.EnCode.Contains((keyword ?? t.EnCode)) || // t.FullName.Contains(keyword ?? t.FullName) && // t.UserId==Id, // _service.Expression(sidx), isAsc); //} //设置返回格式 ReturnEntity RtEntity = new ReturnEntity(); RtEntity.rows = entity.Entity; RtEntity.page = page; RtEntity.records = entity.Total; int Count = entity.Total / rows; //获取除数 int yu = entity.Total % rows; //获取余数 if (yu > 0) //如果余数大于0则加一页,否则不加 { yu = 1; } else { yu = 0; } RtEntity.total = Count + yu; return(Ok(Extensions.ToJson(RtEntity))); }
/// <summary> /// 返回分页数据 /// </summary> /// <typeparam name="TEntity">对象</typeparam> /// <param name="pager">分页对象</param> /// <param name="data">PagerEntity数据源</param> /// <returns></returns> protected virtual IActionResult PagerListAction <TEntity>(PagerInfo pager, PagerEntity <TEntity> data) where TEntity : class { int pageCount = data.Total % pager.PageSize == 0 ? (data.Total / pager.PageSize) : (data.Total / pager.PageSize) + 1; return(Ok(new PagerActionEntity <TEntity> { Data = data.Entity, PageIndex = pager.PageIndex, PageCount = pageCount, Total = data.Total })); }
public void UpdateParent(Item item) { BaseEntity entityForParenting = this.GetEntityForParenting(item); if (Object.op_Equality((Object)entityForParenting, (Object)null) || !entityForParenting.isServer || !entityForParenting.IsFullySpawned()) { return; } PagerEntity pagerEnt = this.GetPagerEnt(item, true); if (!Object.op_Implicit((Object)pagerEnt)) { return; } pagerEnt.SetParent(entityForParenting, false, true); }
public async Task <IActionResult> GatPagerListByWhere(string keyword, int rows, int page, string sidx, string sord, string Id) { if (string.IsNullOrEmpty(sidx)) { sidx = "SortCode"; } if (string.IsNullOrEmpty(sord)) { sord = "asc"; } PagerEntity <StockGetDto> entity = new PagerEntity <StockGetDto>(); entity = await _service.QueryByPagesAsync(rows, page, t => t.CustomerId.Contains((keyword ?? t.CustomerId)) || t.ProductSKU.Contains(keyword ?? t.ProductSKU), _service.Expression(sidx), sord.ToUpper().Equals("ASC")); //设置返回格式 ReturnEntity RtEntity = new ReturnEntity(); RtEntity.rows = entity.Entity; RtEntity.page = page; RtEntity.records = entity.Total; int Count = entity.Total / rows; //获取除数 int yu = entity.Total % rows; //获取余数 if (yu > 0) //如q果余数大于0则加一页,否则不加 { RtEntity.total = Count + 1; } else { RtEntity.total = Count + 0; } if (entity.Entity != null && entity.Entity.Count() > 0) { foreach (var item in entity.Entity) { var product = await _productService.QueryByIdAsync(item.ProductId); item.ProductName = product == null ? "" : product.FullName; } } return(Ok(Extensions.ToJson(RtEntity))); }
public override void ServerCommand(Item item, string command, BasePlayer player) { base.ServerCommand(item, command, player); PagerEntity pagerEnt = this.GetPagerEnt(item, true); if (command == "stop") { pagerEnt.SetOff(); return; } if (command == "silenton") { pagerEnt.SetSilentMode(true); return; } if (command == "silentoff") { pagerEnt.SetSilentMode(false); } }
public void UpdateParent(Item item) { BaseEntity entityForParenting = this.GetEntityForParenting(item); if (entityForParenting == null) { return; } if (!entityForParenting.isServer) { return; } if (!entityForParenting.IsFullySpawned()) { return; } PagerEntity pagerEnt = this.GetPagerEnt(item, true); if (pagerEnt) { pagerEnt.SetParent(entityForParenting, false, true); } }
public async Task <IActionResult> GatPagerListByWhere(string keyword, int rows, int page, string sidx, string sord, string Id) { if (string.IsNullOrEmpty(sidx)) { sidx = "SortCode"; } //UserGetDto user = await _userservice.QueryByIdAsync(Id); //RoleGetDto role = await _roleservice.QueryByIdAsync(user.RoleId); //PagerEntity<ExpCompanyGetDto> entity = new PagerEntity<ExpCompanyGetDto>(); //if (role.IsAdmin) //{ PagerEntity <ExpCompanyGetDto> entity = await _service.QueryByPagesAsync(rows, page, t => t.EnCode.Contains((keyword ?? t.EnCode)) || t.FullName.Contains(keyword ?? t.FullName), _service.Expression(sidx), sord.ToUpper().Equals("ASC")); // } // else //{ // entity = await _service.QueryByPagesAsync(rows, page, // t => t.EnCode.Contains((keyword ?? t.EnCode)) || // t.FullName.Contains(keyword ?? t.FullName) && // t.UserId.Contains(Id ?? t.UserId), // _service.Expression(sidx), sord.ToUpper().Equals("ASC")); //} if (entity.Entity != null) { foreach (var item in entity.Entity) { if (item.KDAccout != "") { ItemsDetailGetDto dto = await _itemsDetailService.QueryByIdAsync(item.KDAccout); WarehouseGetDto warehouse = await _warehouseService.QueryByIdAsync(item.WarehouseCode); item.KDAccoutName = dto == null ? "" : dto.ItemName; item.WarehouseName = warehouse == null ? "" : warehouse.FullName; } } } //设置返回格式 ReturnEntity RtEntity = new ReturnEntity(); RtEntity.rows = entity.Entity; RtEntity.page = page; RtEntity.records = entity.Total; int Count = entity.Total / rows; //获取除数 int yu = entity.Total % rows; //获取余数 if (yu > 0) //如果余数大于0则加一页,否则不加 { RtEntity.total = Count + 1; } else { RtEntity.total = Count + 0; } return(Ok(Extensions.ToJson(RtEntity))); }
public static List <AssessActivity> GetAssessActivityByCondition(string employeeName, AssessCharacterType assessCharacterType, AssessStatus status, DateTime?hrSubmitTimeFrom, DateTime?hrSubmitTimeTo, int finishStatus, DateTime?scopeFrom, DateTime?scopeTo, int departmentID, Account loginuser, int power, string assessCharacter, PagerEntity pagerEntity) { var assessActivitylist = AssessActiveityDA.GetAssessActivityByCondition(assessCharacterType, status, hrSubmitTimeFrom, hrSubmitTimeTo, finishStatus, scopeFrom, scopeTo, assessCharacter); var assessActivities = assessActivitylist.Select(AssessActivityEntity.Convert).ToList(); var ans = GetAssessActivityByEmployeeNameAndPower(assessActivities, employeeName, loginuser, power, departmentID); BindItemInfo(pagerEntity, ans); return(ans); }
public static List <AssessActivity> GetAssessActivityByEmployee(int employeeId, PagerEntity pagerEntity) { var assessActivitylist = AssessActiveityDA.GetAssessActivityByEmployee(employeeId) .Select(AssessActivityEntity.Convert).ToList(); BindItemInfo(pagerEntity, assessActivitylist); return(assessActivitylist); }
public static List <AssessActivity> GetAssessActivityHistoryByEmployeeName(string employeeName, PagerEntity pagerEntity) { var assessActivitylist = AssessActiveityDA.GetAssessActivityHistoryByEmployeeName(employeeName) .Select(AssessActivityEntity.Convert).ToList(); BindItemInfo(pagerEntity, assessActivitylist); return(assessActivitylist); }