Beispiel #1
0
 partial void DeleteSubAction(SubAction instance);
Beispiel #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            button_selectAsset_Validating(null, null);
            button_selectLabel_Validating(null, null);

            if (errorProvider.GetError(button_selectLabel) != "" ||
                errorProvider.GetError(button_selectAsset) != "" ||
                errorProvider.GetError(textBox_value) != "" ||
                errorProvider.GetError(nameTxt) != "")
            {
                UIHelper.errorBox(this, "لطفا خطاهای ورودی را رفع کنید");
                this.DialogResult = System.Windows.Forms.DialogResult.None;
                return;
            }

            action = new Action();
            action.name = nameTxt.Text;
            action.Label = label;
            action.Asset = asset;
            action.value = textBox_value.Text;
            action.needsAutoRun = autoRunable.Checked;
            action.autoRunPeriod = Convert.ToInt32(textBox_period.Text);

            DivanDataContext.Instance.Actions.InsertOnSubmit(action);

            if (compositAsset.Checked)
            {
                for (int i = 0; i < subActionList.Items.Count; i++)
                {
                    Action item = (Action)subActionList.Items[i];
                    SubAction subAction = new SubAction();
                    subAction.Parent = action;
                    subAction.Child = item;
                    DivanDataContext.Instance.SubActions.InsertOnSubmit(subAction);
                }
            }
            DivanDataContext.Instance.SubmitChanges();
        }
Beispiel #3
0
 partial void UpdateSubAction(SubAction instance);
Beispiel #4
0
 partial void InsertSubAction(SubAction instance);
Beispiel #5
0
		private void detach_SubActions(SubAction entity)
		{
			this.SendPropertyChanging();
			entity.Parent = null;
		}
Beispiel #6
0
		private void attach_SubActions(SubAction entity)
		{
			this.SendPropertyChanging();
			entity.Parent = this;
		}
Beispiel #7
0
		private void attach_SuperActions(SubAction entity)
		{
			this.SendPropertyChanging();
			entity.Child = this;
		}