public VmItemMater GetYarn(int id) { GenericFactory_EF_Yarn = new CmnItemMaster_EF(); try { List <CmnItemMaster> _ItemMasterobj = GenericFactory_EF_Yarn.GetAll().Where(x => x.IsDeleted == false && x.ItemID == id).ToList(); VmItemMater _vmItemMasters = (from olt in _ItemMasterobj select new { ItemID = olt.ItemID, ArticleNo = olt.ArticleNo, ItemType = olt.CmnItemType.ItemTypeName, ItemGroup = olt.CmnItemGroup == null ? "" : olt.CmnItemGroup.ItemGroupName, ItemName = olt.ItemName, Unit = olt.CmnUOM == null ? "" : olt.CmnUOM.UOMName, Color = olt.CmnItemColor == null ? "" : olt.CmnItemColor.ColorName, Size = olt.CmnItemSize == null ? "" : olt.CmnItemSize.SizeName, Brand = olt.CmnItemBrand == null ? "" : olt.CmnItemBrand.BrandName, Model = olt.CmnItemModel == null ? "" : olt.CmnItemModel.ModelName, Description = olt.Description, Note = olt.Note, UniqueCode = olt.UniqueCode, UnitId = olt.UOMID, ColorId = olt.ItemColorID, SizeId = olt.ItemSizeID, BrandId = olt.ItemBrandID, ModelId = olt.ItemBrandID, ItemGropID = olt.ItemGroupID, Count = olt.Count }).ToList().Select(x => new VmItemMater { ItemID = x.ItemID, ArticleNo = x.ArticleNo, ItemType = x.ItemType, ItemGroup = x.ItemGroup, ItemName = x.ItemName, Unit = x.Unit, Color = x.Color, Size = x.Size, Brand = x.Brand, Model = x.Model, Description = x.Description, Note = x.Note, UniqueCode = x.UniqueCode, UnitId = x.UnitId, ColorId = x.ColorId, SizeId = x.SizeId, BrandId = x.BrandId, ModelId = x.BrandId, ItemGropID = x.ItemGropID, Count = x.Count }).FirstOrDefault(); return(_vmItemMasters); } catch (Exception) { throw; } }
public VmItemMater GetYarn(int id) { objCmnItemGroupMgtEF = new SystemCommonDDL(); objYarnMgt = new CmnYarnMgt(); VmItemMater _objItemMaster = null; try { _objItemMaster = objYarnMgt.GetYarn(id); } catch (Exception e) { e.ToString(); } return(_objItemMaster); }