private void btnHome_Click(object sender, RoutedEventArgs e) { frmHomeMaster frm = new frmHomeMaster(); this.Close(); frm.ShowDialog(); }
private void btnBack_Click(object sender, RoutedEventArgs e) { if (sFormName == "HOME") { frmHomeMaster frm = new frmHomeMaster(); this.Close(); frm.ShowDialog(); } else { this.Close(); } }
private void btnBack_Click(object sender, RoutedEventArgs e) { try { if (sFormName == "HOME") { frmHomeMaster frm = new frmHomeMaster(); this.Close(); frm.ShowDialog(); } else { this.Close(); } } catch (Exception ex) { Nube.ExceptionLogging.SendErrorToText(ex); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { try { if (txtOrganisationName.Text == "") { MessageBox.Show("Enter Organisation ...", "Information", MessageBoxButton.OK, MessageBoxImage.Error); txtOrganisationName.Focus(); } else { if (MessageBox.Show("Do you want to save this record?", "SAVE CONFIRMATION", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { if (db.MASTERNAMESETUPs.Where(x => x.ORGANISATION_NAME == txtOrganisationName.Text).ToString() == txtOrganisationName.Text.ToString()) { MessageBox.Show("'" + txtOrganisationName.Text + "' Already exist.Enter new relation.", "Information", MessageBoxButton.OK, MessageBoxImage.Error); txtOrganisationName.Focus(); } else { if (txtOrganisationName.Text != "") { MASTERNAMESETUP ms = db.MASTERNAMESETUPs.Where(x => x.ORGANISATION_NAME == txtOrganisationName.Text).FirstOrDefault(); var OldData = new JSonHelper().ConvertObjectToJSon(ms); ms.ORGANISATION_NAME = txtOrganisationName.Text; ms.ADDRESS1 = txtAddress1.Text; ms.ADDRESS2 = txtAddress2.Text; ms.ADDRESS3 = txtAddress3.Text; ms.CITY = txtCity.Text; ms.STATE = txtState.Text; ms.COUNTRY = txtCountry.Text; ms.PHONE = txtPhoneNo.Text; ms.ZIPCODE = txtZipCode.Text; ms.SERVERNAME = txtServerName.Text; ms.NEWEXEPATH = txtExePath.Text; ms.NEWIMAGESPATH = txtNewImagePath.Text; ms.NEWREPORTSPATH = txtNewReportPath.Text; ms.SERVERNAME = txtServerName.Text; ms.VERSION = txtVersion.Text; ms.EnterenceFees = Convert.ToDecimal(txtEntranceFeed.Text); ms.BadgeAmount = Convert.ToDecimal(txtBadgeAmt.Text); ms.BF = Convert.ToDecimal(txtBF.Text); ms.BuildingFund = Convert.ToDecimal(txtBuildingFund.Text); ms.Insurance = Convert.ToDecimal(txtInsurance.Text); ms.Subscription = Convert.ToDecimal(txtSubscription.Text); ms.LevyAmount = Convert.ToDecimal(txtLevyAmount.Text); ms.TDFAmount = Convert.ToDecimal(txtTDFAmount.Text); ms.RejoinAmount = Convert.ToDecimal(txtRejoinAmount.Text); ms.SenderEmailId = txtEmailID.Text; ms.SenderPassword = txtPassword.Password; ms.CCEamilId1 = txtCCEmailID1.Text; ms.CCEamilId2 = txtCCEmailID2.Text; ms.PrinterName = txtPrinterName.Text; ms.BackUpPath = txtPath.Text; db.SaveChanges(); var NewData = new JSonHelper().ConvertObjectToJSon(ms); AppLib.EventHistory(this.Tag.ToString(), 1, OldData, NewData, "MASTERNAMESETUP"); MessageBox.Show("Saved Successfully!", "SAVED", MessageBoxButton.OK, MessageBoxImage.Information); if (sFormName == "HOME") { frmHomeMaster frm = new frmHomeMaster(); this.Close(); frm.ShowDialog(); } else { this.Close(); } } else { MASTERNAMESETUP ms = new MASTERNAMESETUP(); ms.ORGANISATION_NAME = txtOrganisationName.Text; ms.ADDRESS1 = txtAddress1.Text; ms.ADDRESS2 = txtAddress2.Text; ms.ADDRESS3 = txtAddress3.Text; ms.CITY = txtCity.Text; ms.STATE = txtState.Text; ms.COUNTRY = txtCountry.Text; ms.PHONE = txtPhoneNo.Text; ms.ZIPCODE = txtZipCode.Text; ms.SERVERNAME = txtServerName.Text; ms.NEWEXEPATH = txtExePath.Text; ms.NEWIMAGESPATH = txtNewImagePath.Text; ms.NEWREPORTSPATH = txtNewReportPath.Text; ms.SERVERNAME = txtServerName.Text; ms.VERSION = txtVersion.Text; ms.EnterenceFees = Convert.ToDecimal(txtEntranceFeed.Text); ms.BadgeAmount = Convert.ToDecimal(txtBadgeAmt.Text); ms.BF = Convert.ToDecimal(txtBF.Text); ms.BuildingFund = Convert.ToDecimal(txtBuildingFund.Text); ms.Insurance = Convert.ToDecimal(txtInsurance.Text); ms.Subscription = Convert.ToDecimal(txtSubscription.Text); ms.LevyAmount = Convert.ToDecimal(txtLevyAmount.Text); ms.TDFAmount = Convert.ToDecimal(txtTDFAmount.Text); ms.RejoinAmount = Convert.ToDecimal(txtRejoinAmount.Text); ms.SenderEmailId = txtEmailID.Text; ms.SenderPassword = txtPassword.Password; ms.CCEamilId1 = txtCCEmailID1.Text; ms.CCEamilId2 = txtCCEmailID2.Text; ms.PrinterName = txtPrinterName.Text; ms.BackUpPath = txtPath.Text; db.MASTERNAMESETUPs.Add(ms); db.SaveChanges(); var NewData = new JSonHelper().ConvertObjectToJSon(ms); AppLib.EventHistory(this.Tag.ToString(), 0, "", NewData, "MASTERNAMESETUP"); MessageBox.Show("Saved Successfully!", "SAVED", MessageBoxButton.OK, MessageBoxImage.Information); if (sFormName == "HOME") { frmHomeMaster frm = new frmHomeMaster(); this.Close(); frm.ShowDialog(); } else { this.Close(); } } } } } } catch (Exception ex) { Nube.ExceptionLogging.SendErrorToText(ex); } }