コード例 #1
0
ファイル: actions.ascx.cs プロジェクト: qinzhijun/MyDash
 /// <summary>
 /// Sets the order status.
 /// </summary>
 /// <param name="orderStatusId">The order status id.</param>
 private void SetOrderStatus(string orderStatusId)
 {
     OrderStatusDescriptorCollection orderStatusDescriptorCollection = new OrderStatusDescriptorController().FetchAll();
       ddlOrderStatus.DataSource = orderStatusDescriptorCollection;
       ddlOrderStatus.DataValueField = "OrderStatusId";
       ddlOrderStatus.DataTextField = "Name";
       ddlOrderStatus.DataBind();
       ddlOrderStatus.SelectedValue = orderStatusId;
 }
コード例 #2
0
ファイル: actions.ascx.cs プロジェクト: qinzhijun/MyDash
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try {
            orderId = Utility.GetIntParameter("orderId");
            view = Utility.GetParameter("view");
            if(orderId > 0 && view == "a") {
              SetActionsProperties();
              if(!Page.IsPostBack) {
            Order order = new Order(orderId);
            ds = new OrderController().FetchRefundedOrderItems(orderId);
            Transaction transaction = new TransactionController().FetchByOrderIdAndTransactionTypeId(orderId, (int)TransactionType.Charge);

            if(transaction.GatewayName == "PayPal Standard") {
              lblActionMessage.Text = LocalizationUtility.GetText("lblPayPalStandardRefundInstructions");
            }

            if(order.OrderStatusDescriptorId == (int)OrderStatus.OrderFullyRefunded) {
              btnRefundTransaction.Visible = false;
              lblAdditionalRefundAmount.Visible = false;
              txtAdditionalRefundAmount.Visible = false;
              dgOrderItems.Visible = false;
            }
            else {
              dgOrderItems.DataSource = order.OrderItemCollection;
              dgOrderItems.ItemDataBound += new DataGridItemEventHandler(dgOrderItems_ItemDataBound);
              dgOrderItems.Columns[1].HeaderText = LocalizationUtility.GetText("hdrRefund");
              dgOrderItems.Columns[2].HeaderText = LocalizationUtility.GetText("hdrSku");
              dgOrderItems.Columns[3].HeaderText = LocalizationUtility.GetText("hdrQuantityRemaining");
              dgOrderItems.Columns[4].HeaderText = LocalizationUtility.GetText("hdrName");
              dgOrderItems.Columns[5].HeaderText = LocalizationUtility.GetText("hdrPricePaid");
              dgOrderItems.Columns[6].HeaderText = LocalizationUtility.GetText("hdrItemTax");
              dgOrderItems.Columns[7].HeaderText = LocalizationUtility.GetText("hdrDiscountAmount");
              dgOrderItems.DataBind();
            }

            OrderStatusDescriptorCollection orderStatusDescriptorCollection = new OrderStatusDescriptorController().FetchAll();
            ddlOrderStatus.DataSource = orderStatusDescriptorCollection;
            ddlOrderStatus.DataValueField = "OrderStatusDescriptorId";
            ddlOrderStatus.DataTextField = "Name";
            ddlOrderStatus.DataBind();

            ddlOrderStatus.SelectedValue = order.OrderStatusDescriptorId.ToString();
              }
            }
              }
              catch(Exception ex) {
            Logger.Error(typeof(actions).Name + ".Page_Load", ex);
            base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
              }
        }