Exemple #1
0
        public static bool AlertUser(string msg)
        {
            var alert = new AlertForm(msg);

            alert.ShowDialog();
            return(true);
        }
Exemple #2
0
        // do closing the script
        private void closeScript()
        {
            // has unsaved changes in the current working-on script
            if (ModelManager.getScriptModelByIndex(mTabControl.SelectedIndex).HaveUnsavedChanges)
            {
                AlertForm    alertForm = new AlertForm("Alert", "The script has been modified and it's unsaved. Do you want to save it?", true, true, true);
                DialogResult result    = alertForm.ShowDialog();

                bool doesSaveSuccessfully = true;

                // don't do closing
                if (result == DialogResult.Cancel)
                {
                    return;
                }
                // yes, do saving, then closing
                else if (result == DialogResult.Yes)
                {
                    doesSaveSuccessfully = Program.form.saveCertainScript(mTabControl.SelectedIndex);
                }

                // not actually saving
                if (!doesSaveSuccessfully)
                {
                    return;
                }
            }

            // close the script
            ModelManager.closeScript();
            mTabControl.TabPages.RemoveAt(mTabControl.SelectedIndex);
        }
Exemple #3
0
        public void submitAlert(Alarm alarm)
        {
            this.alarm = alarm;
            AlertForm form = new AlertForm(this);

            form.ShowDialog();
        }
Exemple #4
0
        private void Button2_Click(object sender, EventArgs e)
        {
            try {
                if (this._markId == int.MinValue)
                {
                    MessageBox.Show("Выбирите марку");
                    return;
                }

                AlertForm alertForm = new AlertForm();

                if (alertForm.ShowDialog() == DialogResult.OK)
                {
                    OpenDocument($@"{_pathToDocumentDirectory}\продажа.docx");

                    Mark mark = dB_OwnersCarsDataSet.Mark.FindById(_markId);

                    ReplaceText("<FIO>", alertForm.FullName);
                    ReplaceText("<Description>", alertForm.Description);
                    ReplaceText("<DateCreation>", alertForm.DateCreation);
                    ReplaceText("<MarkName>", mark.MarkName);
                    ReplaceText("<StateAccurary>", alertForm.StateAccurary);

                    _wordApplication.Visible = true;
                }
                else
                {
                    MessageBox.Show("Error!");
                }
            } catch (Exception) {
            }
        }
    public string Execute(string regexText, FindParams findParams, string directory, string filter, string ignoreDirs)
    {
        if (string.IsNullOrEmpty(regexText))
        {
            return(null);
        }
        Regex  regex   = null;
        string pattern = null;

        if (findParams.regex)
        {
            string error;
            regex = DialogManager.ParseRegex(regexText, out error);
            if (regex == null || error != null)
            {
                return("Error: " + error);
            }
        }
        else
        {
            pattern = regexText;
        }
        alert = new AlertForm(mainForm, OnCanceled);

        tabSize = mainForm.Settings.tabSize.GetValue(null);
        thread  = new Thread(
            new ThreadStart(delegate()
        {
            Search(directory, regex, pattern, findParams.ignoreCase, filter, ignoreDirs);
        })
            );
        thread.Start();

        alert.ShowDialog(mainForm);
        if (finishBuffer != null)
        {
            mainForm.ShowConsoleBuffer(MainForm.FindResultsId, finishBuffer);
        }
        return(null);
    }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            AlertForm alert = new AlertForm();
            alert.MessageBoxButtons = MessageBoxButtons.YesNo;
            alert.Message = "是否刪除該保養?";

            if (alert.ShowDialog() == DialogResult.Yes)
            {
                MaintainRecordView record = this.GetSelectMaintainRecordView();

                m_RecordState = RecordState.Delete;

                ReturnValueInfo returnValue = this.m_AbstractMachineMaintain.MaintainRecordDelete(record);
                if (returnValue != null)
                {
                    if (!returnValue.boolValue)
                    {
                        this.ShowWarningMessage(returnValue.messageText);
                    }
                }
            }
        }
Exemple #7
0
        public static void AlertUser(string msg)
        {
            var alert = new AlertForm(msg);

            alert.ShowDialog();
        }
Exemple #8
0
 private void btnAlerts_Click(object sender, EventArgs e)
 {
     DefineAlert.AlertForm al = new AlertForm();
     al.ShowDialog();
 }