private void butDeletesite_Click(object sender, EventArgs e) { if (lsvGroups.SelectedItems.Count > 0 && _error == false) //b { ForlabSite site = this.GetSelectedSite(); if (site != null && MessageBox.Show("Are you sure you want to delete this site?", "Delete Site", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { DataRepository.DeleteSite(site); DataRepository.CloseSession(); //b _region = DataRepository.GetRegionById(site.Region.Id); //b } catch (Exception ex) { _error = true; FrmShowError frm = new FrmShowError(new ExceptionStatus() { message = "Site could not be deleted.", ex = ex }); frm.ShowDialog(); LQTUserMessage msg = SaveOrUpdateObject();//added b this.Close(); } } DisplaySites(); } }
void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true); TestingArea ta = _test.TestingArea; TestingGroup tg = _test.TestingGroup; _test = new Test(); _test.TestingArea = ta; _test.TestingGroup = tg; // LoadTestCtr(); SetControlState(); comGroup.Enabled = true; comTestarea.Enabled = true; _isedited = false; } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
private void butDeletepro_Click(object sender, EventArgs e) { if (lsvGroups.SelectedItems.Count > 0 && _error == false)//b { MasterProduct pro = this.GetSelectedProduct(); if (pro != null && MessageBox.Show("Are you sure you want to delete this Product?", "Delete Product", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { //_proType.Products.Remove(pro); DataRepository.DeleteProduct(pro); DataRepository.CloseSession(); //b _proType = DataRepository.GetProductTypeById(pro.ProductType.Id); //b } catch (Exception ex) { _error = true; // throw new LQTUserException(ex.Message); FrmShowError frm = new FrmShowError(new ExceptionStatus() { message = "Product could not be deleted.", ex = ex }); frm.ShowDialog(); LQTUserMessage msg = SaveOrUpdateObject();//added b this.Close(); } } DisplayProducts(); } }
private void FrmProtocol_FormClosing(object sender, FormClosingEventArgs e) { if (_isedited) { System.Windows.Forms.DialogResult dr = MessageBox.Show("Do you want to save changes?", "Edit Protocol", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); try { if (dr == System.Windows.Forms.DialogResult.Yes) { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message); } else if (dr == System.Windows.Forms.DialogResult.Cancel) { e.Cancel = true; } } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); e.Cancel = true; } } }
void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, _reloadCtr); DataRepository.CloseSession(); ForlabRegion r = _site.Region; SiteCategory sc = _site.SiteCategory; _site = new ForlabSite(); _site.Region = r; _site.SiteCategory = sc; LoadSiteCtr(); _isedited = false; if (_site.SiteCategory != null)//b { comCategory.SelectedValue = _site.SiteCategory.Id; } } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
void lqtToolStrip1_SaveAndCloseClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); DataRepository.CloseSession(); this.Close(); } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
void lqtToolStrip1_SaveAndCloseClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true); DataRepository.CloseSession(); this.Close(); } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message); DataRepository.CloseSession(); ((LqtMainWindowForm)_mdiparent).BuildNavigationMenu(); _testingArea = new TestingArea(); LoadTestingAreaCtr(); } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
private void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiParentForm).ShowStatusBarInfo(msg.Message, true); MorbidityTest mtest = new MorbidityTest(); mtest.ClassOfTest = _morbidityTest.ClassOfTest; _morbidityTest = mtest; BindMorbidityTest(); } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
void lqtToolStrip1_SaveAndCloseClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true); //DataRepository.CloseSession(); ((LqtMainWindowForm)_mdiparent).BuildNavigationMenu(); this.Close(); } catch (LQTUserException ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText("There is already a Test-Group with this group name.", ex)).ShowDialog(); } }
private void SiteForm_FormClosing(object sender, FormClosingEventArgs e) { if (_isedited) { System.Windows.Forms.DialogResult dr = MessageBox.Show("Do you want to save changes to site?", "Edit Site", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); try { if (dr == System.Windows.Forms.DialogResult.Yes) { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, _reloadCtr); } else if (dr == System.Windows.Forms.DialogResult.No) { if (lsvInstrument.Items.Count > 0)//b { if (TestDaysCount() != "") { RemoveTestDays(); } if (TestInstrumentPercentage() == "")//b { } else { RemoveTestPercentage(); } } } else if (dr == System.Windows.Forms.DialogResult.Cancel) { e.Cancel = true; } } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); e.Cancel = true; } } }
void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true); //DataRepository.CloseSession(); ProductType pt = _product.ProductType; _product = new MasterProduct(); _product.ProductType = pt; LoadProductCtr(); } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true); //DataRepository.CloseSession(); ((LqtMainWindowForm)_mdiparent).BuildNavigationMenu(); _testingGroup = new TestingGroup(); //_testingGroup.TestingArea = LqtUtil.GetComboBoxValue<TestingArea>(comTestarea); LoadTestingAreaCtr(); } catch (LQTUserException ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText("There is already a Test-Group with this group name.", ex)).ShowDialog(); } }
void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e) { try { LQTUserMessage msg = SaveOrUpdateObject(); ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true); DataRepository.CloseSession(); TestingArea ta = _instrument.TestingArea; _instrument = new Instrument(); _instrument.TestingArea = ta; LoadInstrumentCtr(); //if (_instrument.TestingArea != null)//b //{ // comTestarea.SelectedValue = _instrument.TestingArea.Id; //} comTestarea.SelectedIndex = -1; } catch (Exception ex) { new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }