Пример #1
0
 private void LoadItemsPerPageFromQuery()
 {
     if (MainContext.QueryString["ItemsPerPage"] != null)
     {
         ItemsPerPages = ConvertUtilities.ToInt32(MainContext.QueryString["ItemsPerPage"]);
     }
 }
    private void CreateDayData(DataTable table, DateTime day)
    {
        DateTime newDay;

        for (int i = 0; i < 24; i++)
        {
            bool existHour = false;
            if (table.Rows.Count != 0)
            {
                for (int j = 0; j < table.Rows.Count; j++)
                {
                    newDay = new DateTime(day.Year, day.Month, day.Day, day.Hour, day.Minute, day.Second).AddHours(i);
                    int      orderHour = ConvertUtilities.ToInt32(table.Rows[j]["RegisterPeriod"]);
                    DateTime orderDate = ConvertUtilities.ToDateTime(table.Rows[j]["RegisterDate"]);
                    if (orderHour == newDay.Hour && orderDate.Day == newDay.Day)
                    {
                        _data1.Add(ConvertUtilities.ToDouble(table.Rows[j][_value]));
                        existHour = true;
                        break;
                    }
                }
            }
            if (existHour == false)
            {
                _data1.Add(0);
            }
            newDay = day.AddHours(i);
            _label1.Add(newDay.Hour.ToString());
        }
        _xLegend = "Hours";
    }
    private void CreateYearData(DataTable table, DateTime day, int numMonth)
    {
        DateTime newDay;

        for (int i = 0; i < numMonth; i++)
        {
            bool existMonth = false;
            if (table.Rows.Count != 0)
            {
                for (int j = 0; j < table.Rows.Count; j++)
                {
                    int orderMonth = ConvertUtilities.ToInt32(table.Rows[j]["MonthNumber"]);
                    int orderYear  = ConvertUtilities.ToInt32(table.Rows[j]["Year"]);
                    newDay = day.AddMonths(i);
                    if (orderMonth == newDay.Month && orderYear == newDay.Year)
                    {
                        _data1.Add(ConvertUtilities.ToDouble(table.Rows[j][_value]));
                        existMonth = true;
                        break;
                    }
                }
            }
            if (existMonth == false)
            {
                _data1.Add(0);
            }
            newDay = day.AddMonths(i);
            _label1.Add(newDay.ToString("MMM, yy"));
        }
        _xLegend = "Month";
    }
Пример #4
0
    public bool ValidateAndSetUp()
    {
        if (!ValidateCoupon())
        {
            DisplayCouponError();
            return(false);
        }

        if (!ValidateGiftCertificate())
        {
            return(false);
        }

        if (uxRewardPointDiv.Visible)
        {
            if (!VerifyRewardPoint(false))
            {
                return(false);
            }
        }

        StoreContext.CheckoutDetails.SetCouponID(uxCouponIDText.Text);
        StoreContext.CheckoutDetails.SetGiftCertificate(uxGiftCertificateCodeText.Text);
        StoreContext.CheckoutDetails.RedeemPrice = GetPriceFromPoint(ConvertUtilities.ToDecimal(uxRewardPointText.Text));
        StoreContext.CheckoutDetails.RedeemPoint = ConvertUtilities.ToInt32(uxRewardPointText.Text);
        // StoreContext.CheckoutDetails.SetCustomerComments( uxCustomerComments.Text );
        StoreContext.CheckoutDetails.StoreID = StoreContext.CurrentStore.StoreID;

        return(true);
    }
    private bool IsEnoughStock(out string errMsg)
    {
        errMsg = String.Empty;
        ICartItem cartItem = StoreContext.ShoppingCart.FindCartItemByID(CartItemID);
        int       quantity = ConvertUtilities.ToInt32(uxQuantityText.Text);
        OptionItemValueCollection options = uxProductOptionGroupDetails.GetSelectedOptions();
        int productStock = cartItem.Product.GetStock(options.GetUseStockOptionItemIDs());
        int currentStock = productStock - quantity;

        if (currentStock != DataAccessContext.Configurations.GetIntValue("OutOfStockValue"))
        {
            if (CatalogUtilities.IsOutOfStock(currentStock, CheckUseInventory(cartItem.Product)))
            {
                errMsg += cartItem.Product.Name;
                if (DataAccessContext.Configurations.GetBoolValue("ShowQuantity"))
                {
                    int displayStock = productStock - DataAccessContext.Configurations.GetIntValue("OutOfStockValue");
                    if (displayStock < 0)
                    {
                        displayStock = 0;
                    }
                    errMsg += " ( available " + displayStock + " items )";
                }
            }
        }
        if (!String.IsNullOrEmpty(errMsg))
        {
            errMsg = "Stock Error : " + errMsg;
            return(false);
        }
        else
        {
            return(true);
        }
    }
Пример #6
0
    private void AddItemToShoppingCart()
    {
        OptionItemValueCollection     selectedOptions = uxOptionGroupDetails.GetSelectedOptions();
        ProductKitItemValueCollection selectedKits    = uxProductKitGroupDetails.GetSelectedProductKitItems();
        CartItemGiftDetails           giftDetails     = CreateGiftDetails();

        decimal customPrice = decimal.Parse(uxEnterAmountText.Text);

        customPrice = decimal.Divide(customPrice, Convert.ToDecimal(StoreContext.Currency.ConversionRate));


        CartAddItemService addToCartService = new CartAddItemService(
            StoreContext.Culture, StoreContext.ShoppingCart);
        int    currentStock;
        string errorOptionName;
        bool   stockOK = addToCartService.AddToCart(
            CurrentProduct,
            selectedOptions,
            selectedKits,
            ConvertUtilities.ToInt32(uxQuantityText.Text),
            giftDetails,
            customPrice,
            out errorOptionName,
            out currentStock);


        if (stockOK)
        {
            Response.Redirect("ShoppingCart.aspx");
        }
        else
        {
            DisplayOutOfStockError(currentStock, errorOptionName);
        }
    }
Пример #7
0
    private bool IsMatchQuantity()
    {
        bool isOK        = false;
        int  quantity    = ConvertUtilities.ToInt32(uxQuantityText.Text);
        int  minQuantity = CurrentProduct.MinQuantity;
        int  maxQuantity = CurrentProduct.MaxQuantity;

        uxMinQuantityLabel.Text = "[$MinQuantity]" + minQuantity;
        uxMaxQuantityLabel.Text = "[$MaxQuantity]" + maxQuantity;

        if (minQuantity > quantity)
        {
            uxMessageMinQuantityDiv.Visible = true;
            uxMessageMaxQuantityDiv.Visible = false;
        }
        else if (maxQuantity != 0 && maxQuantity < quantity)
        {
            uxMessageMinQuantityDiv.Visible = false;
            uxMessageMaxQuantityDiv.Visible = true;
        }
        else
        {
            uxMessageMinQuantityDiv.Visible = false;
            uxMessageMaxQuantityDiv.Visible = false;
            isOK = true;
        }

        return(isOK);
    }
Пример #8
0
    private void RefreshGrid()
    {
        int totalItems;
        IList <CustomerRewardPoint> rewardPointList = new List <CustomerRewardPoint>();

        if (uxItemsPerPageDrop.SelectedValue == "All")
        {
            rewardPointList = DataAccessContextDeluxe.CustomerRewardPointRepository.SearchCustomerRewardPointByCustomerIDAndStoreID(
                CustomerID,
                StoreContext.CurrentStore.StoreID,
                "ReferenceDate");

            uxPagingControl.NumberOfPages = 1;
            uxPagingControl.CurrentPage   = 1;
        }
        else
        {
            int itemsPerPage = ConvertUtilities.ToInt32(uxItemsPerPageDrop.SelectedValue);

            rewardPointList = DataAccessContextDeluxe.CustomerRewardPointRepository.SearchCustomerRewardPointByCustomerIDAndStoreID(
                CustomerID,
                StoreContext.CurrentStore.StoreID,
                "ReferenceDate",
                (uxPagingControl.CurrentPage - 1) * itemsPerPage,
                (uxPagingControl.CurrentPage * itemsPerPage) - 1,
                out totalItems);

            uxPagingControl.NumberOfPages = (int)Math.Ceiling((double)totalItems / itemsPerPage);
        }

        uxRewardPointsGrid.DataSource = rewardPointList;
        uxRewardPointsGrid.DataBind();
    }
Пример #9
0
    private void AddItemToWishListCart(object sender, EventArgs e)
    {
        string errorMessage;

        if (VerifyValidInput(out errorMessage))
        {
            OptionItemValueCollection     selectedOptions = uxOptionGroupDetails.GetSelectedOptions();
            ProductKitItemValueCollection selectedKits    = uxProductKitGroupDetails.GetSelectedProductKitItems();

            if (CurrentProduct.MinQuantity <= ConvertUtilities.ToInt32(uxQuantityText.Text))
            {
                uxAddtoWishListButton.AddItemToWishListCart(CurrentProduct.ProductID, selectedOptions, uxQuantityText.Text);
            }
            else
            {
                uxAddtoWishListButton.AddItemToWishListCart(CurrentProduct.ProductID, selectedOptions, CurrentProduct.MinQuantity.ToString());
            }

            Response.Redirect("WishList.aspx");
        }
        else
        {
            uxMessage.Text = errorMessage;
        }
    }
Пример #10
0
    private string GetRewardPointAndPointValue()
    {
        int     rewardPoint = ConvertUtilities.ToInt32(GetRewardPoint());
        decimal pointValue  = GetPriceFromPoint(rewardPoint);

        return(rewardPoint.ToString() + " points ( " + StoreContext.Currency.FormatPrice(pointValue) + " ) ");
    }
    private void RefreshGrid()
    {
        int totalItems;

        if (uxItemsPerPageDrop.SelectedValue == "All")
        {
            uxGrid.DataSource = DataAccessContextDeluxe.CustomerSubscriptionRepository.SearchCustomerSubscription(
                StoreContext.Customer.CustomerID,
                GridHelper.GetFullSortText(),
                uxSearchFilter.SearchFilterObj,
                out totalItems);

            uxPagingControl.NumberOfPages = 1;
            uxPagingControl.CurrentPage   = 1;
        }
        else
        {
            int itemsPerPage = ConvertUtilities.ToInt32(uxItemsPerPageDrop.SelectedValue);

            uxGrid.DataSource = DataAccessContextDeluxe.CustomerSubscriptionRepository.SearchCustomerSubscription(
                StoreContext.Customer.CustomerID,
                GridHelper.GetFullSortText(),
                uxSearchFilter.SearchFilterObj,
                (uxPagingControl.CurrentPage - 1) * itemsPerPage,
                (uxPagingControl.CurrentPage * itemsPerPage) - 1,
                out totalItems);

            uxPagingControl.NumberOfPages = (int)Math.Ceiling((double)totalItems / itemsPerPage);
        }

        uxGrid.DataBind();
    }
Пример #12
0
    private bool ValidateRewardPoint()
    {
        if (!IsNumeric(uxRewardPointText.Text))
        {
            DisplayRewardPointError("[$InvalidInput]");
            return(false);
        }
        if (!IsInteger(uxRewardPointText.Text))
        {
            DisplayRewardPointError("[$InvalidInput]");
            return(false);
        }

        if (ConvertUtilities.ToInt32(uxRewardPointText.Text) > 0 &&
            (GetRewardPoint() == 0 || GetRewardPoint() < 0))
        {
            DisplayRewardPointError("[$NotEnoughPoint]");
            return(false);
        }

        if (IsZeroOrLessPoint())
        {
            DisplayRewardPointError("[$EnterLessOrZeroPoint]");
            return(false);
        }

        DisplayRewardPointDetails();
        return(true);
    }
    private string GetDiscountTypeBuyXGetYText(Coupon coupon, bool isErrorMessage)
    {
        String message = "";

        if (!isErrorMessage)
        {
            message = "Buy " + coupon.MinimumQuantity.ToString() + " item(s) full price and get ";

            if (coupon.DiscountType == Coupon.DiscountTypeEnum.BuyXDiscountYPrice)
            {
                message += StoreContext.Currency.FormatPrice(coupon.DiscountAmount) + " discount ";
                message += "for " + coupon.PromotionQuantity.ToString() + " item(s). ";
            }
            else //Coupon.DiscountTypeEnum.BuyXDiscountYPercentage
            {
                if (ConvertUtilities.ToInt32(coupon.Percentage) == 100)
                {
                    message += coupon.PromotionQuantity + " item(s) free. ";
                }
                else // coupon.Percentage != 100
                {
                    message += coupon.Percentage.ToString("0.00") + "% discount ";
                    message += "for " + coupon.PromotionQuantity.ToString() + " item(s). ";
                }
            }
        }
        else
        {
            message += "To use this coupon, you need to buy at least ";
            message += ConvertUtilities.ToString(coupon.MinimumQuantity + coupon.PromotionQuantity) + " items per product.";
        }

        return(message);
    }
Пример #14
0
    private void AddToCart()
    {
        int rowIndex;

        for (rowIndex = 0; rowIndex < uxGrid.Rows.Count; rowIndex++)
        {
            GridViewRow row = uxGrid.Rows[rowIndex];
            if (row.RowType == DataControlRowType.DataRow)
            {
                string giftRegistryItemID = uxGrid.DataKeys[rowIndex].Value.ToString();
                int    wantQuantity       = ConvertUtilities.ToInt32(((Label)row.FindControl("uxWantQuantityLabel")).Text.Trim());
                int    hasQuantity        = ConvertUtilities.ToInt32(((Label)row.FindControl("uxHasQuantityLabel")).Text.Trim());
                string quantityText       = ((TextBox)row.FindControl("uxQuantityText")).Text.Trim();
                int    quantity;
                int    totalItem = wantQuantity - hasQuantity;
                if (int.TryParse(quantityText, out quantity))
                {
                    if (quantity <= totalItem && quantity > 0)
                    {
                        AddGiftRegistryItemToCart(giftRegistryItemID, quantity);
                    }
                }
            }
        }
    }
Пример #15
0
    private Coupon SetupCoupon(Coupon coupon)
    {
        _couponID = uxCouponIDText.Text;

        coupon.CouponID           = uxCouponIDText.Text.Trim();
        coupon.DiscountType       = GetDiscountType();
        coupon.DiscountAmount     = ConvertUtilities.ToDecimal(uxDiscountAmountText.Text);
        coupon.Percentage         = ConvertUtilities.ToDouble(uxPercentageText.Text);
        coupon.MinimumQuantity    = ConvertUtilities.ToInt32(uxMinimumQuantityText.Text);
        coupon.PromotionQuantity  = ConvertUtilities.ToInt32(uxPromotionQuantityText.Text);
        coupon.RepeatDiscount     = uxRepeatDiscountCheckBox.Checked;
        coupon.ExpirationType     = GetExpirationType();
        coupon.ExpirationDate     = GetExpirationDate();
        coupon.ExpirationQuantity = ConvertUtilities.ToInt32(uxExpirationQuantityText.Text);
        coupon.CurrentQuantity    = ConvertUtilities.ToInt32(uxCurrentQuantityText.Text);
        coupon.MerchantNotes      = uxMerchantNotesText.Text;
        coupon.ProductFilter      = uxCouponCondition.ProductFilter;
        coupon.ProductIDs         = uxCouponCondition.ProductIDText;
        coupon.CategoryIDs        = uxCouponCondition.CategoryText;
        coupon.CustomerFilter     = uxCouponCondition.CustomerFilter;
        coupon.CustomerUserName   = uxCouponCondition.CustomerNameText;
        coupon.GenerateCouponCustomerByUserNamesOnceOnly(uxCouponCondition.CustomerNameOnceOnlyText);
        coupon.MinimumSubtotal  = ConvertUtilities.ToDecimal(uxMinimumSubtotalText.Text);
        coupon.ProductCostType  = GetProductCostType();
        coupon.FreeShippingType = GetFreeShippingType();
        return(coupon);
    }
Пример #16
0
    private void CheckCannotBuyItem()
    {
        int rowIndex;

        for (rowIndex = 0; rowIndex < uxGrid.Rows.Count; rowIndex++)
        {
            GridViewRow row = uxGrid.Rows[rowIndex];
            if (row.RowType == DataControlRowType.DataRow)
            {
                string  productID    = uxGrid.DataKeys[rowIndex]["ProductID"].ToString();
                string  optionIDText = ((HiddenField)row.FindControl("uxOptionHidden")).Value.ToString();
                decimal stock        = GetStock(productID, optionIDText);

                int     wantQuantity = ConvertUtilities.ToInt32(((Label)row.FindControl("uxWantQuantityLabel")).Text.Trim());
                int     hasQuantity  = ConvertUtilities.ToInt32(((Label)row.FindControl("uxHasQuantityLabel")).Text.Trim());
                Product product      = DataAccessContext.ProductRepository.GetOne(StoreContext.Culture, productID, new StoreRetriever().GetCurrentStoreID());

                if (wantQuantity <= hasQuantity)
                {
                    ((Label)row.FindControl("uxCannotBuyLabel")).Text    = "Completed";
                    ((TextBox)row.FindControl("uxQuantityText")).Visible = false;
                }
                else if (CatalogUtilities.IsOutOfStock(stock, product.UseInventory))
                {
                    ((Label)row.FindControl("uxCannotBuyLabel")).Text    = "Out of stock";
                    ((TextBox)row.FindControl("uxQuantityText")).Visible = false;
                }
                else
                {
                    ((Label)row.FindControl("uxCannotBuyLabel")).Text    = "";
                    ((TextBox)row.FindControl("uxQuantityText")).Visible = true;
                }
            }
        }
    }
Пример #17
0
    private string CheckErrorItem()
    {
        int    rowIndex;
        string errormsg = string.Empty;

        for (rowIndex = 0; rowIndex < uxGrid.Rows.Count; rowIndex++)
        {
            GridViewRow row = uxGrid.Rows[rowIndex];
            if (row.RowType == DataControlRowType.DataRow)
            {
                string giftRegistryItemID = uxGrid.DataKeys[rowIndex].Value.ToString();
                int    wantQuantity       = ConvertUtilities.ToInt32(((Label)row.FindControl("uxWantQuantityLabel")).Text.Trim());
                int    hasQuantity        = ConvertUtilities.ToInt32(((Label)row.FindControl("uxHasQuantityLabel")).Text.Trim());
                string productName        = ((HyperLink)row.FindControl("uxNameLink")).Text.Trim();
                string quantityText       = ((TextBox)row.FindControl("uxQuantityText")).Text.Trim();

                int quantityInCart = GiftRegistryItem.GetGiftRegistryItemQuantity(StoreContext.ShoppingCart,
                                                                                  StoreContext.Culture, StoreContext.WholesaleStatus, giftRegistryItemID);
                int totalItem = wantQuantity - hasQuantity - quantityInCart;

                int quantity;
                if (int.TryParse(quantityText, out quantity))
                {
                    if (quantity > totalItem && quantity > 0)
                    {
                        errormsg += "<li>" + productName + "</li>";
                    }
                }
            }
        }
        return(errormsg);
    }
Пример #18
0
    private bool ValidateRewardPoint()
    {
        if (!IsNumeric(uxRewardPointText.Text))
        {
            DisplayRewardPointError("Invalid Input");
            return(false);
        }
        if (!IsInteger(uxRewardPointText.Text))
        {
            DisplayRewardPointError("Invalid Input");
            return(false);
        }

        if (ConvertUtilities.ToInt32(uxRewardPointText.Text) > 0 &&
            (GetRewardPoint() == 0 || GetRewardPoint() < 0))
        {
            DisplayRewardPointError("You do not have enough Reward Point");
            return(false);
        }

        if (IsZeroOrLessPoint())
        {
            DisplayRewardPointError("Reward Point cannot less than or equal to zero(0)");
            return(false);
        }

        DisplayRewardPointDetails();
        return(true);
    }
    public string ShowFromItem(string toItem)
    {
        int fromItems = 0;

        if (CurrentDiscountGroupID != "0")
        {
            DiscountGroup discountGroup = DataAccessContext.DiscountGroupRepository.GetOne(CurrentDiscountGroupID);
            for (int i = 0; i < discountGroup.DiscountRules.Count; i++)
            {
                if (discountGroup.DiscountRules[i].ToItems == ConvertUtilities.ToInt32(toItem))
                {
                    return(String.Format("{0}", ++fromItems));
                }
                else
                {
                    fromItems = discountGroup.DiscountRules[i].ToItems;
                }
            }
        }
        else
        {
            MainContext.RedirectMainControl("QuantityDiscountList.ascx", "");
        }
        return(String.Format("{0}", ++fromItems));
    }
Пример #20
0
    protected bool IsMatchQuantity()
    {
        bool isOK        = false;
        int  quantity    = ConvertUtilities.ToInt32(uxQuantityText.Text);
        int  minQuantity = CurrentProduct.MinQuantity;
        int  maxQuantity = CurrentProduct.MaxQuantity;

        uxMinQuantityLabel.Text = "Minimum quantity is " + minQuantity;
        uxMaxQuantityLabel.Text = "Maximum quantity is " + maxQuantity;

        if (minQuantity > quantity)
        {
            uxMinQuantityLabel.Visible = true;
            uxMaxQuantityLabel.Visible = false;
        }
        else if (maxQuantity != 0 && maxQuantity < quantity)
        {
            uxMinQuantityLabel.Visible = false;
            uxMaxQuantityLabel.Visible = true;
        }
        else
        {
            uxMinQuantityLabel.Visible = false;
            uxMaxQuantityLabel.Visible = false;
            isOK = true;
        }

        return(isOK);
    }
Пример #21
0
 public DateTime GetListingSchedule(out Boolean isFixDateValid, out Boolean isFixedDate)
 {
     isFixedDate    = false;
     isFixDateValid = false;
     if (uxListOnRadio.Checked)
     {
         if (uxFixedDateCalendarPopup.IsValid)
         {
             isFixedDate    = true;
             isFixDateValid = true;
             return(new DateTime(
                        uxFixedDateCalendarPopup.SelectedDate.Year,
                        uxFixedDateCalendarPopup.SelectedDate.Month,
                        uxFixedDateCalendarPopup.SelectedDate.Day,
                        ConvertUtilities.ToInt32(uxHourDrop.SelectedValue),
                        ConvertUtilities.ToInt32(uxMinDrop.SelectedValue),
                        0));
         }
         else
         {
             return(new DateTime());
         }
     }
     else
     {
         isFixDateValid = true;
         return(DateTime.Now);
     }
 }
Пример #22
0
    private void PopulateControls()
    {
        PopulateLanguageSection();

        if (ConvertUtilities.ToInt32(CurrentID) > 0)
        {
            Product product =
                DataAccessContext.ProductRepository.GetOne(uxLanguageControl.CurrentCulture, CurrentID, new StoreRetriever().GetCurrentStoreID());

            uxProductAttributes.PopulateControls(product, "0");

            uxGiftCertificate.PopulateControls(product);
            if (product.IsGiftCertificate)
            {
                uxGiftCertificate.PopulateGiftData((GiftCertificateProduct)product);
                uxGiftCertificate.SetGiftCertificateControlsVisibility(IsEditMode());
            }

            uxRecurring.PopulateControls(product);
            if (KeyUtilities.IsDeluxeLicense(DataAccessHelper.DomainRegistrationkey, DataAccessHelper.DomainName))
            {
                uxProductSubscription.PopulateControls(product);
            }
            uxProductAttributes.IsFixPrice(
                uxGiftCertificate.IsFixedPrice, uxGiftCertificate.IsGiftCertificate, uxRecurring.IsRecurring, uxProductAttributes.IsCallForPrice);
            uxProductKit.PopulateControls(product);
        }
    }
    private void PopulateCommission(out int totalItems)
    {
        int itemsPerPage = 0;

        IList <AffiliateOrder> affiliateOrderList;

        if (uxItemsPerPageDrop.SelectedValue == "All")
        {
            affiliateOrderList = DataAccessContextDeluxe.AffiliateOrderRepository.SearchCommission(
                GridHelper.GetFullSortText(),
                AffiliateCode,
                StartOrderID,
                EndOrderID,
                StartAmount,
                EndAmount,
                StartCommission,
                EndCommission,
                StartOrderDate,
                EndOrderDate,
                PaymentStatus,
                out totalItems);
            uxPagingControl.NumberOfPages = 1;
            uxPagingControl.CurrentPage   = 1;
        }
        else
        {
            itemsPerPage = ConvertUtilities.ToInt32(uxItemsPerPageDrop.SelectedValue);

            affiliateOrderList = DataAccessContextDeluxe.AffiliateOrderRepository.SearchCommission(
                GridHelper.GetFullSortText(),
                AffiliateCode,
                StartOrderID,
                EndOrderID,
                StartAmount,
                EndAmount,
                StartCommission,
                EndCommission,
                StartOrderDate,
                EndOrderDate,
                PaymentStatus,
                (uxPagingControl.CurrentPage - 1) * itemsPerPage,
                (uxPagingControl.CurrentPage * itemsPerPage) - 1,
                out totalItems);
            uxPagingControl.NumberOfPages = (int)Math.Ceiling((double)totalItems / itemsPerPage);
        }

        uxGrid.DataSource = affiliateOrderList;
        uxGrid.DataBind();


        if (uxGrid.Rows.Count == 0)
        {
            uxListPanel.Visible = false;
        }
        else
        {
            uxListPanel.Visible = true;
        }
    }
Пример #24
0
    protected string GetTextName(object item)
    {
        DataRowView data      = ( DataRowView )item;
        DateTime    time      = new DateTime(ConvertUtilities.ToInt32(data.Row["CreateYear"]), ConvertUtilities.ToInt32(data.Row["CreateMonth"]), 1);
        string      monthName = time.ToString("MMMM");

        return(monthName + " " + data.Row["CreateYear"]);
    }
Пример #25
0
 protected bool IsHasLink(object orderID)
 {
     if (ConvertUtilities.ToInt32(orderID) > 0)
     {
         return(true);
     }
     return(false);
 }
Пример #26
0
    protected void uxGrid_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {
            GridViewRow row                   = uxProductKitGroupItemGrid.Rows[e.RowIndex];
            string      productID             = ((Label)row.FindControl("uxProductIDLabel")).Text;
            bool        isDefault             = ((CheckBox)row.FindControl("uxIsDefaultCheck")).Checked;
            bool        isUserDefinedQuantity = ((CheckBox)row.FindControl("uxIsUserDefinedQuantityCheck")).Checked;
            string      quantity              = ((TextBox)row.FindControl("uxQuantityText")).Text;

            ProductKitGroup        kitGroup = DataAccessContext.ProductKitGroupRepository.GetOne(CurrentCulture, CurrentID);
            IList <ProductKitItem> itemList = kitGroup.ProductKitItems;

            IList <ProductKitItem> newList = new List <ProductKitItem>();

            foreach (ProductKitItem item in itemList)
            {
                if (isDefault)
                {
                    if (item.ProductID == productID)
                    {
                        item.IsDefault             = isDefault;
                        item.IsUserDefinedQuantity = isUserDefinedQuantity;
                        item.Quantity = ConvertUtilities.ToInt32(quantity);
                    }
                    else
                    {
                        item.IsDefault = false;
                    }

                    newList.Add(item);
                }
                else
                {
                    if (item.ProductID == productID)
                    {
                        item.IsDefault             = isDefault;
                        item.IsUserDefinedQuantity = isUserDefinedQuantity;
                        item.Quantity = ConvertUtilities.ToInt32(quantity);
                    }

                    newList.Add(item);
                }
            }

            kitGroup.ProductKitItems = newList;
            DataAccessContext.ProductKitGroupRepository.Save(kitGroup);
            uxMessage.DisplayMessage(Resources.ProductKitGroupItemMessages.ItemUpdateSuccess);

            uxProductKitGroupItemGrid.EditIndex = -1;
            RefreshGrid();
        }
        finally
        {
            // Avoid calling Update() automatically by GridView
            e.Cancel = true;
        }
    }
Пример #27
0
 protected void uxVeryfyRewardPointButton_Click(object sender, EventArgs e)
 {
     if (VerifyRewardPoint(true))
     {
         StoreContext.CheckoutDetails.StoreID     = StoreContext.CurrentStore.StoreID;
         StoreContext.CheckoutDetails.RedeemPrice = GetPriceFromPoint(ConvertUtilities.ToDecimal(uxRewardPointText.Text));
         StoreContext.CheckoutDetails.RedeemPoint = ConvertUtilities.ToInt32(uxRewardPointText.Text);
     }
 }
Пример #28
0
    protected void checkDownloadCount(object source, ServerValidateEventArgs args)
    {
        int  count     = ConvertUtilities.ToInt32(uxDownloadCountText.Text);
        bool IsVisible = DownloadCountPanel.Visible;

        if (IsVisible && count < 0)
        {
            args.IsValid = false;
        }
    }
Пример #29
0
    private void DisplayRewardPointDetails()
    {
        uxRewardPointMessageTR.Visible = false;
        decimal reward = GetPriceFromPoint(ConvertUtilities.ToDecimal(uxRewardPointText.Text));

        uxRewardPointLabel.Text = "You are using " + uxRewardPointText.Text + " point ( " + StoreContext.Currency.FormatPrice(reward) + " ) ";

        StoreContext.CheckoutDetails.RedeemPrice = reward;
        StoreContext.CheckoutDetails.RedeemPoint = ConvertUtilities.ToInt32(uxRewardPointText.Text);
    }
Пример #30
0
 private OrderItem LoadOrderItemDataFromGui(OrderItem orderItem)
 {
     orderItem.OrderID       = CurrentOrderID;
     orderItem.Quantity      = ConvertUtilities.ToInt32(uxQuantityText.Text);
     orderItem.Name          = uxNameText.Text;
     orderItem.Sku           = uxSkuText.Text;
     orderItem.UnitPrice     = ConvertUtilities.ToDecimal(uxUnitPriceText.Text);
     orderItem.DownloadCount = ConvertUtilities.ToInt32(uxDownloadCountText.Text);
     return(orderItem);
 }