Exemple #1
0
        public static TSubmitChangesResult SavePartnerMaintenanceTables(ref PartnerSetupTDS AInspectDS)
        {
            if (AInspectDS != null)
            {
                PartnerSetupTDSAccess.SubmitChanges(AInspectDS);

                return TSubmitChangesResult.scrOK;
            }

            return TSubmitChangesResult.scrError;
        }
Exemple #2
0
        public static TSubmitChangesResult SavePartnerMaintenanceTables(ref PartnerSetupTDS AInspectDS)
        {
            if (AInspectDS != null)
            {
                PartnerSetupTDSAccess.SubmitChanges(AInspectDS);

                return(TSubmitChangesResult.scrOK);
            }

            return(TSubmitChangesResult.scrError);
        }
Exemple #3
0
        public static PartnerSetupTDS LoadPartnerTypes()
        {
            TDBTransaction  ReadTransaction = null;
            PartnerSetupTDS MainDS          = new PartnerSetupTDS();

            DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.ReadCommitted, ref ReadTransaction,
                                                           delegate
            {
                PTypeAccess.LoadAll(MainDS, ReadTransaction);
            });

            // Accept row changes here so that the Client gets 'unmodified' rows
            MainDS.AcceptChanges();

            // Remove all Tables that were not filled with data before remoting them.
            MainDS.RemoveEmptyTables();

            return(MainDS);
        }
Exemple #4
0
        public static PartnerSetupTDS LoadPublications()
        {
            TDBTransaction  ReadTransaction = new TDBTransaction();
            PartnerSetupTDS MainDS          = new PartnerSetupTDS();

            DBAccess.ReadTransaction(ref ReadTransaction,
                                     delegate
            {
                PPublicationAccess.LoadAll(MainDS, ReadTransaction);
            });

            // Accept row changes here so that the Client gets 'unmodified' rows
            MainDS.AcceptChanges();

            // Remove all Tables that were not filled with data before remoting them.
            MainDS.RemoveEmptyTables();

            return(MainDS);
        }
Exemple #5
0
        public static PartnerSetupTDS LoadPartnerTypes()
        {
            TDBTransaction ReadTransaction = null;
            PartnerSetupTDS MainDS = new PartnerSetupTDS();

            DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.ReadCommitted, ref ReadTransaction,
                delegate
                {
                    PTypeAccess.LoadAll(MainDS, ReadTransaction);
                });

            // Accept row changes here so that the Client gets 'unmodified' rows
            MainDS.AcceptChanges();

            // Remove all Tables that were not filled with data before remoting them.
            MainDS.RemoveEmptyTables();

            return MainDS;
        }
Exemple #6
0
        public static bool MaintainTypes(string action, string ATypeCode, string ATypeDescription, out TVerificationResultCollection AVerificationResult)
        {
            PartnerSetupTDS MainDS = new PartnerSetupTDS();

            AVerificationResult = new TVerificationResultCollection();

            if (action == "create")
            {
                PTypeRow row = MainDS.PType.NewRowTyped();
                row.TypeCode        = ATypeCode.ToUpper();
                row.TypeDescription = ATypeDescription;
                MainDS.PType.Rows.Add(row);
                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "update")
            {
                MainDS = LoadPartnerTypes();

                foreach (PTypeRow row in MainDS.PType.Rows)
                {
                    if (row.TypeCode == ATypeCode)
                    {
                        row.TypeDescription = ATypeDescription;
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "delete")
            {
                MainDS = LoadPartnerTypes();

                foreach (PTypeRow row in MainDS.PType.Rows)
                {
                    if (row.TypeCode == ATypeCode)
                    {
                        row.Delete();
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            return(true);
        }
Exemple #7
0
        public static bool MaintainConsentPurposes(string action, string APurposeCode, string AName, string AComment, out TVerificationResultCollection AVerificationResult)
        {
            PartnerSetupTDS MainDS = new PartnerSetupTDS();

            AVerificationResult = new TVerificationResultCollection();

            if (action == "create")
            {
                PConsentPurposeRow row = MainDS.PConsentPurpose.NewRowTyped();
                row.PurposeCode = APurposeCode.ToUpper();
                row.Name        = AName;
                row.Comment     = AComment;
                MainDS.PConsentPurpose.Rows.Add(row);
                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "update")
            {
                MainDS = LoadConsentPurposes();

                foreach (PConsentPurposeRow row in MainDS.PConsentPurpose.Rows)
                {
                    if (row.PurposeCode == APurposeCode)
                    {
                        row.Name    = AName;
                        row.Comment = AComment;
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "delete")
            {
                MainDS = LoadConsentPurposes();

                foreach (PConsentPurposeRow row in MainDS.PConsentPurpose.Rows)
                {
                    if (row.PurposeCode == APurposeCode)
                    {
                        row.Delete();
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            return(true);
        }
Exemple #8
0
        public static bool MaintainPublications(string action, string APublicationCode, string APublicationDescription)
        {
            PartnerSetupTDS MainDS = new PartnerSetupTDS();

            if (action == "create")
            {
                PPublicationRow row = MainDS.PPublication.NewRowTyped();
                row.PublicationCode        = APublicationCode.ToUpper();
                row.PublicationDescription = APublicationDescription;
                row.FrequencyCode          = "Annual";
                MainDS.PPublication.Rows.Add(row);
                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "update")
            {
                MainDS = LoadPublications();

                foreach (PPublicationRow row in MainDS.PPublication.Rows)
                {
                    if (row.PublicationCode == APublicationCode)
                    {
                        row.PublicationDescription = APublicationDescription;
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "delete")
            {
                MainDS = LoadPublications();

                foreach (PPublicationRow row in MainDS.PPublication.Rows)
                {
                    if (row.PublicationCode == APublicationCode)
                    {
                        row.Delete();
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            return(true);
        }
Exemple #9
0
        public static bool MaintainTypes(string action, string ATypeCode, string ATypeDescription, string ACategoryCode, bool AValidType, out TVerificationResultCollection AVerificationResult)
        {
            PartnerSetupTDS MainDS = new PartnerSetupTDS();

            AVerificationResult = new TVerificationResultCollection();

            if (action == "create")
            {
                PTypeRow row = MainDS.PType.NewRowTyped();
                row.TypeCode        = ATypeCode.ToUpper();
                row.TypeDescription = ATypeDescription;
                row.CategoryCode    = ACategoryCode;
                row.ValidType       = AValidType;
                MainDS.PType.Rows.Add(row);
                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "update")
            {
                MainDS = LoadPartnerTypes();

                foreach (PTypeRow row in MainDS.PType.Rows)
                {
                    if (row.TypeCode == ATypeCode)
                    {
                        row.TypeDescription = ATypeDescription;
                        row.CategoryCode    = ACategoryCode;
                        row.ValidType       = AValidType;
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else if (action == "delete")
            {
                MainDS = LoadPartnerTypes();

                foreach (PTypeRow row in MainDS.PType.Rows)
                {
                    if (row.TypeCode == ATypeCode)
                    {
                        if (!row.TypeDeletable)
                        {
                            AVerificationResult.Add(new TVerificationResult("error", "not_deletable", TResultSeverity.Resv_Critical));
                            return(false);
                        }

                        row.Delete();
                    }
                }

                try
                {
                    PartnerSetupTDSAccess.SubmitChanges(MainDS);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            return(true);
        }