public ActionResult GetAllGridJson(string itemId, string keyword) { var data = itemsDetailApp.GetList(itemId, keyword); string result = data.ToJson(); return(Content(result)); }
public ActionResult GetGrid(string itemId, string keyword, Pagination pagination) { var data = new { rows = itemsDetailApp.GetList(itemId, keyword, pagination), total = pagination.total, page = pagination.page, records = pagination.records }; return(Content(data.ToJson())); }
public ActionResult GetGridJson(string itemId, string keyword) { //var queryParam = queryJson.ToJObject(); //var itemId = queryParam["itemId"].IsEmpty() ? "" : queryParam["itemId"].ToString(); //var keyword = queryParam["txt_keyword"].IsEmpty() ? "" : queryParam["txt_keyword"].ToString(); var data = itemsDetailApp.GetList(itemId, keyword); return(ResultLayUiTable(data.Count, data)); }
public ActionResult GetEquipmentProjectItemTreeJson(string FEquipmentId) { string FParentID = itemsApp.GetEntity("OperationType").FId; var dataList = itemsApp.GetEntitys(FParentID, ""); //var itemParent = itemsApp.GetGridSelectJson() var projectdata = operationProjectApp.GetEntitysByEquipmentID(FEquipmentId); var itemdata = itemsDetailApp.GetList(); var treeList = new List <TreeViewModel>(); foreach (ItemsEntity item in dataList) { List <ItemsDetailEntity> dataDetaillist = itemdata.Where(x => x.FItemId.Equals(item.FId)).ToList(); TreeViewModel tree = new TreeViewModel(); bool hasChildren = dataDetaillist.Count == 0 ? false : true; tree.id = item.FId; tree.text = item.FFullName; tree.value = item.FId; tree.parentId = "0"; tree.isexpand = hasChildren; tree.complete = hasChildren; tree.hasChildren = hasChildren; treeList.Add(tree); foreach (ItemsDetailEntity itemDetail in dataDetaillist) { TreeViewModel detailtree = new TreeViewModel(); bool detailhasChildren = projectdata.Count(t => t.FOperationLevelId.Contains(itemDetail.FId)) == 0 ? false : true; detailtree.id = itemDetail.FId; detailtree.text = itemDetail.FItemName; detailtree.value = itemDetail.FId; detailtree.parentId = item.FId; detailtree.isexpand = detailhasChildren; detailtree.complete = detailhasChildren; detailtree.hasChildren = detailhasChildren; treeList.Add(detailtree); } } foreach (OperationProjectEntity item in projectdata) { TreeViewModel tree = new TreeViewModel(); //bool hasChildren = itemdata.Count(t => t.FId.Contains(item.FOperationLevelId)) == 0 ? false : true; ; tree.id = item.FId; tree.text = item.FShortName; tree.value = item.FId; tree.parentId = item.FOperationLevelId; tree.isexpand = true; tree.complete = true; //tree.showcheck = true; tree.hasChildren = false; treeList.Add(tree); } return(Content(treeList.TreeViewJson())); }
private object GetDataItemList() { var itemdata = itemsDetailApp.GetList(); Dictionary <string, object> dictionaryItem = new Dictionary <string, object>(); foreach (var item in itemsApp.GetList()) { var dataItemList = itemdata.FindAll(t => t.F_ItemId.Equals(item.F_Id)); Dictionary <string, string> dictionaryItemList = new Dictionary <string, string>(); foreach (var itemList in dataItemList) { dictionaryItemList.Add(itemList.F_ItemCode, itemList.F_ItemName); } dictionaryItem.Add(item.F_EnCode, dictionaryItemList); } return(dictionaryItem); }
private async Task <object> GetDataItemList() { var itemdata = await itemDetailApp.GetList(); Dictionary <string, object> dictionaryItem = new Dictionary <string, object>(); foreach (var item in await itemsApp.GetList()) { var dataItemList = itemdata.FindAll(t => t.ItemId.Equals(item.Id)); Dictionary <string, string> dictionaryItemList = new Dictionary <string, string>(); foreach (var itemList in dataItemList) { dictionaryItemList.Add(itemList.ItemCode, itemList.ItemName); } dictionaryItem.Add(item.EnCode, dictionaryItemList); } return(dictionaryItem); }
public ActionResult GetItemTypeAndDetails() { List <object> itemAndDetails = new List <object>(); ItemsApp itemsApp = new ItemsApp(); List <ItemsEntity> itemTypes = itemsApp.GetApiList("Product_Cotton"); foreach (var itemType in itemTypes) { List <object> retDetails = new List <object>(); ItemsDetailApp itemsDetailApp = new ItemsDetailApp(); List <ItemsDetailEntity> itemDetails = itemsDetailApp.GetList(itemType.Id, ""); foreach (var itemDetail in itemDetails) { retDetails.Add(new { itemCode = itemDetail.F_ItemCode, itemName = itemDetail.F_ItemName }); } itemAndDetails.Add(new { typeName = itemType.F_FullName, typeEntitys = retDetails }); } return(Content(itemAndDetails.ToJson())); }
public async Task <IActionResult> GetGridJson(string itemId, string keyword) { var data = await itemsDetailApp.GetList(itemId, keyword); return(Content(data.ToJson())); }
public ActionResult GetGridJson(string itemId, string keyword) { var data = _itemsDetailApp.GetList(itemId, keyword); return(Content(data.ToJson())); }