Пример #1
0
        public static DtoCustomer ToDtoObject(this Customer modelCustomer)
        {
            var company = new DtoCustomer();

            company.Guid                            = modelCustomer.Guid;
            company.CustomerID                      = modelCustomer.Id;
            company.CreatedByUser                   = modelCustomer.CreatedBy.ToDtoObject();
            company.CreateDate                      = modelCustomer.CreateDate;
            company.Inactive                        = modelCustomer.Inactive;
            company.CustomerName                    = modelCustomer.Name;
            company.PhoneNumber                     = modelCustomer.PhoneNumber;
            company.Email                           = modelCustomer.Email;
            company.StreetAddress                   = modelCustomer.StreetAddress;
            company.ZipCode                         = modelCustomer.ZipCode;
            company.Country                         = modelCustomer.Country;
            company.ContactName                     = modelCustomer.ContactName;
            company.ContactPhone                    = modelCustomer.ContactPhone;
            company.City                            = modelCustomer.City;
            company.InheritsTimeEntryTypes          = modelCustomer.InheritsTimeEntryTypes;
            company.PaymentTermsIncludeCurrentMonth = modelCustomer.PaymentTermIncludeCurrentMonth;
            company.PaymentTermsNumberOfDays        = modelCustomer.PaymentTermNumberOfDays;
            company.Address2                        = modelCustomer.Address2;

            return(company);
        }
Пример #2
0
        public static Customer ToModelObject(this DtoCustomer dtoCompany)
        {
            var customer = new Customer();

            customer.Id              = dtoCompany.CustomerID;
            customer.Name            = dtoCompany.CustomerName;
            customer.Guid            = dtoCompany.Guid;
            customer.Inactive        = dtoCompany.Inactive;
            customer.PhoneNumber     = dtoCompany.PhoneNumber;
            customer.StreetAddress   = dtoCompany.StreetAddress;
            customer.ZipCode         = dtoCompany.ZipCode;
            customer.City            = dtoCompany.City;
            customer.CellPhoneNumber = dtoCompany.PhoneNumber;
            customer.ContactName     = dtoCompany.ContactName;
            customer.ContactPhone    = dtoCompany.ContactPhone;
            customer.Country         = dtoCompany.Country;
            customer.CreateDate      = dtoCompany.CreateDate;
            //customer.CreatedBy = dtoCompany.CreatedByUser.ToModelObject();
            customer.Email    = dtoCompany.Email;
            customer.Projects = dtoCompany.Projects.ToModelObjects();
            customer.InheritsTimeEntryTypes         = dtoCompany.InheritsTimeEntryTypes;
            customer.TimeEntryTypes                 = dtoCompany.TimeEntryTypes.ToModelObjects();
            customer.PaymentTermNumberOfDays        = dtoCompany.PaymentTermsNumberOfDays;
            customer.PaymentTermIncludeCurrentMonth = dtoCompany.PaymentTermsIncludeCurrentMonth;
            customer.Address2 = dtoCompany.Address2;
            //customer.TotalNotInvoicedTime = dtoCompany.TotalNotInvoicedTime;
            //customer.DistinctPrices = dtoCompany.DistinctPrices;
            //customer.InventoryValue = dtoCompany.InventoryValue;
            //customer.FirstTimeEntryDate = dtoCompany.FirstTimeEntryDate;

            return(customer);
        }