コード例 #1
0
        public void Delete(int POContentID)
        {
            POContent _dbEntry = QueryByID(POContentID);

            _dbEntry.Enabled = false;
            _context.SaveChanges();
        }
コード例 #2
0
 /// <summary>
 /// Create/Update PO content record
 /// </summary>
 /// <param name="POContent"></param>
 /// <returns></returns>
 public int Save(POContent POContent)
 {
     if (POContent.POContentID == 0)
     {
         POContent.Enabled = true;
         _context.POContents.Add(POContent);
     }
     else
     {
         POContent _dbEntry = _context.POContents.Find(POContent.POContentID);
         if (_dbEntry != null)
         {
             _dbEntry.PRContentID       = POContent.PRContentID;
             _dbEntry.PartName          = POContent.PartName;
             _dbEntry.PartNumber        = POContent.PartNumber;
             _dbEntry.PartSpecification = POContent.PartSpecification;
             _dbEntry.Quantity          = POContent.Quantity;
             _dbEntry.PurchaseOrderID   = POContent.PurchaseOrderID;
             _dbEntry.UnitPrice         = POContent.UnitPrice;
             _dbEntry.SubTotal          = POContent.SubTotal;
             _dbEntry.BrandName         = POContent.BrandName;
             _dbEntry.Memo        = POContent.Memo;
             _dbEntry.ReceivedQty = POContent.ReceivedQty;
             _dbEntry.State       = POContent.State;
             _dbEntry.unit        = POContent.unit ?? "件";
             _dbEntry.Enabled     = true;
         }
     }
     _context.SaveChanges();
     return(POContent.POContentID);
 }
コード例 #3
0
        //Update the received quantity to identify the PO complete rate
        public int Receive(int POContentID, int Quantity, string Memo)
        {
            POContent _dbEntry = _context.POContents.Find(POContentID);

            if (_dbEntry != null)
            {
                _dbEntry.ReceivedQty = _dbEntry.ReceivedQty + Quantity;
                _dbEntry.Memo        = Memo;
            }
            _context.SaveChanges();
            return(_dbEntry.POContentID);
        }
コード例 #4
0
        public POContentGridRowModel(POContent POContent, PurchaseItem _puritem, string ETA, string PRNumber, double time)
        {
            cell    = new string[14];
            cell[0] = POContent.POContentID.ToString();
            cell[1] = POContent.PartName;
            cell[2] = POContent.PartNumber;
            cell[3] = POContent.PartSpecification;
            cell[4] = POContent.Quantity.ToString();
            //计算数量
            cell[5] = _puritem.TaskID > 0 ? POContent.POContentID > 0 ? _puritem.Time.ToString() : time.ToString() : "1";
            cell[6] = _puritem.SupplierID == 0 ? "0" : _puritem.UnitPrice.ToString();
            //未税金额
            cell[7] = _puritem.SupplierID == 0 ? "0" : _puritem.TotalPrice.ToString();//Math.Round(POContent.Quantity * _puritem.UnitPrice, 2).ToString();
            cell[8] = _puritem.SupplierID == 0 ? "0" : _puritem.UnitPriceWT.ToString();
            //含税金额
            cell[9] = _puritem.SupplierID == 0 ? "0" : _puritem.TotalPriceWT.ToString();//Math.Round(POContent.Quantity * _puritem.UnitPriceWT, 2).ToString();

            cell[10] = POContent.RequireTime.ToString("yyyy-MM-dd");
            cell[11] = POContent.Memo;
            cell[12] = PRNumber;
            cell[13] = _puritem.PurchaseItemID.ToString();
        }