예제 #1
0
        private void Load(VendorData data)
        {
            Initialize();
            if (data != null)
            {
                VendorID       = data.vendor_id;
                VendorName     = data.vendor_name;
                VendorGUID     = data.vendor_guid;
                OrganizationID = data.organization_id;
                mDateCreated   = data.date_created;
                mCreatedByUser = data.created_by;
                DateModified   = data.date_modified;
                ModifiedByUser = data.modified_by;
                if (!String.IsNullOrEmpty(data.address))
                {
                    Address = new Helpers.Address(data.address);
                }

                if (!String.IsNullOrEmpty(data.phone))
                {
                    Phone = new Helpers.PhoneNumber(data.phone);
                }

                WebAddress = data.web_address;
                Active     = data.active;
                Terms      = data.terms;
            }
        }
예제 #2
0
        private void Load(PurchaseOrderData data)
        {
            if (data != null)
            {
                Init();
                PurchaseOrderID       = data.purchase_order_id;
                VendorID              = data.vendor_id;
                PurchaseOrderTypeLUID = data.purchase_order_type_luid;
                OrganizationID        = data.organization_id;
                CreatedByUserID       = data.created_by;
                ModifiedByUserID      = data.modified_by;
                DateCreated           = data.date_created;
                DateModified          = data.date_modified;
                Active = data.active;
                if (data.date_ordered != null)
                {
                    DateOrdered = (DateTime)data.date_ordered;
                }
                if (data.ordered_by != null)
                {
                    OrderedByID = (int)data.ordered_by;
                }
                StatusLUID = data.status_luid;

                if (data.ship_to_name != null)
                {
                    ShipToName = data.ship_to_name;
                }

                if (data.ship_to_attention != null)
                {
                    ShipToAttn = data.ship_to_attention;
                }

                if (data.ship_to_address != null)
                {
                    ShipToAddress = new Helpers.Address(data.ship_to_address);
                }

                if (data.date_received != null)
                {
                    DateReceived = (DateTime)data.date_received;
                }
                if (data.date_closed != null)
                {
                    DateClosed = (DateTime)data.date_closed;
                }

                if (data.shipping_charge != null)
                {
                    ShippingCharge = (decimal)data.shipping_charge;
                }
                if (data.other_charge != null)
                {
                    OtherCharge = (decimal)data.other_charge;
                }
                HasBeenBilled = data.has_been_billed;

                Terms = data.terms;

                if (data.default_payment_method_id != null)
                {
                    DefaultPaymentMethodID = (int)data.default_payment_method_id;
                }
            }
        }