Esempio n. 1
0
        private NebimV3.Shipments.RetailSale CreateRetailSaleShipment(NebimV3.Orders.RetailSale order, string description, DateTime?shipmentDate)
        {
            if (order == null)
            {
                throw new Exception("order can not be null for shipment");
            }
            if (!order.ExistsInDB())
            {
                throw new Exception("order does not exists for the shipment. order description:" + order.Description);
            }

            order.Load();
            NebimV3.Shipments.RetailSale shipment = new NebimV3.Shipments.RetailSale();

            // Required fields
            shipment.IsOrderBase   = true;
            shipment.ShippingDate  = shipmentDate.HasValue ? shipmentDate.Value : NebimV3.ApplicationCommon.V3Application.Context.Today;          // Or --> shipment.ShippingDate = new DateTime(2011, 12, 05)
            shipment.ShippingTime  = shipmentDate.HasValue ? shipmentDate.Value.TimeOfDay : NebimV3.ApplicationCommon.V3Application.Context.Time; // (Optional)
            shipment.OfficeCode    = _nebimIntegrationSettings.API_OfficeCode;
            shipment.WarehouseCode = _nebimIntegrationSettings.API_WarehouseCode;

            shipment.CustomerCode = order.CustomerCode;
            //shipment.Customer.CurrAccDefault.Load();
            shipment.ShippingPostalAddressID = order.ShippingPostalAddressID;
            shipment.BillingPostalAddressID  = order.BillingPostalAddressID;

            // Optional
            shipment.Description = description;

            return(shipment);
        }
Esempio n. 2
0
        // Elimizde yalnızca sipariş numarası var ise
        public void SavePayment(string orderNumber, myPaymentTypes paymentType, string creditCardTypeCode, byte installment, string maskedCCNo, string provisionNo)
        {
            NebimV3.Orders.RetailSale order = new NebimV3.Orders.RetailSale();
            order.OrderNumber = orderNumber;
            order.Load();

            this.SavePayment(order, paymentType, creditCardTypeCode, installment, maskedCCNo, provisionNo);
        }