public async Task <JsonResult> GetAppraisedItemList(int page, int pageSize) { var listItemType = await _appraisalService.GetItemTypeList(); var listItemCategory = await _appraisalService.GetItemCategoryList(); var listAppraisedItem = await _appraisalService.GetList(page, pageSize); var result = from a in listAppraisedItem select new { a.AppraiseId, a.AppraiseDate, a.AppraiseNo, a.ItemTypeId, a.ItemCategoryId, a.ItemName, a.Brand, a.Karat, a.Weight, a.AppraisedValue, a.Remarks, a.CustomerFirstName, a.CustomerLastName, a.IsPawned, a.CreatedBy, a.CreatedAt }; return(Json(new { data = result.OrderByDescending(d => d.AppraiseDate).ThenBy(s => s.IsPawned), noMoreData = result.Count() < pageSize, recordCount = result.Count() }, JsonRequestBehavior.AllowGet)); }
public async Task <JsonResult> GetItemType() { var list = await _appraisalService.GetItemTypeList(); var result = list.Select(item => new tbl_ipos_itemtype() { ItemTypeId = item.ItemTypeId, ItemTypeName = item.ItemTypeName }); return(Json(result.OrderBy(o => o.ItemTypeName), JsonRequestBehavior.AllowGet)); }