private void button3_Click(object sender, EventArgs e) { button2_Validating(sender, null); nameTxt_Validating(sender, null); if (errorProvider.GetError(button2) != "" || errorProvider.GetError(nameTxt) != "") { UIHelper.errorBox(this, "لطفا خطاها را رفع کنید."); this.DialogResult = System.Windows.Forms.DialogResult.None; } else { Event ev = new Event(); ev.Action = selectedAction; ev.Name = nameTxt.Text; DivanDataContext.Instance.Events.InsertOnSubmit(ev); DivanDataContext.Instance.SubmitChanges(); } }
private void detach_Events(Event entity) { this.SendPropertyChanging(); entity.Action = null; }
private void attach_Events(Event entity) { this.SendPropertyChanging(); entity.Action = this; }
partial void DeleteEvent(Event instance);
partial void UpdateEvent(Event instance);
partial void InsertEvent(Event instance);
private void select_Click(object sender, EventArgs e) { SelectedEvent = (Event)eventsGrid.SelectedRows[0].DataBoundItem; DialogResult = System.Windows.Forms.DialogResult.OK; }