public OutStockGridRowModel(OutStockItem Item, OutStockForm Form, string ReceiveUser, string WarehouseUser, string _whRequestNum) { cell = new string[9]; cell[0] = Item.OutStockItemID.ToString(); cell[1] = _whRequestNum; cell[2] = Item.PartName; cell[3] = Item.PartNumber; cell[4] = Item.Specification; cell[5] = Item.Quantity.ToString(); cell[6] = ReceiveUser; cell[7] = Item.OutDate.ToString("yyyy-MM-dd HH:mm"); cell[8] = WarehouseUser; }
public int Save(OutStockForm OutStockForm) { if (OutStockForm.OutStockFormID == 0) { _context.OutStockForms.Add(OutStockForm); } else { OutStockForm _dbEntry = _context.OutStockForms.Find(OutStockForm.OutStockFormID); if (_dbEntry != null) { _dbEntry.WHUserID = OutStockForm.WHUserID; _dbEntry.FormName = OutStockForm.FormName; _dbEntry.CreateTime = OutStockForm.CreateTime; _dbEntry.UserID = OutStockForm.UserID; } } _context.SaveChanges(); return(OutStockForm.OutStockFormID); }