private void ShowDetailsManual(IndividualDataTDSPmGeneralApplicationRow ARow)
        {
            if (ARow != null)
            {
                pnlDetails.Visible = true;

                if (IsEventApplication(ARow))
                {
                    PmShortTermApplicationRow EventApplicationRow;
                    EventApplicationRow         = GetEventApplicationRow(ARow);
                    pnlApplicationEvent.Visible = true;
                    pnlApplicationField.Visible = false;
                    ucoApplicationEvent.ShowDetails(ARow, EventApplicationRow);
                }
                else
                {
                    PmYearProgramApplicationRow FieldApplicationRow;
                    FieldApplicationRow         = GetFieldApplicationRow(ARow);
                    pnlApplicationEvent.Visible = false;
                    pnlApplicationField.Visible = true;
                    ucoApplicationField.ShowDetails(ARow, FieldApplicationRow);
                }
            }

            // In theory, the next Method call could be done in Methods NewRowManual; however, NewRowManual runs before
            // the Row is actually added and this would result in the Count to be one too less, so we do the Method call here, short
            // of a non-existing 'AfterNewRowManual' Method....
            DoRecalculateScreenParts();
        }
        private PmYearProgramApplicationRow GetFieldApplicationRow(IndividualDataTDSPmGeneralApplicationRow ARow)
        {
            DataRow Row;

            Row = FMainDS.PmYearProgramApplication.Rows.Find
                      (new object[] { ARow.PartnerKey, ARow.ApplicationKey, ARow.RegistrationOffice });
            return((PmYearProgramApplicationRow)Row);
        }
        /// <summary>
        /// This Procedure will get called from the SaveChanges procedure before it
        /// actually performs any saving operation.
        /// </summary>
        /// <param name="sender">The Object that throws this Event</param>
        /// <param name="e">Event Arguments.
        /// </param>
        /// <returns>void</returns>
        private void DataSavingStarted(System.Object sender, System.EventArgs e)
        {
            IndividualDataTDSPmGeneralApplicationRow Row = GetSelectedDetailRow();

            if (Row != null)
            {
                GetDetailsFromControls(Row);
            }
        }
 private void PostDeleteManual(IndividualDataTDSPmGeneralApplicationRow ARowToDelete,
                               Boolean AAllowDeletion,
                               Boolean ADeletionPerformed,
                               String ACompletionMessage)
 {
     if (ADeletionPerformed)
     {
         DoRecalculateScreenParts();
     }
 }
 private bool IsEventApplication(IndividualDataTDSPmGeneralApplicationRow ARow)
 {
     // check if there is a corresponding record in short term applications
     if (FMainDS.PmShortTermApplication.Rows.Contains
             (new object[] { ARow.PartnerKey, ARow.ApplicationKey, ARow.RegistrationOffice }))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
 private void GetDetailsFromControls(IndividualDataTDSPmGeneralApplicationRow ARow, bool AIsNewRow = false)
 {
     if (IsEventApplication(ARow))
     {
         PmShortTermApplicationRow EventApplicationRow;
         EventApplicationRow = GetEventApplicationRow(ARow);
         ucoApplicationEvent.GetDetails(ARow, EventApplicationRow);
     }
     else
     {
         PmYearProgramApplicationRow FieldApplicationRow;
         FieldApplicationRow = GetFieldApplicationRow(ARow);
         ucoApplicationField.GetDetails(ARow, FieldApplicationRow);
     }
 }
        private bool DeleteRowManual(IndividualDataTDSPmGeneralApplicationRow ARowToDelete, ref String ACompletionMessage)
        {
            ACompletionMessage = String.Empty;

            // along with the general application record the specific record needs to be deleted
            if (IsEventApplication(ARowToDelete))
            {
                GetEventApplicationRow(ARowToDelete).Delete();
            }
            else
            {
                GetFieldApplicationRow(ARowToDelete).Delete();
            }

            ARowToDelete.Delete();

            return(true);
        }
        /// <summary>
        /// add a new short term application
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NewRowShortTermApp(System.Object sender, EventArgs e)
        {
            // Clear any validation errors so that the following call to ValidateAllData starts with a 'clean slate'.
            FPetraUtilsObject.VerificationResultCollection.Clear();

            if (ValidateAllData(true, TErrorProcessingMode.Epm_IgnoreNonCritical))
            {
                // we create the table locally, no dataset
                IndividualDataTDSPmGeneralApplicationRow NewRowGeneralApp = FMainDS.PmGeneralApplication.NewRowTyped(true);
                PmShortTermApplicationRow NewRowShortTermApp = FMainDS.PmShortTermApplication.NewRowTyped(true);

                NewRowGeneralApp.PartnerKey                 = FMainDS.PPerson[0].PartnerKey;
                NewRowGeneralApp.ApplicationKey             = GetNextApplicationKey();
                NewRowGeneralApp.RegistrationOffice         = TSystemDefaults.GetSiteKeyDefault();
                NewRowGeneralApp.GenAppDate                 = DateTime.Today;
                NewRowGeneralApp.ApplicationForEventOrField = Catalog.GetString("Event");

                //TODO temp, needs to be changed
                NewRowGeneralApp.AppTypeName = "CONFERENCE";
                NewRowGeneralApp.OldLink     =
                    TSystemDefaults.GetSiteKeyDefault().ToString() + ";" + NewRowGeneralApp.ApplicationKey.ToString();
                NewRowGeneralApp.GenApplicantType = "Participant";

                NewRowShortTermApp.PartnerKey         = NewRowGeneralApp.PartnerKey;
                NewRowShortTermApp.ApplicationKey     = NewRowGeneralApp.ApplicationKey;
                NewRowShortTermApp.RegistrationOffice = NewRowGeneralApp.RegistrationOffice;
                NewRowShortTermApp.StAppDate          = NewRowGeneralApp.GenAppDate;

                //TODO temp, needs to be changed
                NewRowShortTermApp.StApplicationType = "A";
                NewRowShortTermApp.StBasicOutreachId = NewRowGeneralApp.OldLink;

                FMainDS.PmGeneralApplication.Rows.Add(NewRowGeneralApp);
                FMainDS.PmShortTermApplication.Rows.Add(NewRowShortTermApp);

                FPetraUtilsObject.SetChangedFlag();

                grdDetails.DataSource = null;
                grdDetails.DataSource = new DevAge.ComponentModel.BoundDataView(FMainDS.PmGeneralApplication.DefaultView);

                SelectDetailRowByDataTableIndex(FMainDS.PmGeneralApplication.Rows.Count - 1);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// add a new long term application
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NewRowLongTermApp(System.Object sender, EventArgs e)
        {
            // Clear any validation errors so that the following call to ValidateAllData starts with a 'clean slate'.
            FPetraUtilsObject.VerificationResultCollection.Clear();

            if (ValidateAllData(true, true))
            {
                // we create the table locally, no dataset
                IndividualDataTDSPmGeneralApplicationRow NewRowGeneralApp = FMainDS.PmGeneralApplication.NewRowTyped(true);
                PmYearProgramApplicationRow NewRowLongTermApp             = FMainDS.PmYearProgramApplication.NewRowTyped(true);

                NewRowGeneralApp.PartnerKey                 = FMainDS.PPerson[0].PartnerKey;
                NewRowGeneralApp.ApplicationKey             = GetNextApplicationKey();
                NewRowGeneralApp.RegistrationOffice         = Convert.ToInt64(TSystemDefaults.GetSystemDefault(SharedConstants.SYSDEFAULT_SITEKEY, ""));
                NewRowGeneralApp.GenAppDate                 = DateTime.Today;
                NewRowGeneralApp.ApplicationForEventOrField = Catalog.GetString("Field");

                //TODO temp, needs to be changed
                NewRowGeneralApp.AppTypeName = "FIELD";
                NewRowGeneralApp.OldLink     =
                    TSystemDefaults.GetSystemDefault(SharedConstants.SYSDEFAULT_SITEKEY, "") + ";" + NewRowGeneralApp.ApplicationKey.ToString();;
                NewRowGeneralApp.GenApplicantType = "Participant";

                NewRowLongTermApp.PartnerKey         = NewRowGeneralApp.PartnerKey;
                NewRowLongTermApp.ApplicationKey     = NewRowGeneralApp.ApplicationKey;
                NewRowLongTermApp.RegistrationOffice = NewRowGeneralApp.RegistrationOffice;

                //TODO temp, needs to be changed
                NewRowLongTermApp.YpAppDate      = NewRowGeneralApp.GenAppDate;
                NewRowLongTermApp.YpBasicAppType = "Field";

                FMainDS.PmGeneralApplication.Rows.Add(NewRowGeneralApp);
                FMainDS.PmYearProgramApplication.Rows.Add(NewRowLongTermApp);

                FPetraUtilsObject.SetChangedFlag();

                grdDetails.DataSource = null;
                grdDetails.DataSource = new DevAge.ComponentModel.BoundDataView(FMainDS.PmGeneralApplication.DefaultView);

                SelectDetailRowByDataTableIndex(FMainDS.PmGeneralApplication.Rows.Count - 1);
            }
        }
        private void ValidateDataDetailsManual(IndividualDataTDSPmGeneralApplicationRow ARow)
        {
            if (IsEventApplication(ARow))
            {
                ucoApplicationEvent.ValidateAllData(TErrorProcessingMode.Epm_None);
            }
            else
            {
                ucoApplicationField.ValidateAllData(TErrorProcessingMode.Epm_None);
            }

            // Since this is a special case of OpenPetra UI (a UserControl in a UserControl)
            // this special treatment is introduced so verification can work. The ResultContext is modified
            // to the outer UserControl (this) so the validation (FindUserControlOrForm) actually
            // picks up the right one and does not stop at the inner one and quits.
            foreach (TVerificationResult si in FPetraUtilsObject.VerificationResultCollection)
            {
                si.OverrideResultContext(this);
            }
        }
        private bool PreDeleteManual(IndividualDataTDSPmGeneralApplicationRow ARowToDelete, ref String ADeletionQuestion)
        {
            if (IsEventApplication(ARowToDelete))
            {
                ADeletionQuestion  = Catalog.GetString("Are you sure you want to delete the current row?");
                ADeletionQuestion += String.Format("{0}{0}({1} {2} {3})",
                                                   Environment.NewLine,
                                                   ucoApplicationEvent.EventLabelText,
                                                   ucoApplicationEvent.EventValueCode,
                                                   ucoApplicationEvent.EventValueLabel);
            }
            else
            {
                ADeletionQuestion  = Catalog.GetString("Are you sure you want to delete the current row?");
                ADeletionQuestion += String.Format("{0}{0}({1} {2} {3})",
                                                   Environment.NewLine,
                                                   ucoApplicationField.FieldLabelText,
                                                   ucoApplicationField.FieldValueCode,
                                                   ucoApplicationField.FieldValueLabel);
            }

            return(true);
        }
        private bool PreDeleteManual(IndividualDataTDSPmGeneralApplicationRow ARowToDelete, ref String ADeletionQuestion)
        {
            if (IsEventApplication(ARowToDelete))
            {
                ADeletionQuestion = Catalog.GetString("Are you sure you want to delete the current row?");
                ADeletionQuestion += String.Format("{0}{0}({1} {2} {3})",
                    Environment.NewLine,
                    ucoApplicationEvent.EventLabelText,
                    ucoApplicationEvent.EventValueCode,
                    ucoApplicationEvent.EventValueLabel);
            }
            else
            {
                ADeletionQuestion = Catalog.GetString("Are you sure you want to delete the current row?");
                ADeletionQuestion += String.Format("{0}{0}({1} {2} {3})",
                    Environment.NewLine,
                    ucoApplicationField.FieldLabelText,
                    ucoApplicationField.FieldValueCode,
                    ucoApplicationField.FieldValueLabel);
            }

            return true;
        }
        private bool DeleteRowManual(IndividualDataTDSPmGeneralApplicationRow ARowToDelete, ref String ACompletionMessage)
        {
            ACompletionMessage = String.Empty;

            // along with the general application record the specific record needs to be deleted
            if (IsEventApplication(ARowToDelete))
            {
                GetEventApplicationRow(ARowToDelete).Delete();
            }
            else
            {
                GetFieldApplicationRow(ARowToDelete).Delete();
            }

            ARowToDelete.Delete();

            return true;
        }
 private void PostDeleteManual(IndividualDataTDSPmGeneralApplicationRow ARowToDelete,
     Boolean AAllowDeletion,
     Boolean ADeletionPerformed,
     String ACompletionMessage)
 {
     if (ADeletionPerformed)
     {
         DoRecalculateScreenParts();
     }
 }
 private bool IsEventApplication(IndividualDataTDSPmGeneralApplicationRow ARow)
 {
     // check if there is a corresponding record in short term applications
     if (FMainDS.PmShortTermApplication.Rows.Contains
             (new object[] { ARow.PartnerKey, ARow.ApplicationKey, ARow.RegistrationOffice }))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
        private PmYearProgramApplicationRow GetFieldApplicationRow(IndividualDataTDSPmGeneralApplicationRow ARow)
        {
            DataRow Row;

            Row = FMainDS.PmYearProgramApplication.Rows.Find
                      (new object[] { ARow.PartnerKey, ARow.ApplicationKey, ARow.RegistrationOffice });
            return (PmYearProgramApplicationRow)Row;
        }
        private void ShowDetailsManual(IndividualDataTDSPmGeneralApplicationRow ARow)
        {
            if (ARow != null)
            {
                pnlDetails.Visible = true;

                if (IsEventApplication(ARow))
                {
                    PmShortTermApplicationRow EventApplicationRow;
                    EventApplicationRow = GetEventApplicationRow(ARow);
                    pnlApplicationEvent.Visible = true;
                    pnlApplicationField.Visible = false;
                    ucoApplicationEvent.ShowDetails(ARow, EventApplicationRow);
                }
                else
                {
                    PmYearProgramApplicationRow FieldApplicationRow;
                    FieldApplicationRow = GetFieldApplicationRow(ARow);
                    pnlApplicationEvent.Visible = false;
                    pnlApplicationField.Visible = true;
                    ucoApplicationField.ShowDetails(ARow, FieldApplicationRow);
                }
            }

            // In theory, the next Method call could be done in Methods NewRowManual; however, NewRowManual runs before
            // the Row is actually added and this would result in the Count to be one too less, so we do the Method call here, short
            // of a non-existing 'AfterNewRowManual' Method....
            DoRecalculateScreenParts();
        }
 private void GetDetailsFromControls(IndividualDataTDSPmGeneralApplicationRow ARow, bool AIsNewRow = false)
 {
     if (IsEventApplication(ARow))
     {
         PmShortTermApplicationRow EventApplicationRow;
         EventApplicationRow = GetEventApplicationRow(ARow);
         ucoApplicationEvent.GetDetails(ARow, EventApplicationRow);
     }
     else
     {
         PmYearProgramApplicationRow FieldApplicationRow;
         FieldApplicationRow = GetFieldApplicationRow(ARow);
         ucoApplicationField.GetDetails(ARow, FieldApplicationRow);
     }
 }
 private void NewRowManual(ref IndividualDataTDSPmGeneralApplicationRow ARow)
 {
 }
 private void NewRowManual(ref IndividualDataTDSPmGeneralApplicationRow ARow)
 {
 }
        private void ValidateDataDetailsManual(IndividualDataTDSPmGeneralApplicationRow ARow)
        {
            if (IsEventApplication(ARow))
            {
                ucoApplicationEvent.ValidateAllData(false);
            }
            else
            {
                ucoApplicationField.ValidateAllData(false);
            }

            // Since this is a special case of OpenPetra UI (a UserControl in a UserControl)
            // this special treatment is introduced so verification can work. The ResultContext is modified
            // to the outer UserControl (this) so the validation (FindUserControlOrForm) actually
            // picks up the right one and does not stop at the inner one and quits.
            foreach (TVerificationResult si in FPetraUtilsObject.VerificationResultCollection)
            {
                si.OverrideResultContext(this);
            }
        }