Beispiel #1
0
        private void createUpdateTouchButton_Load(object sender, EventArgs e)
        {
            int selectedItem;
            int ruleID = 0;

            createUpdateTouchButton.Hide();
            ruleAndActionTextBox.Text = Strings.Trim(ruleAndActionTextBox.Text);
            if (!createUpdateTouchButton.Caption.Equals("Create " + nameOfAction))
            {
                selectedItem = rulesListView.FocusedItem.Index;
                ruleID       = Conversions.ToInteger(rulesListView.Items[selectedItem].SubItems[1].Text);
            }

            if (!string.IsNullOrEmpty(ruleAndActionTextBox.Text))
            {
                db.saveRule(ruleID, tableName, ruleAndActionTextBox.Text);
                MdlScripts.populateMessageRules(rulesListView, tableName);
                titleLabel.Text      = "Success!";
                titleLabel.BackColor = Color.Green;
                Size     = (Size) new Point(533, 510);
                Location = new Point((int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Width - Width) / 2d), (int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Height - Height) / 2d));
                closeTouchButton.Location = new Point(470, 12);
                My.MyProject.Forms.FrmCreatePreScript.rulesListView.Items.Add(ruleAndActionTextBox.Text);
                ruleAndActionTextBox.Text = "";
            }
            else
            {
                titleLabel.Text      = "Please write down the title";
                titleLabel.BackColor = Color.Red;
            }
        }
Beispiel #2
0
 private void searchWordToolStripTextBox1_TextChanged(object sender, EventArgs e)
 {
     if (!searchWordToolStripTextBox1.Text.Equals(""))
     {
         MdlScripts.populateTemplates(searchWordToolStripTextBox1.Text, Conversions.ToString(typeToolStripComboBox.SelectedItem), templatesListView);
     }
 }
Beispiel #3
0
 private void FrmPreScriptRules_Load(object sender, EventArgs e)
 {
     createUpdateTouchButton.Caption = "Create " + nameOfAction;
     titleLabel.Text      = "Manage " + nameOfAction + "s";
     subTitleLabel.Text   = "Select existing " + nameOfAction.ToLower() + " to edit, delete or create a new one";
     ruleActionLabel.Text = nameOfAction + " Name";
     MdlScripts.populateMessageRules(rulesListView, tableName);
     Size     = (Size) new Point(533, 510);
     Location = new Point((int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Width - Width) / 2d), (int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Height - Height) / 2d));
     closeTouchButton.Location = new Point(470, 12);
 }
Beispiel #4
0
        private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int selectedItem = rulesListView.FocusedItem.Index;
            int ruleID       = Conversions.ToInteger(rulesListView.Items[selectedItem].SubItems[1].Text);

            db.deleteRows(tableName, "where ID = " + ruleID.ToString());
            MdlScripts.populateMessageRules(rulesListView, tableName);
            Size     = (Size) new Point(533, 510);
            Location = new Point((int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Width - Width) / 2d), (int)Math.Round((My.MyProject.Computer.Screen.Bounds.Size.Height - Height) / 2d));
            closeTouchButton.Location = new Point(470, 12);
        }
Beispiel #5
0
        private void EditToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int templateId = Conversions.ToInteger(templatesListView.Items[templatesListView.FocusedItem.Index].SubItems[3].Text);

            My.MyProject.Forms.FrmCreatePreScript.Show();
            isupdate      = true;
            previousTitle = templatesListView.Items[templatesListView.FocusedItem.Index].SubItems[0].Text;
            My.MyProject.Forms.FrmCreatePreScript.createTemplateTouchButton.Caption = "Update Template";
            My.MyProject.Forms.FrmCreatePreScript.titleLabel.Text = "Update message template";
            My.MyProject.Forms.FrmCreatePreScript.createTemplateTouchButton.Update();
            MdlScripts.populateTemplateInfo(templateId);
        }
Beispiel #6
0
 private void addActionLabel_Click(object sender, EventArgs e)
 {
     rulesActionsPanel.Location = new Point(838, 375);
     MdlScripts.populateMessageRules(rulesListView, "[Message Actions]");
     isMessageRule = false;
     if (rulesActionsPanel.Visible & isMessageRule == true)
     {
         rulesActionsPanel.Visible = false;
     }
     else
     {
         rulesActionsPanel.Visible = true;
     }
 }
Beispiel #7
0
        private void createTemplateTouchButton_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(tamplateTitleTextBox.Text) & !string.IsNullOrEmpty(messageRichTextBox.Text))
            {
                if (isNewTitle)
                {
                    titleLabel.BackColor = Color.FromArgb(0, 64, 64);
                    int templateID = 0;
                    if (My.MyProject.Forms.FrmDisplayTemplates.isupdate)
                    {
                        templateID = Conversions.ToInteger(My.MyProject.Forms.FrmDisplayTemplates.templatesListView.Items[My.MyProject.Forms.FrmDisplayTemplates.templatesListView.FocusedItem.Index].SubItems[3].Text);
                    }

                    db.saveTemplate(templateID, Strings.Trim(tamplateTitleTextBox.Text), Conversions.ToString(typeComboBox.SelectedItem), Conversions.ToString(departmentComboBox.SelectedItem), messageRichTextBox);
                    // display confirmation message and clean fields

                    if (My.MyProject.Forms.FrmDisplayTemplates.isupdate)
                    {
                        titleLabel.Text = "Template updated!";
                    }
                    else
                    {
                        titleLabel.Text = "Template created!";
                    }

                    titleLabel.BackColor             = Color.Green;
                    messageRichTextBox.Text          = "";
                    tamplateTitleTextBox.Text        = "";
                    typeComboBox.SelectedIndex       = 0;
                    departmentComboBox.SelectedIndex = 0;
                    MdlScripts.populateTemplates(My.MyProject.Forms.FrmDisplayTemplates.searchWordToolStripTextBox1.Text, Conversions.ToString(My.MyProject.Forms.FrmDisplayTemplates.typeToolStripComboBox.SelectedItem), My.MyProject.Forms.FrmDisplayTemplates.templatesListView);
                    if (My.MyProject.Forms.FrmDisplayTemplates.isupdate)
                    {
                        titleLabel.Text = "Template updated!";
                    }
                    // Me.Close()
                    else
                    {
                        titleLabel.Text = "Template created!";
                    }
                }
                else
                {
                    titleLabel.Text      = "Template title already exists";
                    titleLabel.BackColor = Color.Firebrick;
                }
            }
        }
Beispiel #8
0
 private void bookingStatusShapedLabel_Click(object sender, EventArgs e)
 {
     MdlScripts.addTagLabel(bookingStatusShapedLabel, Color.Gray, messageRichTextBox);
 }
Beispiel #9
0
 private void bookingNumberShapedLabel_Click(object sender, EventArgs e)
 {
     MdlScripts.addTagLabel(bookingNumberShapedLabel, Color.Olive, messageRichTextBox);
 }
Beispiel #10
0
 private void containerWeightShapedLabel_Click(object sender, EventArgs e)
 {
     MdlScripts.addTagLabel(containerWeightShapedLabel, Color.Green, messageRichTextBox);
 }
Beispiel #11
0
 private void dateShapedLabel_Click(object sender, EventArgs e)
 {
     MdlScripts.addTagLabel(dateShapedLabel, Color.FromArgb(128, 64, 64), messageRichTextBox);
 }
Beispiel #12
0
 private void companyNameShapedLabel_Click(object sender, EventArgs e)
 {
     MdlScripts.addTagLabel(companyNameShapedLabel, Color.FromArgb(192, 64, 0), messageRichTextBox);
 }
Beispiel #13
0
 private void containerNumberShapedLabel_Click(object sender, EventArgs e)
 {
     MdlScripts.addTagLabel(containerNumberShapedLabel, Color.Teal, messageRichTextBox);
 }
Beispiel #14
0
 private void Button1_Click(object sender, EventArgs e)
 {
     MdlScripts.setRulesAndActions();
 }
Beispiel #15
0
 private void typeToolStripComboBox_Click(object sender, EventArgs e)
 {
     MdlScripts.populateTemplates(searchWordToolStripTextBox1.Text, Conversions.ToString(typeToolStripComboBox.SelectedItem), templatesListView);
 }