private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string errors = this.validateInput();
                if (errors != "")
                {
                    MessageBox.Show(errors);
                    return;
                }

                int    desiredQuantity = Int32.Parse(unitsInput.Text.ToString());
                string styleCode       = styleInput.Text.ToString();
                string colorCode       = colorInput.Text.ToString();
                string orderFromS      = orderFrom.Value.Date.ToString("yyyyMMdd");
                string orderToS        = orderTo.Value.Date.ToString("yyyyMMdd");
                int    currDate        = Int32.Parse(DateTime.Now.ToString("yyyyMMdd"));

                string orderFromDate = orderFrom.Value.Date.ToString("yyyy-MM-dd");
                string orderToDate   = orderFrom.Value.Date.ToString("yyyy-MM-dd");

                if (currDate <= Int32.Parse(orderFromS))
                {
                    orderFromS    = "";
                    orderFromDate = "";
                }

                if (currDate <= Int32.Parse(orderToS))
                {
                    orderToS    = "";
                    orderToDate = "";
                }

                this.product = new ProductStyles(styleCode, colorCode, desiredQuantity);

                Overcuts.setProduct(this.product);

                EcommOvercuts      ecomm     = new EcommOvercuts();
                WholesalesOvercuts wholesale = new WholesalesOvercuts();
                RetailOvercuts     retail    = new RetailOvercuts();


                ecomm.getOvercuts(styleCode, colorCode, orderFromS, orderToS);
                wholesale.getOvercuts(styleCode, colorCode, orderFromS, orderToS);
                retail.getOvercuts(styleCode, colorCode, orderFromDate, orderToDate);

                EcommRetailOvercuts ecommRetail = new EcommRetailOvercuts(ecomm, retail);


                DrawOvercuts draw = new DrawOvercuts(this.form);
                draw.drawOvercuts(ecommRetail).drawOvercuts(ecomm).drawOvercuts(wholesale).drawOvercuts(retail);
            }
            catch (Exception exp) {
                MessageBox.Show(exp.ToString());
            }
        }
Beispiel #2
0
        public EcommRetailOvercuts(EcommOvercuts ecomm, RetailOvercuts retail)
        {
            this.unitsBySize   = new Dictionary <string, int>();
            this.overcutvalues = new Dictionary <string, string>();
            this.ecomm         = ecomm;
            this.retail        = retail;
            this.labelText     = "Ecomm and Retail";
            this.labelName     = "ecommRetailOvercutLabel";
            this.tableName     = "ecommRetailOvercutPanel";

            if (this.ecomm.hasRows() && retail.hasRows())
            {
                noRows = false;
                this.combineTotals();
            }
        }