コード例 #1
0
    private void PopulateControl()
    {
        IList <Order> list     = DataAccessContext.OrderRepository.GetPaidOrdersByDateTime(DateTimeUtilities.GetFirstDayOfTheYear(DateTime.Now), DateTime.Now);
        decimal       subtotal = 0;

        for (int i = 0; i < list.Count; i++)
        {
            subtotal += list[i].Total;
        }
        uxSaleYearLabel.Text = AdminUtilities.FormatPrice(subtotal);

        list     = DataAccessContext.OrderRepository.GetPaidOrdersByDateTime(DateTimeUtilities.GetFirstDayOfTheMonth(DateTime.Now), DateTime.Now);
        subtotal = 0;
        for (int i = 0; i < list.Count; i++)
        {
            subtotal += list[i].Total;
        }
        uxSaleMonthLabel.Text = AdminUtilities.FormatPrice(subtotal);

        list     = DataAccessContext.OrderRepository.GetPaidOrdersByDateTime(DateTime.Now, DateTime.Now);
        subtotal = 0;
        for (int i = 0; i < list.Count; i++)
        {
            subtotal += list[i].Total;
        }
        uxSaleTodayLabel.Text = AdminUtilities.FormatPrice(subtotal);
        uxCustomerLabel.Text  = DataAccessContext.CustomerRepository.GetAll("CustomerID").Count.ToString();
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IList <Order> list = DataAccessContext.OrderRepository.GetOrdersByProcessedAndStatus(false, "New");

        if (list.Count > 0)
        {
            uxNewOrderLabel.Visible = false;

            uxNewOrderLink.Visible = true;
            uxNewOrderLink.Text    = String.Format("You have {0} new orders", list.Count);
        }
        else
        {
            uxNewOrderLabel.Visible = true;
            uxNewOrderLabel.Text    = String.Format("There is no new order to process");

            uxNewOrderLink.Visible = false;
        }

        decimal subtotal = 0;

        for (int i = 0; i < list.Count; i++)
        {
            subtotal += list[i].Total;
        }
        uxNewOrdersAmout.Text = String.Format(
            "New Order Amount: <strong>{0}</strong>",
            AdminUtilities.FormatPrice(subtotal));
    }
コード例 #3
0
 public void SetFooter(Object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Footer)
     {
         TableCellCollection cells = e.Row.Cells;
         cells[0].CssClass = "AffiliateCommissionFooterFirstColumn";
         cells[1].Text     = "Total";
         cells[1].CssClass = "AffiliateCommissionFooterTotalColumn";
         cells[2].Text     = AdminUtilities.FormatPrice(Convert.ToDecimal(GetTotal()));
         cells[2].CssClass = "AffiliateCommissionFooterTotalAmountColumn";
         cells[3].CssClass = "AffiliateCommissionFooterEndColumn";
     }
 }
コード例 #4
0
    private void PopulateControl()
    {
        PopulateDate();

        IList <Order> list = DataAccessContext.OrderRepository.GetPaidOrdersByDateTime(GetStartDate(), GetEndDate());

        uxSaleAmountLabel.Text = String.Format("Number of Transactions: <strong>{0}</strong>", list.Count);
        decimal subtotal = 0;

        for (int i = 0; i < list.Count; i++)
        {
            subtotal += list[i].Total;
        }
        uxSaleTotalLabel.Text = String.Format(
            "Sales Amount: <strong>{0}</strong>",
            AdminUtilities.FormatPrice(subtotal));
    }
コード例 #5
0
    protected void uxFormView_DataBound(object sender, EventArgs e)
    {
        FormView formView = (FormView)sender;
        Order    order    = (Order)formView.DataItem;

        if (!String.IsNullOrEmpty(order.OrderID))
        {
            uxProductCostLabel.Text     = AdminUtilities.FormatPrice(order.Subtotal);
            uxDiscountLabel.Text        = AdminUtilities.FormatPrice(order.CouponDiscount * (-1));
            uxPointDiscountLabel.Text   = AdminUtilities.FormatPrice(order.RedeemPrice * (-1));
            uxGiftCertificateLabel.Text = AdminUtilities.FormatPrice(order.GiftCertificate * (-1));
            uxTaxLabel.Text             = AdminUtilities.FormatPrice(order.Tax);
            uxShippingCostLabel.Text    = AdminUtilities.FormatPrice(order.ShippingCost);
            uxHandlindFeeLabel.Text     = AdminUtilities.FormatPrice(order.HandlingFee);

            uxTotalLabel.Text       = AdminUtilities.FormatPrice(order.Total);
            UxHandlingFeeTR.Visible = IsHandlingFeeVisible();
        }
    }
コード例 #6
0
 public void SetFooter(Object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Footer)
     {
         TableCellCollection cells = e.Row.Cells;
         cells.RemoveAt(0);
         cells.RemoveAt(0);
         cells[0].ColumnSpan = 3;
         if (uxSearchFilter.SearchFilterObj.FilterType != SearchFilter.SearchFilterType.None)
         {
             if (uxSearchFilter.SearchFilterObj.Value2 != "")
             {
                 if (uxSearchFilter.SearchFilterObj.FilterType == SearchFilter.SearchFilterType.Date)
                 {
                     cells[0].Text = uxSearchFilter.SearchFilterObj.FieldName + "<br> from " +
                                     DateTime.Parse(uxSearchFilter.SearchFilterObj.Value1).ToString("MMMM d, yyyy") +
                                     " to " + DateTime.Parse(uxSearchFilter.SearchFilterObj.Value2).ToString("MMMM d, yyyy");
                 }
                 else
                 {
                     cells[0].Text = uxSearchFilter.SearchFilterObj.FieldName +
                                     "<br> from " + uxSearchFilter.SearchFilterObj.Value1 +
                                     " to " + uxSearchFilter.SearchFilterObj.Value2;
                 }
             }
             else
             {
                 cells[0].Text = uxSearchFilter.SearchFilterObj.FieldName + " from " + uxSearchFilter.SearchFilterObj.Value1;
             }
         }
         else
         {
             cells[0].Text = " Show All ";
         }
         cells[0].CssClass        = "pdl10";
         cells[1].Text            = "Total";
         cells[1].HorizontalAlign = HorizontalAlign.Center;
         cells[1].Font.Bold       = true;
         cells[2].Text            = AdminUtilities.FormatPrice(TotalPrice());
         cells[2].CssClass        = "OrderListTotalPrice";
     }
 }
コード例 #7
0
    public void SetFooter(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Footer)
        {
            if (_table != null)
            {
                decimal total         = 0;
                decimal numberOfOrder = 0;
                decimal quantity      = 0;

                for (int x = 0; x < _table.Rows.Count; x++)
                {
                    total         += ConvertUtilities.ToDecimal(_table.Rows[x]["Total"].ToString());
                    numberOfOrder += ConvertUtilities.ToInt32(_table.Rows[x]["NumberOfOrder"].ToString());
                    quantity      += ConvertUtilities.ToInt32(_table.Rows[x]["Quantity"].ToString());
                }

                TableCellCollection cells = e.Row.Cells;

                cells[0].Text            = " Total ";
                cells[0].HorizontalAlign = HorizontalAlign.Center;
                cells[0].Font.Bold       = true;

                cells[1].CssClass = "TotalReport";
                cells[1].Text     = AdminUtilities.FormatPrice(total);

                cells[2].CssClass = "TotalQuantity";
                cells[2].Text     = "" + numberOfOrder;

                cells[3].CssClass = "TotalReport";
                cells[3].Text     = AdminUtilities.FormatPrice(total / numberOfOrder);

                cells[4].CssClass = "TotalQuantity";
                cells[4].Text     = "" + quantity;

                cells[5].CssClass = "TotalQuantity";
                cells[5].Text     = "" + (quantity / numberOfOrder);
            }
        }
    }