private void Sheet2_Startup(object sender, System.EventArgs e)
        {
            this.Sheet2_TitleLabel.Value2 = Properties.Resources.Sheet2Title;
            this.Name = Properties.Resources.Sheet2Name;
            this.IceCreamLabel.Value2 = Properties.Resources.IceCreamHeader;

            this.Chart_1.ChartTitle.Text = Properties.Resources.ProfitHeader;
            ((Excel.Axis) this.Chart_1.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlPrimary)).AxisTitle.Text    = Properties.Resources.ProfitHeader;
            ((Excel.Axis) this.Chart_1.Axes(Excel.XlAxisType.xlCategory, Excel.XlAxisGroup.xlPrimary)).AxisTitle.Text = Properties.Resources.DateHeader;

            this.view = Globals.DataSet.CreateView();

            if (this.Flavor != null)
            {
                view.Flavor = this.Flavor;
            }
            else if (view.Count != 0)
            {
                this.Flavor = (string)view[0].Row["Flavor"];
            }

            this.FlavorNamedRange.DataBindings.Add("Value2", this, "Flavor");

            this.History.SetDataBinding(view, "", "Date", "Inventory", "Sold", "Profit");

            this.History.ListColumns[1].Name = Properties.Resources.DateHeader;
            this.History.ListColumns[2].Name = Properties.Resources.InventoryHeader;
            this.History.ListColumns[3].Name = Properties.Resources.SoldHeader;
            this.History.ListColumns[4].Name = Properties.Resources.ProfitHeader;
        }
Exemplo n.º 2
0
        private void Sheet1_Startup(object sender, System.EventArgs e)
        {
            try
            {
                this.Sheet1_TitleLabel.Value2 = Properties.Resources.Sheet1Title;
                this.Name = Properties.Resources.Sheet1Name;

                this.newDateButton.Text = Properties.Resources.AddNewDateButton;
                this.saveButton.Text    = Properties.Resources.SaveDataButton;

                this.dayView = Globals.DataSet.CreateView();

                if (Globals.DataSet.Sales.Count != 0)
                {
                    this.DateSelector.MinDate = Globals.DataSet.MinDate;
                    this.DateSelector.MaxDate = Globals.DataSet.MaxDate;
                    this.DateSelector.Value   = this.DateSelector.MaxDate;
                }

                using (TextFileGenerator textFile = new TextFileGenerator(Globals.DataSet.Sales))
                {
                    this.pivotTable = CreatePivotTable(textFile.FullPath);
                }

                Globals.DataSet.Sales.SalesRowChanged += new OperationsBaseData.SalesRowChangeEventHandler(Sales_SalesRowChanged);
                UnscheduledOrderControl smartPaneControl = new UnscheduledOrderControl();
                smartPaneControl.Dock = DockStyle.Fill;
                smartPaneControl.View = this.dayView;

                Globals.ThisWorkbook.ActionsPane.Controls.Add(smartPaneControl);

                this.Activate();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }