Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReservationTicket"/> class. 
 /// </summary>
 /// <param name="order">The order.</param>
 /// <returns>The reservation ticket.</returns>
 public ReservationTicket(Order order)
 {
   this.authorizationCode = order.AuthorizationCode;
   this.transactionNumber = order.TransactionNumber;
   this.invoiceNumber = order.OrderNumber;
   this.amount = order.Totals != null ? Math.Round(order.Totals.PriceIncVat, 2, MidpointRounding.AwayFromZero) : 0M;
 }
Exemplo n.º 2
0
        protected void _initDataObjProductList(Order dataObj)
        {
            List<Order.OrderItem> productList = dataObj.OrderItems;
            Order.OrderItemParser parser = new Order.OrderItemParser();

            foreach (DataRow eachRow in dataModel.DetailModel.DataSource.Rows)
            {
                productList.Add( parser.parse(eachRow) );
            }
        }
Exemplo n.º 3
0
        protected void showErrors(Order objData, int[] errorSet)
        {
            foreach (int eachError in errorSet)
            {

                if(eachError == -2)
                    this.errorProvider.SetError(cbEmpID,
                        objData.getErrorMessage(eachError));

                if (eachError == -3)
                    this.errorProvider.SetError(dtpRequiredDate,
                        objData.getErrorMessage(eachError));

                if (eachError == -4)
                    this.errorProvider.SetError(dtpShippedDate,
                        objData.getErrorMessage(eachError));

                if (eachError == -5)
                    this.errorProvider.SetError(cbShipperID,
                        objData.getErrorMessage(eachError));

                if (eachError == -6)
                {
                    if (this.txtShipName.Text.Equals(""))
                        this.errorProvider.SetError(txtShipName,
                            objData.getErrorMessage(eachError));
                    if (this.txtShipAddress.Text.Equals(""))
                        this.errorProvider.SetError(txtShipAddress,
                            objData.getErrorMessage(eachError));
                    if (this.txtShipCity.Text.Equals(""))
                        this.errorProvider.SetError(txtShipCity,
                            objData.getErrorMessage(eachError));
                    if (this.cbCountry.Text.Equals(""))
                        this.errorProvider.SetError(cbCountry,
                            objData.getErrorMessage(eachError));
                }

            }
        }
Exemplo n.º 4
0
        protected Order createNewDataObj()
        {
            Order dataObj = new Order();
            dataObj.Orderid = -1;

            if (this.cbCustID.SelectedIndex <= 0)
                dataObj.Custid = -2905;
            else
                dataObj.Custid = ((OrderModel.IdItem)this.cbCustID.SelectedItem).Id;

            try
            {
                dataObj.Empid = ((OrderModel.IdItem)this.cbEmpID.SelectedItem).Id;
                dataObj.Shipperid = ((OrderModel.IdItem)this.cbShipperID.SelectedItem).Id;
            }
            catch
            {
                this.raiseSelectIdErrors();
            }

            try
            {
                dataObj.Freight = float.Parse(this.txtFreight.Text);
            }
            catch
            {
                this.errorProvider.SetError(this.txtFreight, "###INVALID VALUE");
            }

            dataObj.Orderdate = this.dtpOrderDate.Value;
            dataObj.Requireddate = this.dtpRequiredDate.Value;
            if (this.cboxNotShipped.Checked == false)
                dataObj.Shippeddate = this.dtpShippedDate.Value;

            dataObj.Shipname = this.txtShipName.Text;
            dataObj.Shipaddress = this.txtShipAddress.Text;
            dataObj.Shipcity = this.txtShipCity.Text;
            dataObj.Shipregion = this.txtShipRegion.Text;
            dataObj.Shippostalcode = this.txtShipPostalCode.Text;
            dataObj.Shipcountry = this.cbCountry.Text;

            this._initDataObjProductList(dataObj);
            return dataObj;
        }
Exemplo n.º 5
0
 public abstract LineItem CreateLineItemFromOrder(Order order, string productCode, long quantity);
Exemplo n.º 6
0
 public abstract OrderLine CreateOrderLineFromOrder(Order order, string productCode, long quantity);
Exemplo n.º 7
0
 /// <summary>
 /// Gets the VAT.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="productCode">The product code.</param>
 /// <returns>
 /// The VAT.
 /// </returns>
 public abstract decimal GetVat(Order order, string productCode);
 public virtual IList<LogEntry> GetAdditionalLogEntriesForSuccess(Order order)
 {
   return this.additionalLogEntries;
 }
 public abstract LogEntry GetLogEntryForFail(Order order, params object[] parameters);
 public abstract LogEntry GetLogEntryForSuccess(Order order);
 public abstract string ProcessOrder(Order order, IDictionary<string, object> parameters);
 /// <summary>
 /// Performs additional fail processing.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns>The get addtional log entry for fail.</returns>
 public override LogEntry GetLogEntryForFail(Order order, params object[] parameters)
 {
   return new LogEntry();
 }
 /// <summary>
 /// Gets logging entry for sucess.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <returns>Log entry.</returns>
 public override LogEntry GetLogEntryForSuccess(Order order)
 {
   return new LogEntry();
 }
 /// <summary>
 /// Processes the order.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns>The result.</returns>
 public override string ProcessOrder(Order order, IDictionary<string, object> parameters)
 {
   return SuccessfulResult;
 }