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; } }
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); }
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); }
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; } }