Пример #1
0
        public static WebPartner FindPartnerForPublicWeb(string alias)
        {
            if (string.IsNullOrEmpty(alias))
            {
                throw new ArgumentNullExceptionWithCode(214, "alias");
            }
            DataSet ds = DatabaseOperationProvider.QueryProcedure("up_getPartnerForPublicWeb", "partner", new
            {
                alias
            });
            WebPartner result = (
                from DataRow row in ds.Tables["partner"].Rows
                select UserToolsProvider.factory.WebPartner(row)).FirstOrDefault <WebPartner>();

            if (result != null)
            {
                result.alias = alias;
            }
            return(result);
        }
Пример #2
0
        public static ExternalCartAddOrderResult ExternalCart_AddOrder(string language, WebPartner partner, string externalCartId, BookingOrder order)
        {
            if (partner == null)
            {
                throw new System.ArgumentNullException("partner");
            }
            if (order == null)
            {
                throw new System.ArgumentNullException("order");
            }
            BookingClaim claim = new BookingClaim
            {
                orders = new System.Collections.Generic.List <BookingOrder>()
            };

            claim.orders.Add(order);
            XElement xml = BookingProvider.BuildBookingClaimXml(partner.id, claim);
            DataSet  ds  = DatabaseOperationProvider.QueryProcedure("up_guest_ExternalCart_AddOrder", "result", new
            {
                lang      = language,
                OrdersXML = xml,
                CartId    = externalCartId,
                PartPass  = partner.passId
            });

            return((
                       from DataRow row in ds.Tables["result"].Rows
                       select BookingProvider.factory.ExternalCartAddOrderResult(row)).FirstOrDefault <ExternalCartAddOrderResult>());
        }