예제 #1
0
        private void buttonViewScript_Click(object sender, EventArgs e)
        {
            string flags = GetFlags();

            if (string.IsNullOrEmpty(flags))
            {
                MessageBox.Show("Please choose at least one flag", "Prompt");
                return;
            }

            TableSynchronization.OptimizeOption option = TableSynchronization.OptimizeOption.Minimum;

            if (comboBoxOptimizeOption.Text.Equals("Middle"))
            {
                option = TableSynchronization.OptimizeOption.Middle;
            }
            else if (comboBoxOptimizeOption.Text.Equals("None"))
            {
                option = TableSynchronization.OptimizeOption.None;
            }

            int step = (int)numericUpDownStep.Value;

            _TableSync = new TableSynchronization(DataAccess.Conn, TableName, step, option, checkBoxFastestMode.Checked, flags);

            textBoxScript.Text = _TableSync.GetSql();

            this.Height = textBoxScript.Top + textBoxScript.Height + 40;
        }
예제 #2
0
        private bool Start()
        {
            try
            {
                _StartTime = DateTime.Now;

                TableSynchronization.OptimizeOption option = TableSynchronization.OptimizeOption.Minimum;

                if (comboBoxOptimizeOption.Text.Equals("Middle"))
                {
                    option = TableSynchronization.OptimizeOption.Middle;
                }
                else if (comboBoxOptimizeOption.Text.Equals("None"))
                {
                    option = TableSynchronization.OptimizeOption.None;
                }

                int step = (int)numericUpDownStep.Value;

                _TableSync = new TableSynchronization(DataAccess.Conn, TableName, step, option, checkBoxFastestMode.Checked, _Flags);

                _TableSync.Synchronize();

                _Thread = new System.Threading.Thread(ShowProgress);
                _Thread.IsBackground = true;
                _Thread.Start();

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }
예제 #3
0
    protected override void OnInit(EventArgs e)
    {
        InitializeComponent();

        base.OnInit(e);
        if (!LocalTablesLinked())
        {
            ResetModelGoToModels();
        }
        if (IsWhatifMode())
        {
            Response.Redirect("whatif_" + PAGENAME);
        }

        string dataFile = GetDirectory() + userDir + MAIN_USER_DATABASE;

        srcProductStructure.DataFile = dataFile;
        try
        {
            dropListProducts.DataBind();
        }
        catch (Exception)
        {
            Master.ShowErrorMessage();
        }
        Control buttondiv = getButtonDiv();



        tableSync = new TableSynchronization(userDir);

        //string sheet = "Cheat Sheat IBOM Page";
        //Master.SetHelpSheet(sheet + ".pdf", sheet);
    }
 protected override void OnInit(EventArgs e)
 {
     InitializeComponent();
     base.OnInit(e);
     tableSync = new TableSynchronization(userDir);
     //string sheet = "Cheat Sheat Models Page";
     //Master.SetHelpSheet(sheet + ".pdf", sheet);
 }
예제 #5
0
 protected override void OnInit(EventArgs e)
 {
     InitializeComponent();
     pnlMenu.Controls.Add(new LiteralControl("<h2>What-If: Products</h2>"));
     base.OnInit(e);
     if (!IsWhatifMode())
     {
         string whatifPart = "whatif_";
         Response.Redirect(PAGENAME.Substring(whatifPart.Length));
     }
     helperProduct.SetMenuContainer(pnlMenu);
     helperProduct.OnInit(e);
     tableSync = new TableSynchronization(userDir);
 }
    protected override void OnInit(EventArgs e)
    {
        InitializeComponent();
        //pnlMenu.Controls.Add(new LiteralControl("<h2>Products</h2>"));
        base.OnInit(e);
        if (IsWhatifMode())
        {
            Response.Redirect("whatif_" + PAGENAME);
        }
        string dataFile = GetDirectory() + userDir + MAIN_USER_DATABASE;

        srcProductsList.DataFile = dataFile;
        dropListProducts.DataBind();
        helperProduct.SetMenuContainer(pnlMenu);
        helperProduct.OnInit(e);
        tableSync = new TableSynchronization(userDir);

        string sheet = "Cheat Sheat Product Operations and Routings Page";

        Master.SetHelpSheet(sheet + ".pdf", sheet);
    }
예제 #7
0
        private bool Start()
        {
            try
            {
                _StartTime = DateTime.Now;

                TableSynchronization.OptimizeOption option = TableSynchronization.OptimizeOption.Minimum;

                if (comboBoxOptimizeOption.Text.Equals("Middle"))
                {
                    option = TableSynchronization.OptimizeOption.Middle;
                }
                else if (comboBoxOptimizeOption.Text.Equals("None"))
                {
                    option = TableSynchronization.OptimizeOption.None;
                }

                int step = (int)numericUpDownStep.Value;

                string sql = GetSql(step, option);

                GlobalSetting.DataAccess.Excute(sql);

                _TableSync = new TableSynchronization(DataAccess.Conn, TableName, step, option,
                                                      false, null);

                _Thread = new System.Threading.Thread(ShowProgress);
                _Thread.IsBackground = true;
                _Thread.Start();

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }
    protected override void OnInit(EventArgs e)
    {
        InitializeComponent();
        pnlMenu.Controls.Add(new LiteralControl("<h2>What-If: Products</h2>"));
        base.OnInit(e);
        if (!LocalTablesLinked())
        {
            ResetModelGoToModels();
        }
        if (!IsWhatifMode())
        {
            string whatifPart = "whatif_";
            Response.Redirect(PAGENAME.Substring(whatifPart.Length));
        }
        helperProduct.SetMenuContainer(pnlMenu);
        helperProduct.OnInit(e);
        string dataFile = GetDirectory() + userDir + MAIN_USER_DATABASE;

        srcProductsList.DataFile     = dataFile;
        srcProductStructure.DataFile = dataFile;
        try {
            dropListProducts.DataBind();
        } catch (Exception) {
            Master.ShowErrorMessage();
        }
        Control buttondiv    = getButtonDiv();
        Button  btnCopyTable = buttondiv.FindControl(PageControls.BTN_COPY_TABLE) as Button;

        extenderCopy.TargetControlID = copyAllDummy.ID;
        btnCopyTable.Click          += btnCopyTable_Click;

        hdnCopyMode = new HiddenField();
        pnlCopyTable.Controls.Add(hdnCopyMode);

        tableSync = new TableSynchronization(userDir);
    }