예제 #1
0
 public Profile_WebsiteLink(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings, TestSprocGenerator.Business.SingleTable.Bo.Profile_WebsiteLink filledBo)
 {
     _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings;
     _baseDataAccess =
         new CommonLibrary.Base.Database.BaseDataAccess <TestSprocGenerator.Data.SingleTable.Dto.Profile_WebsiteLink>(_databaseSmoObjectsAndSettings);
     _baseBusiness =
         new CommonLibrary.Base.Business.BaseBusiness <TestSprocGenerator.Business.SingleTable.Bo.Profile_WebsiteLink, TestSprocGenerator.Data.SingleTable.Dto.Profile_WebsiteLink>(_databaseSmoObjectsAndSettings);
     this.FillPropertiesFromBo(filledBo);
 }
 public AddressType(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings, TestSprocGenerator.Business.SingleTable.Bo.AddressType filledBo)
 {
     _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings;
     _baseDataAccess =
         new CommonLibrary.Base.Database.BaseDataAccess <TestSprocGenerator.Data.SingleTable.Dto.AddressType>(_databaseSmoObjectsAndSettings);
     _baseBusiness =
         new CommonLibrary.Base.Business.BaseBusiness <TestSprocGenerator.Business.SingleTable.Bo.AddressType, TestSprocGenerator.Data.SingleTable.Dto.AddressType>(_databaseSmoObjectsAndSettings);
     this.FillPropertiesFromBo(filledBo);
 }
 public Person(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings, CodeSampleApplication.Bo.Person filledBo)
 {
     _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings;
     _baseDataAccess =
         new CommonLibrary.Base.Database.BaseDataAccess <CodeSampleApplication.Dto.Person>(_databaseSmoObjectsAndSettings);
     _baseBusiness =
         new CommonLibrary.Base.Business.BaseBusiness <CodeSampleApplication.Bo.Person, CodeSampleApplication.Dto.Person>();
     this.FillPropertiesFromBo(filledBo);
 }
 public PasswordResetRequest(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings, TestSprocGenerator.Business.SingleTable.Bo.PasswordResetRequest filledBo)
 {
     _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings;
     _baseDataAccess =
         new CommonLibrary.Base.Database.BaseDataAccess <TestSprocGenerator.Data.SingleTable.Dto.PasswordResetRequest>(_databaseSmoObjectsAndSettings);
     _baseBusiness =
         new CommonLibrary.Base.Business.BaseBusiness <TestSprocGenerator.Business.SingleTable.Bo.PasswordResetRequest, TestSprocGenerator.Data.SingleTable.Dto.PasswordResetRequest>(_databaseSmoObjectsAndSettings);
     this.FillPropertiesFromBo(filledBo);
 }
예제 #5
0
 public Person_PhoneNumber(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings, TestSprocGenerator.Business.SingleTable.Bo.Person_PhoneNumber filledBo)
 {
     _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings;
     _baseDataAccess =
         new CommonLibrary.Base.Database.BaseDataAccess <TestSprocGenerator.Data.SingleTable.Dto.Person_PhoneNumber>(_databaseSmoObjectsAndSettings);
     _baseBusiness =
         new CommonLibrary.Base.Business.BaseBusiness <TestSprocGenerator.Business.SingleTable.Bo.Person_PhoneNumber, TestSprocGenerator.Data.SingleTable.Dto.Person_PhoneNumber>(_databaseSmoObjectsAndSettings);
     this.FillPropertiesFromBo(filledBo);
 }
 public CustomerDemographics(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings, TestSprocGenerator.Business.SingleTable.Bo.CustomerDemographics filledBo)
 {
     _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings;
     _baseDataAccess =
         new CommonLibrary.Base.Database.BaseDataAccess <TestSprocGenerator.Data.SingleTable.Dto.CustomerDemographics>(_databaseSmoObjectsAndSettings);
     _baseBusiness =
         new CommonLibrary.Base.Business.BaseBusiness <TestSprocGenerator.Business.SingleTable.Bo.CustomerDemographics, TestSprocGenerator.Data.SingleTable.Dto.CustomerDemographics>();
     this.FillPropertiesFromBo(filledBo);
 }
예제 #7
0
        /// <summary>
        /// inserts an arbitrary composite customer into the database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InsertCompositeCustomer_Click(object sender, EventArgs e)
        {
            try
            {
                //perhaps an ActiveContext type of object would be available from a global location and would already have
                //this DatabaseSmoObjectsAndSettings instantiated and configured from a
                //storage medium like a config file etc.  For the purpose of this testing
                //just going to instantiate this with arbitrary values to show how it would work

                string databaseName      = "CodeSampleApplication";
                string dataSource        = @"IBM-5C1076B185C";
                string initialCatalog    = "CodeSampleApplication";
                string userId            = string.Empty;
                string password          = string.Empty;
                bool   trustedConnection = true;
                string schema            = "dbo";

                CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings =
                    new CommonLibrary.DatabaseSmoObjectsAndSettings(databaseName,
                                                                    dataSource,
                                                                    initialCatalog,
                                                                    userId,
                                                                    password,
                                                                    trustedConnection);

                //you would probably only want to instantiate this once, just for testing purposes instantiate it
                //with every button click
                CustomerController customerController = new CustomerController(databaseSmoObjectsAndSettings);
                customerController.TestHarnessAddSingleCompositeCustomer();
            }
            catch (Exception ex)
            {
                //normally would have an assembly/classes available for the logging and reporting
                //of exceptions that would encapsulate this

                StringBuilder stringBuilder = new StringBuilder();

                stringBuilder.Append("Exception Has Occurred:  ");
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("Message:  ");
                stringBuilder.Append(ex.Message);
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("StackTrace:  ");
                stringBuilder.Append(ex.StackTrace);

                MessageBox.Show(stringBuilder.ToString());
            }

            MessageBox.Show("Composite Customer Inserted");
        }
 public TestTable(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings)
 {
     _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings;
     _baseDataAccess = new CommonLibrary.Base.Database.BaseDataAccess <TestSprocGenerator.Data.SingleTable.Dto.TestTable>(_databaseSmoObjectsAndSettings);
     _baseBusiness   = new CommonLibrary.Base.Business.BaseBusiness <TestSprocGenerator.Business.SingleTable.Bo.TestTable, TestSprocGenerator.Data.SingleTable.Dto.TestTable>();
 }