public List<classInventoryItemsDetails> GetListOfInventoryItemsDetails()
        {
            List<classInventoryItemsDetails> listInventoryItemDetails = new List<classInventoryItemsDetails>();

            try
            {
                using (var dbCtx = new InventoryManagementDBEntities())
                {
                    var inventoryItemDetails = dbCtx.InventoryItemtbls;
                    foreach (InventoryItemtbl obj in inventoryItemDetails)
                    {
                        /// Console.WriteLine("message : " + idList.itemId);
                        //if (obj.InventoryListId == idList)
                        //{
                        classInventoryItemsDetails item = new classInventoryItemsDetails();
                        item.IdDetails = obj.InventoryItemId;
                        item.IdItem = obj.InventoryListId;
                        // item.IdUser = obj.UserId;
                        item.Location = obj.Location;
                        item.UnitType = obj.UnitType;
                        item.Price = obj.Price;
                        item.Quantity = obj.Quantity.ToString();
                        item.DateOfBuying = obj.DateOfBuying;

                        //var inventoryListsData= dbCtx.InventoryLists;
                        //item.inventoryList = inventoryListsData.FirstOrDefault(p=>p.InventoryListId == obj.InventoryListId);
                        listInventoryItemDetails.Add(item);

                        // }
                    }
                }

            }
            catch (Exception ex)
            {

                Console.WriteLine("Error : " + ex.Message);
            }

            return listInventoryItemDetails;
        }
        public classInventoryItemsDetails GetInventoryItemsDetailsById(int Id)
        {
            classInventoryItemsDetails item = new classInventoryItemsDetails();

            using (var dbCtx = new InventoryManagementDBEntities())
            {
                var obj = dbCtx.InventoryItemtbls.FirstOrDefault(p => p.InventoryItemId == Id);

                if (obj != null)
                {
                    item.IdDetails = obj.InventoryItemId;
                    item.IdItem = obj.InventoryListId;
                    // item.IdUser = obj.UserId;
                    item.Location = obj.Location;
                    item.UnitType = obj.UnitType;
                    item.Price = obj.Price;
                    item.Quantity = obj.Quantity.ToString();
                    item.DateOfBuying = obj.DateOfBuying;
                    return item;
                }

            }

            return item;
        }