Example #1
0
        /// <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))
            {
                NewExtractCreated(ExtractName, ExtractId, AParentForm);
            }
            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>
        /// <param name="AExtractMasterRow"></param>
        public static void CreateFamilyExtractForPersons(Form AParentForm, MExtractMasterRow AExtractMasterRow)
        {
            TFrmExtractFindDialog   ExtractFindDialog = new TFrmExtractFindDialog(AParentForm);
            TFrmExtractNamingDialog ExtractNameDialog = new TFrmExtractNamingDialog(AParentForm);
            int    BaseExtractId = 0;
            string BaseExtractName;
            string BaseExtractDescription;
            int    ExtractId = 0;
            string ExtractName;
            string ExtractDescription;

            if (AExtractMasterRow != null)
            {
                BaseExtractId = AExtractMasterRow.ExtractId;

                // inform user what this extract is about and what will happen
                if (MessageBox.Show(Catalog.GetString("A new Extract will be created that will contain all Families of the Persons" +
                                                      " that exist in the Extract '" + AExtractMasterRow.ExtractName + "'."),
                                    Catalog.GetString("Generate Family Extract for Persons"),
                                    MessageBoxButtons.OKCancel,
                                    MessageBoxIcon.Information) == DialogResult.Cancel)
                {
                    return;
                }
            }
            else
            {
                // 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" +
                                                  "A new Extract will be created that 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))
                {
                    NewExtractCreated(ExtractName, ExtractId, AParentForm);
                }
                else
                {
                    MessageBox.Show(Catalog.GetString("Creation of extract failed"),
                                    Catalog.GetString("Generate Family Extract for Persons"),
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Stop);
                    return;
                }
            }
        }
Example #3
0
        /// <summary>
        /// Guide user through process to create extract which contains all family member records (Persons)
        /// of families and persons in a base extract.
        /// </summary>
        /// <param name="AParentForm"></param>
        public static void FamilyMembersExtract(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 Family Members (Persons) of the Families" +
                                              " that exist in the selected Extract."),
                            Catalog.GetString("Generate Family Members Extract"),
                            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.CreateFamilyMembersExtract(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 Members Extract"),
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Stop);
                    return;
                }
            }
        }
Example #4
0
        /// <summary>
        /// Subtract Extracts (open a screen to select extracts to subtract from each other)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SubtractExtracts(System.Object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                TFrmExtractCombineIntersectSubtractDialog ExtractSubtractDialog = new TFrmExtractCombineIntersectSubtractDialog(this.ParentForm);
                String BaseExtractName;

                List <Int32> AIntersectExtractIdList;

                // initialize dialog
                ExtractSubtractDialog.SetMode(TFrmExtractCombineIntersectSubtractDialog.TMode.ecisSubtractMode);

                if (ucoExtractMasterList.GetSelectedDetailRow() != null)
                {
                    // Show currently selected extract in the grid in the dialog
                    ExtractSubtractDialog.PreSelectExtract(ucoExtractMasterList.GetSelectedDetailRow());
                }

                // show dialog so the user can select extracts to be subtracted
                ExtractSubtractDialog.ShowDialog();

                if (ExtractSubtractDialog.DialogResult != System.Windows.Forms.DialogResult.Cancel)
                {
                    // Get values from the Dialog
                    ExtractSubtractDialog.GetReturnedParameters(out BaseExtractName, out AIntersectExtractIdList);

                    // now first the user needs to give the new intersected extract a name
                    TFrmExtractNamingDialog ExtractNameDialog = new TFrmExtractNamingDialog(this);
                    int    NewExtractId = 0;
                    string NewExtractName;
                    string NewExtractDescription;

                    ExtractNameDialog.ShowDialog();

                    if (ExtractNameDialog.DialogResult != System.Windows.Forms.DialogResult.Cancel)
                    {
                        /* Get values from the Dialog */
                        ExtractNameDialog.GetReturnedParameters(out NewExtractName, out NewExtractDescription);
                    }
                    else
                    {
                        // dialog was cancelled, do not continue with extract generation
                        return;
                    }

                    this.Cursor = Cursors.WaitCursor;

                    ExtractNameDialog.Dispose();

                    if (TRemote.MPartner.Partner.WebConnectors.SubtractExtracts
                            (NewExtractName, NewExtractDescription, BaseExtractName, AIntersectExtractIdList,
                            out NewExtractId))
                    {
                        ucoExtractMasterList.RefreshExtractList(sender, e);

                        MessageBox.Show(Catalog.GetString("Subtract Extracts successful."));
                    }
                }

                ExtractSubtractDialog.Dispose();
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }