Exemple #1
0
        public static Boolean ConvertApplicationsToPreviousExperience(ApplicationTDS AMainDS)
        {
            TDBTransaction Transaction  = null;
            bool           SubmissionOK = false;

            DBAccess.GDBAccessObj.BeginAutoTransaction(IsolationLevel.Serializable, ref Transaction, ref SubmissionOK,
                                                       delegate
            {
                PmPastExperienceTable PastExperienceTable = new PmPastExperienceTable();

                foreach (PmShortTermApplicationRow Row in AMainDS.PmShortTermApplication.Rows)
                {
                    // create the new past experience record
                    PmPastExperienceRow PastExperienceRow = PastExperienceTable.NewRowTyped(true);
                    PastExperienceRow.Key               = Convert.ToInt64(TSequenceWebConnector.GetNextSequence(TSequenceNames.seq_past_experience));
                    PastExperienceRow.PartnerKey        = Row.PartnerKey;
                    PastExperienceRow.PrevLocation      = Row.ConfirmedOptionCode;
                    PastExperienceRow.StartDate         = Row.Arrival;
                    PastExperienceRow.EndDate           = Row.Departure;
                    PastExperienceRow.PrevWorkHere      = true;
                    PastExperienceRow.PrevWork          = true;
                    PastExperienceRow.PastExpComments   = "Created from Event Application";
                    PastExperienceRow.OtherOrganisation = "";
                    PastExperienceRow.PrevRole          = "";
                    PastExperienceTable.Rows.Add(PastExperienceRow);
                }

                PmPastExperienceAccess.SubmitChanges(PastExperienceTable, Transaction);

                SubmissionOK = true;
            });

            return(SubmissionOK);
        }
Exemple #2
0
        public static Boolean RemoveApplicationsFromPreviousExperience(ApplicationTDS AMainDS)
        {
            TDBTransaction Transaction  = null;
            bool           SubmissionOK = false;

            DBAccess.GDBAccessObj.BeginAutoTransaction(IsolationLevel.Serializable, ref Transaction, ref SubmissionOK,
                                                       delegate
            {
                foreach (PmShortTermApplicationRow Row in AMainDS.PmShortTermApplication.Rows)
                {
                    PmPastExperienceTable PastExperienceTable = new PmPastExperienceTable();
                    PmPastExperienceRow TempRow = PastExperienceTable.NewRowTyped(false);
                    TempRow.PartnerKey          = Row.PartnerKey;
                    TempRow.PrevLocation        = Row.ConfirmedOptionCode;
                    PastExperienceTable         = PmPastExperienceAccess.LoadUsingTemplate(TempRow, Transaction);

                    if ((PastExperienceTable != null) && (PastExperienceTable.Rows.Count > 0))
                    {
                        PastExperienceTable.Rows[0].Delete();
                        PmPastExperienceAccess.SubmitChanges(PastExperienceTable, Transaction);
                    }
                }

                SubmissionOK = true;
            });

            return(SubmissionOK);
        }
Exemple #3
0
        public static Boolean ConvertApplicationsToPreviousExperience(ApplicationTDS AMainDS)
        {
            TDBTransaction Transaction = null;
            bool SubmissionOK = false;

            DBAccess.GDBAccessObj.BeginAutoTransaction(IsolationLevel.Serializable, ref Transaction, ref SubmissionOK,
                delegate
                {
                    PmPastExperienceTable PastExperienceTable = new PmPastExperienceTable();

                    foreach (ApplicationTDSPmShortTermApplicationRow Row in AMainDS.PmShortTermApplication.Rows)
                    {
                        // create the new past experience record
                        PmPastExperienceRow PastExperienceRow = PastExperienceTable.NewRowTyped(true);
                        PastExperienceRow.Key = Convert.ToInt64(TSequenceWebConnector.GetNextSequence(TSequenceNames.seq_past_experience));
                        PastExperienceRow.PartnerKey = Row.PartnerKey;
                        PastExperienceRow.PrevLocation = Row.ConfirmedOptionCode;
                        PastExperienceRow.StartDate = Row.EventStartDate;
                        PastExperienceRow.EndDate = Row.EventEndDate;
                        PastExperienceRow.PrevWorkHere = true;
                        PastExperienceRow.PrevWork = true;
                        PastExperienceRow.PastExpComments = "Created from Event Application";
                        PastExperienceRow.OtherOrganisation = "";
                        PastExperienceRow.PrevRole = "";
                        PastExperienceTable.Rows.Add(PastExperienceRow);
                    }

                    PmPastExperienceAccess.SubmitChanges(PastExperienceTable, Transaction);

                    SubmissionOK = true;
                });

            return SubmissionOK;
        }