private void Mergebutton_Click(object sender, EventArgs e) { FormFindPublisher fa = new FormFindPublisher(db); DialogResult faresult = fa.ShowDialog(); var pid2 = fa.pubid; //memo("pubid = " + pid.ToString()); //pubid = pid; if (faresult == DialogResult.OK) { Publisher pp2 = (from c in db.Publisher where c.Id == pid2 select c).FirstOrDefault(); if (pp2 != null) { if (p.Id == pp2.Id) { return; } // Initializes the variables to pass to the MessageBox.Show method. string message = "Merge " + pp2.Name + " (" + pp2.Id + ") into " + p.Name + " (" + p.Id + ")?"; string caption = "Confirm merge"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; // Displays the MessageBox. result = MessageBox.Show(message, caption, buttons); if (result == System.Windows.Forms.DialogResult.Yes) { MergePublishers(db, p, pp2); } } } }
private void Publisherbutton_Click(object sender, EventArgs e) { FormFindPublisher fa = new FormFindPublisher(db); DialogResult faresult = fa.ShowDialog(); var pid = fa.pubid; memo("pubid = " + pid.ToString()); if ((faresult == DialogResult.OK) && (pid >= 0)) { FormDoPublisher fd = new FormDoPublisher(db, pid); fd.Show(); } }
private void Publisherbutton_Click(object sender, EventArgs e) { FormFindPublisher fa = new FormFindPublisher(db); DialogResult faresult = fa.ShowDialog(); var pid = fa.pubid; //memo("pubid = " + pid.ToString()); //pubid = pid; if (faresult == DialogResult.OK) { Publisher pp = (from c in db.Publisher where c.Id == pid select c).FirstOrDefault(); if (pp != null) { FormModifyPublisher fmp = new FormModifyPublisher(db, pp); fmp.Show(); } } }
private void Publisherbutton_Click(object sender, EventArgs e) { FormFindPublisher fa = new FormFindPublisher(db); DialogResult faresult = fa.ShowDialog(); var pid = fa.pubid; memo("pubid = " + pid.ToString()); pubid = pid; if (faresult == DialogResult.OK) { Publisher pp = (from c in db.Publisher where c.Id == pubid select c).FirstOrDefault(); if (pp != null) { TB_publisher.Text = pp.Name; } else { pubid = -1; } } }