Example #1
0
 public InventoryItem(ProductMasterItem item1, double units, string grade, bool purge = false)
 {
     InventoryItemID = IDCounter++;
     MasterID        = item1.MasterID;
     ProductCode     = item1.ProductionCode;
     Units           = units;
     PiecesPerUnit   = item1.PiecesPerUnit;
     Grade           = grade;
     IsPurged        = purge;
 }
        public SalesItem(ProductMasterItem mItem1, string invoiceNum, int unit, int pcs, string grade, DateTime date)
        {
            InvoiceNumber   = invoiceNum;
            InventoryItemID = IDCounter++;
            MasterID        = mItem1.MasterID;

            ProductionCode = mItem1.Description;
            Units          = unit;
            TotalPieces    = pcs;
            Grade          = grade;
            Date           = date;
        }
        public override bool Equals(object obj)
        {
            ProductMasterItem other = obj as ProductMasterItem;

            if (other != null)
            {
                return(MasterID == other.MasterID);
            }
            else
            {
                return(MasterID == obj as int?);
            }
        }
        public ForecastItem(double units, ProductMasterItem master, double[] sales = null)
        {
            if (sales != null && sales.Length != 13)
            {
                throw new Exception("Sales must be 13 months into past.");
            }
            Units              = units;
            ProductCode        = master.ProductionCode;
            ProductDescription = master.Description;
            MasterID           = master.MasterID;

            UnitsPerMonth = sales;
            InitializeSoldUnits(); // double check initialization
        }
 public void SetValues(ProductMasterItem item)
 {
     Description  = item.Description;
     Width        = item.Width;
     Length       = item.Length;
     Thickness    = item.Thickness;
     Texture      = item.Texture;
     Waste        = item.Waste;
     Grades       = item.Grades;
     HasBarcode   = item.HasBarcode;
     Notes        = item.Notes;
     TurnType     = item.TurnType;
     MinSupply    = item.MinSupply;
     MaxSupply    = item.MaxSupply;
     TargetSupply = item.TargetSupply;
     UnitsPerHour = item.UnitsPerHour;
     MasterID     = item.MasterID;
     MadeIn       = item.MadeIn;
     FGPieces     = item.FGPieces;
 }