public virtual ActionResult ListForSubGrid(string id) { var itemCats = _mPacketItemCatRepository.GetByPacketId(id); var jsonData = new { rows = ( from itemCat in itemCats select new { i = itemCat.Id.ToString(), cell = new string[] { //itemCat.Id, //itemCat.PacketId != null ? itemCat.PacketId.Id : null, itemCat.ItemCatId != null ? itemCat.ItemCatId.ItemCatName : null, itemCat.ItemCatQty.HasValue ? itemCat.ItemCatQty.Value.ToString(Helper.CommonHelper.NumberFormat) : null, itemCat.PacketItemCatStatus, itemCat.PacketItemCatDesc } }).ToArray() }; return(Json(jsonData, JsonRequestBehavior.AllowGet)); }
public static DetailItemFormViewModel Create(string packetId, IMPacketItemCatRepository mPacketItemCatRepository) { DetailItemFormViewModel viewModel = new DetailItemFormViewModel(); viewModel.PacketItemCatList = mPacketItemCatRepository.GetByPacketId(packetId); return(viewModel); }