Beispiel #1
0
        /// <summary>
        /// Adds Shipment details from a Multiple Shipment Order
        /// </summary>
        private void InsertDB()
        {
            var MultiShipOrder_ShipmentGUID = CommonLogic.GetNewGUID();
            var sql = string.Format("insert into MultiShipOrder_Shipment(MultiShipOrder_ShipmentGUID,OrderNumber,DestinationAddress,ShippingAmount,ShippingMethodId,ShippingAddressId,BillingAddressId) values({0},{1},{2},{3},{4},{5},{6})", DB.SQuote(MultiShipOrder_ShipmentGUID), _OrderNumber, DB.SQuote(_DestinationAddress), _ShippingAmount, _ShippingMethodId, _ShippingAddressId, _BillingAddressId);

            DB.ExecuteSQL(sql);

            using (var dbconn = DB.dbConn())
            {
                dbconn.Open();
                using (var rs = DB.GetRS(String.Format("select MultiShipOrder_ShipmentId from MultiShipOrder_Shipment with (NOLOCK) where MultiShipOrder_ShipmentGUID={0}", DB.SQuote(MultiShipOrder_ShipmentGUID)), dbconn))
                {
                    if (rs.Read())
                    {
                        _MultiShipOrder_ShipmentId = DB.RSFieldInt(rs, "MultiShipOrder_ShipmentId");
                    }
                }
            }
        }
Beispiel #2
0
        public void SerializeGiftCard()
        {
            //physical gift cards cannot be serialized
            if (this.m_GiftCardTypeID != (int)GiftCardTypes.PhysicalGiftCard)
            {
                Customer    c            = new Customer(m_PurchasedByCustomerID);
                string      SerialNumber = String.Empty;
                string      GiftCardXml  = String.Empty;
                XmlDocument xdoc         = new XmlDocument();

                try
                {
                    GiftCardXml = AppLogic.RunXmlPackage("giftcardassignment.xml.config", null, c, 1, String.Empty, String.Empty, false, true);
                    xdoc.LoadXml(GiftCardXml);
                    SerialNumber = xdoc.SelectSingleNode("//CardNumber").InnerText;
                }
                catch
                {
                    SerialNumber = CommonLogic.GetNewGUID();
                }
                UpdateCard(SerialNumber, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
            }
        }