Exemplo n.º 1
0
        void stepEntryForm_Submitted(object sender, EventArgs e)
        {
            TextEntryForm dialog = (TextEntryForm)sender;

            dialog.Controls["panelContainer"].Controls["labelError"].Text = "";
            scriptBindingSource.DataSource = dal.GetUserScripts(loginForm.UserID);
            scriptBindingSource.ResetBindings(false);
            int script_id = (int)listBoxScripts.SelectedValue;

            dal.AddStep(dialog.Value, script_id, listBoxSteps.SelectedIndex);
            stepBindingSource.DataSource = dal.GetStepsByScriptID(script_id).ToList();
            if (listBoxSteps.SelectedIndex + 1 < listBoxSteps.Items.Count)
            {
                listBoxSteps.SelectedIndex++;
            }
        }
Exemplo n.º 2
0
        public MainForm()
        {
            dal = new DAL();
            dal.Init(Properties.Settings.Default.awaDB);
            ScriptManager.GetInstance().Init(dal);

            InitializeComponent();

            Log.GetInstance().SetSink(Log.SinkType.CONTROL, textBoxLog);
            BindControlsToDataSource();
            listBoxScripts.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnValidation;
            listBoxSteps.DataBindings.DefaultDataSourceUpdateMode   = DataSourceUpdateMode.OnValidation;


            scriptEntryForm            = new TextEntryForm("Please Enter New Script Name:");
            scriptEntryForm.Submitted += new EventHandler(scriptEntryForm_Submitted);
            scriptEntryForm.Location   = buttonAddScript.Location;
            scriptEntryForm.BringToFront();
            scriptEntryForm.Visible = false;
            tabScript.Controls.Add(scriptEntryForm);

            stepEntryForm            = new TextEntryForm("Please Enter New Step Name:");
            stepEntryForm.Submitted += new EventHandler(stepEntryForm_Submitted);
            stepEntryForm.Location   = buttonAddScript.Location;
            stepEntryForm.BringToFront();
            stepEntryForm.Visible = false;
            tabScript.Controls.Add(stepEntryForm);

            aBox = new awaAboutBox();
            aBox.Hide();

            webBrowser.ObjectForScripting = this;
            webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);


            loginForm = new Login(dal);
            DialogResult res = loginForm.ShowDialog(this);

            if (res == DialogResult.Abort)
            {
                Application.Exit();
            }


            scriptBindingSource.DataSource = dal.GetUserScripts(loginForm.UserID).ToList();
        }
Exemplo n.º 3
0
        void scriptEntryForm_Submitted(object sender, EventArgs e)
        {
            TextEntryForm dialog = (TextEntryForm)sender;

            foreach (var item in listBoxScripts.Items)
            {
                if (item.ToString() == dialog.Value)
                {
                    dialog.Visible = true;
                    dialog.Controls["panelContainer"].Controls["labelError"].Text = "Script Name Already Exist";
                    return;
                }
            }
            dialog.Controls["panelContainer"].Controls["labelError"].Text = "";
            dal.AddScript(dialog.Value, loginForm.UserID);
            scriptBindingSource.DataSource = dal.GetUserScripts(loginForm.UserID);
        }