Beispiel #1
0
        public WarehouseRequestItem QueryByName(string PartName, string PartNumber)
        {
            WarehouseRequestItem _item = _context.WarehouseRequestItems.Where(w => w.PartName == PartName)
                                         .Where(w => w.PartNumber == PartNumber).FirstOrDefault();

            return(_item);
        }
Beispiel #2
0
        public int Save(WarehouseRequestItem Item)
        {
            //bool _isNew = false;
            WarehouseRequestItem _dbEntry = _context.WarehouseRequestItems.Find(Item.WarehouseRequestItemID);

            if (_dbEntry == null)
            {
                _context.WarehouseRequestItems.Add(Item);
            }
            else
            {
                //_dbEntry.WarehouseRequestID = Item.WarehouseRequestID;
                //_dbEntry.PartName = Item.PartName;
                //_dbEntry.PartNumber = Item.PartNumber;
                //_dbEntry.Specification = Item.Specification;
                //_dbEntry.PartID = Item.PartID;
                _dbEntry.Quantity         = Item.Quantity;
                _dbEntry.ReceivedQuantity = Item.ReceivedQuantity;
                _dbEntry.ReceiveDate      = Item.ReceiveDate;
                _dbEntry.Received         = Item.Received;
                _dbEntry.WarehouseStockID = Item.WarehouseStockID;
                _dbEntry.ShortQty         = Item.ShortQty;
            }
            _context.SaveChanges();

            return(Item.WarehouseRequestItemID);
        }
Beispiel #3
0
        public int Receive(int WarehouseRequestItemID, int Quantity)
        {
            WarehouseRequestItem _item = _context.WarehouseRequestItems.Find(WarehouseRequestItemID);

            _item.ReceivedQuantity = _item.ReceivedQuantity + Quantity;
            _context.SaveChanges();
            return(_item.WarehouseRequestID);
        }
Beispiel #4
0
        public WHRequestItemGridRowModel(WarehouseRequestItem Item, WHStock _stockItem)
        {
            cell    = new string[14];
            cell[0] = Item.WarehouseRequestItemID.ToString();
            cell[1] = Item.PartName;
            cell[2] = Item.PartNumber;
            cell[3] = Item.Specification;
            cell[4] = _stockItem.Qty.ToString();
            cell[5] = Item.Quantity.ToString();
            cell[6] = Item.ReceivedQuantity.ToString();
            cell[7] = Item.ShortQty.ToString();

            cell[8]  = "";
            cell[9]  = "";
            cell[10] = "";
            cell[11] = "";
            cell[12] = Item.PartID.ToString();
            cell[13] = _stockItem.ID.ToString();
        }