Пример #1
0
 public void WorkPhoneTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.WorkPhone = expected;
     actual = target.WorkPhone;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #2
0
 public void TimezoneOffsetTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     Nullable<double> expected = new Nullable<double>(); // TODO: Initialize to an appropriate value
     Nullable<double> actual;
     target.TimezoneOffset = expected;
     actual = target.TimezoneOffset;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #3
0
 public void CustomerConstructorTest()
 {
     Customer target = new Customer();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Пример #4
0
 public void BillingAddressTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     AddressInfo expected = null; // TODO: Initialize to an appropriate value
     AddressInfo actual;
     target.BillingAddress = expected;
     actual = target.BillingAddress;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #5
0
 public void SaveTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     target.Save();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Пример #6
0
 public void CustomerNameTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     string actual;
     actual = target.CustomerName;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #7
0
 public void CreatedOnTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
     DateTime actual;
     target.CreatedOn = expected;
     actual = target.CreatedOn;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #8
0
 public void IDTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     Guid expected = new Guid(); // TODO: Initialize to an appropriate value
     Guid actual;
     target.ID = expected;
     actual = target.ID;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #9
0
 public void SexTest()
 {
     Customer target = new Customer(); // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     target.Sex = expected;
     actual = target.Sex;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #10
0
        public static Customer ToCustomer(this DataRow row)
        {
            // todo: finish implementing rest of properties
            Customer c = new Customer
            {
                ID = row.GetGuid("UserID"),
                InitialOfferID = row.GetGuid("InitialOfferID"),
                FirstName = row.GetString("FirstName"),
                LastName = row.GetString("LastName"),
                HomePhone = row.GetString("HomePhone"),
                WorkPhone = row.GetString("WorkPhone"),
                CellPhone = row.GetString("CellPhone"),
                DOB = row.GetDate("DateOfBirth")               
                
            };

            c.ShippingAddress.AddressLine1 = row.GetString("ShippingAddress1");
            c.ShippingAddress.AddressLine2 = row.GetString("ShippingAddress2");
            c.ShippingAddress.City = row.GetString("ShippingCity");
            c.ShippingAddress.State = row.GetString("ShippingState");
            c.ShippingAddress.Country = row.GetString("Country");
            c.ShippingAddress.ZipCode = row.GetString("ShippingZipCode");
            c.BillingAddress.AddressLine1 = row.GetString("BillingAddress1");
            c.BillingAddress.AddressLine2 = row.GetString("BillingAddress2");
            c.BillingAddress.City = row.GetString("BillingCity");
            c.BillingAddress.State = row.GetString("BillingState");
            c.BillingAddress.Country = row.GetString("BillingCountry");
            c.BillingAddress.ZipCode = row.GetString("BillingZipCode");

            return c;

            //Customer entity = null;
            //if (row["Id"] != System.DBNull.Value)
            //    entity.ID = (Guid)row["UserID"];
            //if (row["InitialOfferID"] != System.DBNull.Value)
            //    entity.InitialOfferID = (Guid)row["InitialOfferID"];
            //if (row["FirstName"] != System.DBNull.Value)
            //    entity.FirstName = (string)row["FirstName"];
            //if (row["LastName"] != System.DBNull.Value)
            //    entity.LastName = (string)row["LastName"];
            //if (row["HomePhone"] != System.DBNull.Value)
            //    entity.HomePhone = (string)row["HomePhone"];
            //if (row["WorkPhone"] != System.DBNull.Value)
            //    entity.WorkPhone = (string)row["WorkPhone"];
            //if (row["CellPhone"] != System.DBNull.Value)
            //    entity.CellPhone = (string)row["CellPhone"];

            //if (row["DateOfBirth"] != System.DBNull.Value)
            //    entity.DOB = (DateTime)row["DateOfBirth"];
            //if (row["Suffix"] != System.DBNull.Value)
            //    entity.Suffix = (string)row["Suffix"];
            //if (row["Prefix"] != System.DBNull.Value)
            //    entity.Prefix = (string)row["Prefix"];
            //if (row["Browser"] != System.DBNull.Value)
            //    entity.Browser = (string)row["Browser"];
            //if (row["TimezoneOffset"] != System.DBNull.Value)
            //    entity.TimezoneOffset = (double)row["TimezoneOffset"];
            //if (row["Timezone"] != System.DBNull.Value)
            //    entity.Timezone = (string)row["Timezone"];
            //if (row["LanguageCode"] != System.DBNull.Value)
            //    entity.LanguageCode = (string)row["LanguageCode"];
            //if (row["CreatedOn"] != System.DBNull.Value)
            //    entity.CreatedOn = (DateTime)row["CreatedOn"];
            //if (row["LastUpdatedDate"] != System.DBNull.Value)
            //    entity.LastUpdatedOn = (DateTime)row["LastUpdatedDate"];

            //if (row["ShippingAddress1"] != System.DBNull.Value)
            //    entity.ShippingAddress.AddressLine1= (string)row["ShippingAddress1"];
            //if (row["ShippingAddress2"] != System.DBNull.Value)
            //    entity.ShippingAddress.AddressLine2= (string)row["ShippingAddress2"];
            //if (row["ShippingCity"] != System.DBNull.Value)
            //    entity.ShippingAddress.City = (string)row["ShippingCity"];
            //if (row["ShippingState"] != System.DBNull.Value)
            //    entity.ShippingAddress.State = (string)row["ShippingState"];
            //if (row["ShippingCountry"] != System.DBNull.Value)
            //    entity.ShippingAddress.Country = (string)row["ShippingCountry"];
            //if (row["ShippingZipCode"] != System.DBNull.Value)
            //    entity.ShippingAddress.ZipCode = (string)row["ShippingZipCode"];

            //if (row["BillingAddress1"] != System.DBNull.Value)
            //    entity.BillingAddress.AddressLine1 = (string)row["BillingAddress1"];
            //if (row["BillingAddress2"] != System.DBNull.Value)
            //    entity.BillingAddress.AddressLine2 = (string)row["BillingAddress2"];
            //if (row["BillingCity"] != System.DBNull.Value)
            //    entity.BillingAddress.City = (string)row["BillingCity"];
            //if (row["BillingState"] != System.DBNull.Value)
            //    entity.BillingAddress.State = (string)row["BillingState"];
            //if (row["BillingCountry"] != System.DBNull.Value)
            //    entity.BillingAddress.Country = (string)row["BillingCountry"];
            //if (row["BillingZipCode"] != System.DBNull.Value)
            //    entity.BillingAddress.ZipCode = (string)row["BillingZipCode"];

            //return entity;
        }
Пример #11
0
        //public void CreateAudit(CustomerUserAudit audit)
        //{
        //    CustomerUserAudit.CreateAudit(audit);
        //}

        #endregion

        #region Static Methods

        public static void Insert(Customer customer)
        {
            DbCommand cmd = SqlHelpers.CreateCommand(
                BillingController.ConnectionString, "mon_bill_INSERT_CUSTOMER");

            cmd.AddInputParam("pInitialOfferID", DbType.Guid, customer.InitialOfferID);
            cmd.AddInputParam("pFirstName", DbType.String, customer.FirstName);
            cmd.AddInputParam("pLastName", DbType.String, customer.LastName);
            cmd.AddInputParam("pMiddleName", DbType.String, customer.MiddleName);
            cmd.AddInputParam("pHomePhone", DbType.String, customer.HomePhone);
            cmd.AddInputParam("pWorkPhone", DbType.String, customer.WorkPhone);
            cmd.AddInputParam("pCellPhone", DbType.String, customer.CellPhone);
            cmd.AddInputParam("pShippingAddress1", DbType.String, customer.ShippingAddress.AddressLine1);
            cmd.AddInputParam("pShippingAddress2", DbType.String, customer.ShippingAddress.AddressLine2);
            cmd.AddInputParam("pShippingCity", DbType.String, customer.ShippingAddress.City);
            cmd.AddInputParam("pShippingState", DbType.String, customer.ShippingAddress.State);
            cmd.AddInputParam("pShippingCountry", DbType.String, customer.ShippingAddress.Country);
            cmd.AddInputParam("pShippingZipCode", DbType.String, customer.ShippingAddress.ZipCode);
            cmd.AddInputParam("pBillingAddress1", DbType.String, customer.BillingAddress.AddressLine1);
            cmd.AddInputParam("pBillingAddress2", DbType.String, customer.BillingAddress.AddressLine2);
            cmd.AddInputParam("pBillingCity", DbType.String, customer.BillingAddress.City);
            cmd.AddInputParam("pBillingState", DbType.String, customer.BillingAddress.State);
            cmd.AddInputParam("pBillingCountry", DbType.String, customer.BillingAddress.Country);
            cmd.AddInputParam("pBillingZipCode", DbType.String, customer.BillingAddress.ZipCode);
            cmd.AddInputParam("pDateOfBirth", DbType.Date, customer.DOB);
            cmd.AddInputParam("pSuffix", DbType.String, customer.Suffix);
            cmd.AddInputParam("pPrefix", DbType.String, customer.Prefix);
            cmd.AddInputParam("pBrowser", DbType.String, customer.Browser);
            cmd.AddInputParam("pTimezone", DbType.String, customer.Timezone);
            cmd.AddInputParam("pTimezoneOffset", DbType.Double, customer.TimezoneOffset);
            cmd.AddInputParam("pLanguageCode", DbType.String, customer.LanguageCode);
            cmd.AddInputParam("pSex", DbType.Boolean, customer.Sex);
            cmd.AddOutputParam("oCustomerID", DbType.Guid);

            SqlHelpers.ExecuteNonQuery(cmd);

            customer.ID = cmd.ExtractGuid("oCustomerID");
        }
Пример #12
0
        public static void Update(Customer customer)
        {
            DbCommand cmd = SqlHelpers.CreateCommand(
                BillingController.ConnectionString, "mon_bill_UPDATE_CUSTOMER");


        }