/// <summary> /// Open a new screen to show details and maintain the currently selected extract /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void MaintainExtract(System.Object sender, EventArgs e) { if (!WarnIfNotSingleSelection(Catalog.GetString("Maintain Extract")) && (GetSelectedDetailRow() != null)) { TFrmExtractMaintain frm = new TFrmExtractMaintain(this.FindForm()); frm.ExtractId = GetSelectedDetailRow().ExtractId; frm.ExtractName = GetSelectedDetailRow().ExtractName; frm.Show(); } }
// once an extract has been created, this will refresh extract master screen and open maintainance screen for extract private static void NewExtractCreated(string AExtractName, int AExtractId, Form AParentForm) { // refresh extract master screen if it is open TFormsMessage BroadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcExtractCreated); BroadcastMessage.SetMessageDataName(AExtractName); TFormsList.GFormsList.BroadcastFormMessage(BroadcastMessage); // now open Screen for new extract so user can add partner records manually TFrmExtractMaintain frm = new TFrmExtractMaintain(AParentForm); frm.ExtractId = AExtractId; frm.ExtractName = AExtractName; frm.Show(); }
/// <summary> /// prompt user for name of a new manual extract, create it and open screen for it /// </summary> /// <param name="AParentForm"></param> public static void PartnerNewManualExtract(Form AParentForm) { TFrmExtractNamingDialog ExtractNameDialog = new TFrmExtractNamingDialog(AParentForm); int ExtractId = 0; string ExtractName; string ExtractDescription; ExtractNameDialog.ShowDialog(); if (ExtractNameDialog.DialogResult != System.Windows.Forms.DialogResult.Cancel) { /* Get values from the Dialog */ ExtractNameDialog.GetReturnedParameters(out ExtractName, out ExtractDescription); } else { // dialog was cancelled, do not continue with extract generation return; } ExtractNameDialog.Dispose(); // create empty extract with given name and description and store it in db if (TRemote.MPartner.Partner.WebConnectors.CreateEmptyExtract(ref ExtractId, ExtractName, ExtractDescription)) { // now open Screen for new extract so user can add partner records manually TFrmExtractMaintain frm = new TFrmExtractMaintain(AParentForm); frm.ExtractId = ExtractId; frm.ExtractName = ExtractName; frm.Show(); } else { MessageBox.Show(Catalog.GetString("Creation of extract failed"), Catalog.GetString("Generate Manual Extract"), MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } }
/// <summary> /// Guide user through process to create extract which contains all family records of /// Persons in a base extract. /// </summary> /// <param name="AParentForm"></param> public static void FamilyExtractForPersons(Form AParentForm) { TFrmExtractFindDialog ExtractFindDialog = new TFrmExtractFindDialog(AParentForm); TFrmExtractNamingDialog ExtractNameDialog = new TFrmExtractNamingDialog(AParentForm); int BaseExtractId = 0; string BaseExtractName; string BaseExtractDescription; int ExtractId = 0; string ExtractName; string ExtractDescription; // inform user what this extract is about and what will happen MessageBox.Show(Catalog.GetString("Please select an existing Extract with the Find Screen that follows.\r\n\r\n" + "The new Extract will contain all Families of the Persons" + " that exist in the selected Extract."), Catalog.GetString("Generate Family Extract for Persons"), MessageBoxButtons.OK, MessageBoxIcon.Information); // let the user select base extract ExtractFindDialog.ShowDialog(true); // get data for selected base extract ExtractFindDialog.GetResult(out BaseExtractId, out BaseExtractName, out BaseExtractDescription); ExtractFindDialog.Dispose(); // only continue if a base extract was selected if (BaseExtractId >= 0) { ExtractNameDialog.ShowDialog(); if (ExtractNameDialog.DialogResult != System.Windows.Forms.DialogResult.Cancel) { /* Get values from the Dialog */ ExtractNameDialog.GetReturnedParameters(out ExtractName, out ExtractDescription); ExtractNameDialog.Dispose(); } else { // dialog was cancelled, do not continue with extract generation ExtractNameDialog.Dispose(); return; } // create extract with given name and description and store it in db if (TRemote.MPartner.Partner.WebConnectors.CreateFamilyExtractForPersons(BaseExtractId, ref ExtractId, ExtractName, ExtractDescription)) { // now open Screen for new extract so user can see the result TFrmExtractMaintain frm = new TFrmExtractMaintain(AParentForm); frm.ExtractId = ExtractId; frm.ExtractName = ExtractName; frm.Show(); } else { MessageBox.Show(Catalog.GetString("Creation of extract failed"), Catalog.GetString("Generate Family Extract for Persons"), MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } } }
private void CreateExtract_Click(System.Object sender, EventArgs e) { TFrmExtractNamingDialog ExtractNameDialog = new TFrmExtractNamingDialog(this); IPartnerUIConnectorsPartnerNewExtract PartnerExtractObject = TRemote.MPartner.Extracts.UIConnectors.PartnerNewExtract(); int ExtractId = 0; string ExtractName; string ExtractDescription; ExtractNameDialog.ShowDialog(); if (ExtractNameDialog.DialogResult != System.Windows.Forms.DialogResult.Cancel) { /* Get values from the Dialog */ ExtractNameDialog.GetReturnedParameters(out ExtractName, out ExtractDescription); } else { // dialog was cancelled, do not continue with extract generation return; } ExtractNameDialog.Dispose(); this.Cursor = Cursors.WaitCursor; DataTable PartnerKeysTable = ((DevAge.ComponentModel.BoundDataView)grdApplications.DataSource).DataView.ToTable(); // create empty extract with given name and description and store it in db if (PartnerExtractObject.CreateExtractFromListOfPartnerKeys(ExtractName, ExtractDescription, out ExtractId, PartnerKeysTable, 0, false)) { this.Cursor = Cursors.Default; if (MessageBox.Show( string.Format( Catalog.GetString( "Extract Created with {0} Partners.{1}{1}Do you want to open the 'Maintain Extract' screen now?"), PartnerKeysTable.Rows.Count, "\n"), Catalog.GetString("Create Extract"), MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { // now open Screen for new extract so user can add partner records manually TFrmExtractMaintain frm = new TFrmExtractMaintain(this); frm.ExtractId = ExtractId; frm.ExtractName = ExtractName; frm.Show(); } } else { this.Cursor = Cursors.Default; MessageBox.Show(Catalog.GetString("Creation of extract failed"), Catalog.GetString("Generate Manual Extract"), MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } }