Esempio n. 1
0
        /// <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 {
                Page.Title = string.Format(WebUtility.MainTitleTemplate, Master.SiteSettings.SiteName, LocalizationUtility.GetText("titleCart"));
                order      = new OrderController().FetchOrder(WebUtility.GetUserName());
                PaymentServiceSettings providers = PaymentService.FetchConfiguredPaymentProviders();
                if (providers != null)
                {
                    if (providers.DefaultProvider == "PayPalProPaymentProvider" && !(string.IsNullOrEmpty(providers.ProviderSettingsCollection["PayPalProPaymentProvider"].Parameters[PayPalProPaymentProvider.BUSINESS_EMAIL])))
                    {
                        pnlExpressCheckout.Visible = true;
                    }
                }
                if (!Page.IsPostBack)
                {
                    bool changesMade = OrderController.NormalizeCartQuantities(order);
                    if (changesMade)
                    {
                        messageCenter.Visible = true;
                        messageCenter.DisplayInformationMessage(LocalizationUtility.GetText("lblCartChanged"));
                    }
                    if (order.OrderId > 0 && order.OrderItemCollection.Count > 0)
                    {
                        pnlNoCart.Visible  = false;
                        orderSummary.Order = order;

                        lblSubTotalAmountTop.Text = StoreUtility.GetFormattedAmount(order.SubTotal, true);
                        lbUpdate.Text             = LocalizationUtility.GetText("lblUpdate");
                    }
                    else
                    {
                        pnlCart.Visible = false;

                        ProductCollection productCollection;
                        if (this.Master.SiteSettings.CollectBrowsingProduct)
                        {
                            productCollection = Store.Caching.ProductCache.GetMostPopularProducts();
                        }
                        else
                        {
                            productCollection = new ProductController().FetchRandomProducts();//Should we cache this?
                        }
                        catalogList.ProductCollection = productCollection;
                    }
                }
            }
            catch (Exception ex) {
                Logger.Error(typeof(cart).Name + ".Page_Load", ex);
                throw;
            }
        }
 /// <summary>
 /// Sets the tracking logs properties.
 /// </summary>
 private void SetTrackingLogsProperties()
 {
     this.Title = LocalizationUtility.GetText("titleTrackingLogs");
 }
Esempio n. 3
0
 /// <summary>
 /// Sets the transaction properties.
 /// </summary>
 private void SetTransactionProperties()
 {
     this.Page.Title = LocalizationUtility.GetText("titleOrderTransactions");
 }
Esempio n. 4
0
        private void GetPageName(string pageName)
        {
            try
            {
                //cid = Utils.GetParameter("page", string.Empty);
                cid    = Utils.GetParameter("cid", string.Empty);
                cidsub = Utils.GetParameter("cidsub", string.Empty);
                id     = Utils.GetParameter("id", string.Empty);

                //if (pageName == "tim-kiem" || pageName == "search")
                //{
                //    //id = cid;
                //    //cidsub = pageName = string.Empty;
                //}

                if (cidsub != string.Empty && id != string.Empty)
                {
                    //Đi đến trang danh mục giao diện nhưng có hình PC, Mobile
                    if (cidsub.ToLower() == "page")
                    {
                        pageName         = "Pages/TemplateManagement/Template.ascx";
                        Session["level"] = 3;
                    }
                    else
                    {
                        ProductBLL pcBll = new ProductBLL();
                        cidsub = cidsub != LocalizationUtility.GetText("linktmp", Ci) ? cidsub : string.Empty;
                        IList <PNK_Product> lst = pcBll.GetList(LangInt, cidsub, string.Empty, string.Empty, id, null, string.Empty, 1, 9999, out total);
                        if (total > 0)
                        {
                            lst              = lst.Where(p => p.ProductDesc.TitleUrl == id).ToList();
                            pageName         = lst[0].Page;
                            Session["level"] = 3;
                        }
                    }
                }
                else
                {
                    ProductCategoryBLL pcBll = new ProductCategoryBLL();
                    if ((cid == string.Empty && id == string.Empty) || (pageName == "tim-kiem" || pageName == "search"))
                    {
                        IList <PNK_ProductCategory> lst = pcBll.GetList(LangInt, pageName, string.Empty, int.MinValue, false, "p.ordering", 1, 9999, out total);
                        if (total > 0)
                        {
                            pageName         = lst[0].Page;
                            Session["level"] = lst[0].PathTree.Count(i => i.Equals('.'));
                        }
                    }
                    else
                    {
                        IList <PNK_ProductCategory> lst = pcBll.GetList(LangInt, cid, string.Empty, int.MinValue, false, "p.ordering", 1, 9999, out total);
                        if (total > 0)
                        {
                            pageName         = lst[0].Page;
                            Session["level"] = lst[0].PathTree.Count(i => i.Equals('.'));
                        }
                    }
                }

                //draft code


                UserControl contentView = (UserControl)Page.LoadControl(pageName);
                phdContent.Controls.Add(contentView);
            }
            catch (Exception ex)
            {
                Write2Log.WriteLogs("default.aspx", "GetPageName", ex.Message + "/" + cid + "/" + cidsub + "/" + id);
            }
        }
Esempio n. 5
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data     = e.Item.DataItem as PNK_Product;
                HtmlAnchor  hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;
                HtmlAnchor  hypImg   = e.Item.FindControl("hypImg") as HtmlAnchor;

                cid = Utils.GetParameter("cid", string.Empty);
                string link  = UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId);
                int    level = link.Count(i => i.Equals('/'));
                if (level == 1)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), LocalizationUtility.GetText("linkCate", Ci), LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }
                else if (level == 2)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link, LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }
                else if (level == 3)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link, data.ProductDesc.TitleUrl);
                }
                else if (level == 4)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link, data.ProductDesc.TitleUrl);
                }

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = hypTitle.Title = hypImg.Title = img.Alt = img.Attributes["title"] = data.ProductDesc.Title;
            }
        }
Esempio n. 6
0
 /// <summary>
 /// Sets the coupon properites.
 /// </summary>
 private void SetCouponProperites()
 {
     Page.Title = LocalizationUtility.GetText("titleProductCoupons");
 }
Esempio n. 7
0
 /// <summary>
 /// Sets the general properties.
 /// </summary>
 private void SetGeneralProperties()
 {
     this.Page.Title = LocalizationUtility.GetText("titleProductEditGeneral");
     btnDelete.Attributes.Add("onclick", "return confirm(\"" + LocalizationUtility.GetText("lblConfirmDelete") + "\");return false;");
 }
Esempio n. 8
0
 /// <summary>
 /// Sets the checkout properties.
 /// </summary>
 private void SetCheckoutProperties()
 {
     btnBillingAddress.Text = btnShippingAddress.Text = btnShippingMethod.Text = btnPaymentMethod.Text = btnCoupon.Text = LocalizationUtility.GetText("lblContinue");
 }
Esempio n. 9
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data     = e.Item.DataItem as PNK_Product;
                HtmlAnchor  hypImg   = e.Item.FindControl("hypImg") as HtmlAnchor;
                HtmlAnchor  hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;

                string link  = UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId);
                int    level = link.Count(i => i.Equals('/'));

                if (level == 1)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), LocalizationUtility.GetText("linkCate", Ci), LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }
                else if (level == 2)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link, LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }
                else if (level == 3)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link, data.ProductDesc.TitleUrl);
                    //hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(pageName, LangId, cid, data.CategoryUrlDesc, data.ProductDesc.TitleUrl);
                }
                else if (level == 4)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link, data.ProductDesc.TitleUrl);
                }

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                hypImg.Title = ltrTitle.Text = img.Alt = img.Attributes["title"] = data.ProductDesc.Title;

                Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                ltrBrief.Text = data.ProductDesc.Brief;

                StringBuilder sbPrice           = new StringBuilder();
                StringBuilder sbDiscountPercent = new StringBuilder();
                //Nếu không có giá giảm
                if (string.IsNullOrWhiteSpace(data.Post))
                {
                    string normalPrice = data.Website == "" ? "Call" : string.Format("$USD {0}", data.Website);
                    sbPrice.Append("<div class=\"package-info\"><i class=\"icon-tag\"></i><span class=\"package-price\">" + normalPrice + "</span></div>");
                    sbDiscountPercent.Append("<div class=\"package-ribbon-wrapper\"><div class=\"hidden package-type normal-type\">Learn More</div><div class=\"clear\"></div><div class=\"hidden package-type-gimmick\"></div><div class=\"clear\"></div></div>");
                }
                //Nếu có giá giảm
                else
                {
                    string  normalPrice     = data.Website == "" ? "Call" : string.Format("$USD {0}", data.Website);
                    decimal discountPercent = ((DBConvert.ParseDecimal(data.Website) - DBConvert.ParseDecimal(data.Post)) / DBConvert.ParseDecimal(data.Website)) * 100;
                    sbPrice.Append("<div class=\"package-info last-minute\"><div class=\"package-info-inner\"><span class=\"discount-price\"><i class=\"icon-tag\"></i> $USD " + data.Post + "</span><span class=\"normal-price\">$USD " + data.Website + "</span></div></div>");
                    sbDiscountPercent.Append("<div class=\"package-ribbon-wrapper\"><div class=\"hidden package-type last-minute\"><span class=\"head\">Last Minute</span><span class=\"discount-text\">" + discountPercent + " Off</span></div><div class=\"clear\"></div><div class=\"hidden package-type-gimmick\"></div><div class=\"clear\"></div></div>");
                }
                Literal ltrPrice = e.Item.FindControl("ltrPrice") as Literal;
                ltrPrice.Text = sbPrice.ToString();
                Literal ltrDiscountPercent = e.Item.FindControl("ltrDiscountPercent") as Literal;
                ltrDiscountPercent.Text = sbDiscountPercent.ToString();

                Literal ltrDate = e.Item.FindControl("ltrDate") as Literal;
                ltrDate.Text = data.Area == "" ? "Available all year round" : string.Format("{0}; {1}", data.Area, data.Code);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Handles the Click event of the btnSave 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 btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try {
                    int manufacturerId = 0;
                    int.TryParse(ddlManufacturer.SelectedValue, out manufacturerId);
                    int statusId = 0;
                    int.TryParse(ddlStatus.SelectedValue, out statusId);
                    int productTypeId = 0;
                    int.TryParse(ddlProductType.SelectedValue, out productTypeId);
                    int shippingEstimateId = 0;
                    int.TryParse(ddlShippingEstimate.SelectedValue, out shippingEstimateId);
                    int taxRateId = 0;
                    int.TryParse(ddlTaxRate.SelectedValue, out taxRateId);

                    decimal ourPrice = 0;
                    decimal.TryParse(txtOurPrice.Text.Trim(), out ourPrice);
                    decimal retailPrice = 0;
                    decimal.TryParse(txtRetailPrice.Text.Trim(), out retailPrice);
                    decimal weight = 0;
                    decimal.TryParse(txtWeight.Text.Trim(), out weight);
                    decimal length = 0;
                    decimal.TryParse(txtLength.Text.Trim(), out length);
                    decimal height = 0;
                    decimal.TryParse(txtHeight.Text.Trim(), out height);
                    decimal width = 0;
                    decimal.TryParse(txtWidth.Text.Trim(), out width);
                    //int listOrder = 0;
                    //int.TryParse(txtListOrder.Text.Trim(), out listOrder);
                    if (product.ProductId == 0)
                    {
                        product.ProductGuid = Guid.NewGuid();
                    }
                    product.BaseSku                   = txtBaseSku.Text.Trim();
                    product.Name                      = txtName.Text.Trim();
                    product.ShortDescription          = HttpUtility.HtmlEncode(txtShortDescription.Value.Trim());
                    product.OurPrice                  = ourPrice;
                    product.RetailPrice               = retailPrice;
                    product.ManufacturerId            = manufacturerId;
                    product.ProductStatusDescriptorId = statusId;
                    product.ProductTypeId             = productTypeId;
                    product.TaxRateId                 = taxRateId;
                    product.ShippingEstimateId        = shippingEstimateId;
                    product.Weight                    = weight;
                    product.Length                    = length;
                    product.Height                    = height;
                    product.Width                     = width;
                    //default this to avoid division errors
                    product.TotalRatingVotes = 1;
                    product.RatingSum        = 3;
                    product.Save(WebUtility.GetUserName());
                    Store.Caching.ProductCache.RemoveProductFromCache(product.ProductId);

                    //refresh the cache
                    foreach (Category item in product.GetCategoryCollection())
                    {
                        Store.Caching.ProductCache.RemoveProductsByCategoryIdFromCache(item.CategoryId);
                    }

                    if (product.ProductId > 0)
                    {
                        Response.Redirect(string.Format("~/admin/productedit.aspx?view=g&productId={0}", product.ProductId.ToString()), false);
                    }
                    else
                    {
                        base.MasterPage.MessageCenter.DisplayFailureMessage(LocalizationUtility.GetText("lblProductNotSaved"));
                    }
                }
                catch (Exception ex) {
                    Logger.Error(typeof(general).Name + ".btnSave_Click", ex);
                    base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
                }
            }
        }
Esempio n. 11
0
 /// <summary>
 /// Sets the shipping properties.
 /// </summary>
 private void SetShippingProperties()
 {
     this.Page.Title = LocalizationUtility.GetText("titleOrderShipping");
 }
 /// <summary>
 /// Sets the attribute edit properties.
 /// </summary>
 private void SetAttributeEditProperties()
 {
     this.Title = LocalizationUtility.GetText("titleProductAttributes");
     lblAdjustmentCurrencySymbol.Text = cultureInfo.NumberFormat.CurrencySymbol;
 }
Esempio n. 13
0
        /// <summary>
        /// ItemDataBound
        /// </summary>
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string        img, alt, publishedTask;
                HtmlTableRow  tr  = (HtmlTableRow)e.Item.FindControl("trList");
                HtmlInputText txt = null;
                if (e.Item.ItemIndex % 2 == 0)
                {
                    tr.Attributes.Add("class", "even");
                }
                else
                {
                    tr.Attributes.Add("class", "old");
                }

                try
                {
                    PNK_User data = (PNK_User)e.Item.DataItem;

                    //Role
                    Literal ltr = null;
                    ltr      = (Literal)e.Item.FindControl("ltrchk");
                    ltr.Text = string.Format(@"<INPUT class='txt' TYPE='checkbox' ID='cb{0}' NAME='cid[]' value='{1}' onclick='isChecked(this.checked);' >",
                                             e.Item.ItemIndex, data.Id);
                    //Name
                    ltr      = (Literal)e.Item.FindControl("ltrUserName");
                    ltr.Text = data.Username; //Server.HtmlDecode(getScmplit(data.Lvl) + "&bull; | " + data.Lvl + " | " + data.ProductCategoryDesc.Name);
                    //ltr.Text=
                    //image
                    if (data.Published == "1")
                    {
                        img           = "tick.png";
                        alt           = LocalizationUtility.GetText(ltrAdminPublish.Text);
                        publishedTask = "unpublish";
                    }
                    else
                    {
                        img           = "publish_x.png";
                        alt           = LocalizationUtility.GetText(ltrAminUnPublish.Text);
                        publishedTask = "publish";
                    }

                    //Id
                    HtmlInputButton btId = (HtmlInputButton)e.Item.FindControl("btId");
                    btId.Value = DBConvert.ParseString(data.Id);

                    //Base img
                    HtmlImage baseImage = (HtmlImage)e.Item.FindControl("baseImage");
                    baseImage.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["UserUpload"], data.Image);
                    HtmlAnchor hypBaseImage = (HtmlAnchor)e.Item.FindControl("hypBaseImage");

                    //set link
                    string        listItemTask = string.Format("listItemTask('cb{0}', 'edit')", e.Item.ItemIndex);
                    HtmlTableCell td           = (HtmlTableCell)e.Item.FindControl("tdName");
                    td.Attributes.Add("onclick", listItemTask);
                    td = (HtmlTableCell)e.Item.FindControl("trUpdateDate");
                    td.Attributes.Add("onclick", listItemTask);
                    td = (HtmlTableCell)e.Item.FindControl("trBaseImage");
                    td.Attributes.Add("onclick", listItemTask);


                    ImageButton imgctr = (ImageButton)e.Item.FindControl("btnPublish");
                    imgctr.ImageUrl = string.Format("/Admin/images/{0}", img);
                    imgctr.Attributes.Add("alt", alt);

                    HtmlTableCell btn = (HtmlTableCell)e.Item.FindControl("tdbtn");
                    btn.Attributes.Add("onclick", string.Format(" return listItemTask('cb{0}', '{1}')", data.Id, publishedTask));

                    //Fullname
                    ltr      = (Literal)e.Item.FindControl("ltrFullName");
                    ltr.Text = data.FullName;

                    //phone
                    ltr      = (Literal)e.Item.FindControl("ltrPhone");
                    ltr.Text = data.Phone;

                    //address
                    ltr      = (Literal)e.Item.FindControl("ltrAddress");
                    ltr.Text = data.Address;

                    //location
                    ltr      = (Literal)e.Item.FindControl("ltrLocation");
                    ltr.Text = data.LocationDesc;

                    //role
                    ltr      = (Literal)e.Item.FindControl("ltrRole");
                    ltr.Text = UserBLL.GetRoleName(data.Role);
                }
                catch { }
            }
        }
Esempio n. 14
0
 /// <summary>
 /// Gets the delete text.
 /// </summary>
 /// <returns></returns>
 protected string GetDeleteText()
 {
     return(LocalizationUtility.GetText("lblDelete"));
 }
Esempio n. 15
0
 /// <summary>
 /// Sets the provider management properties.
 /// </summary>
 private void SetProviderManagementProperties()
 {
     pnlSettings.GroupingText = LocalizationUtility.GetText("pnlProviderDetails");
 }
Esempio n. 16
0
        /// <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)
        {
            Page.Title = string.Format(WebUtility.MainTitleTemplate, Master.SiteSettings.SiteName, LocalizationUtility.GetText("titleCheckout"));
            SetCheckoutProperties();
            if (!shippingService.ShippingServiceSettings.UseShipping)
            {
                chkUseForShipping.Visible = false;
            }
            if (!Page.IsPostBack)
            {
                LoadStartAndExpirationYearDropDown();
                LoadStartAndExpirationMonthDropDown();
            }
            //Set these early, so they can be overridden - they aren't used in production
      #if DEBUG
            if (!Page.IsPostBack)
            {
                if (order.PaymentMethod != "PayPal")
                {
                    ddlCreditCardType.SelectedValue  = "1";
                    txtCreditCardNumber.Text         = "4978368392614864";
                    txtCreditCardSecurityNumber.Text = "027";
                    int selectedMonth = (DateTime.Now.Month + 1);
                    ddlCreditCardExpirationMonth.SelectedValue = selectedMonth.ToString();
                    int selectedYear = (DateTime.Now.Year + 1);
                    ddlCreditCardExpirationYear.SelectedValue = selectedYear.ToString();
                }
            }
      #endif
            if (Master.SiteSettings.RequireSsl)
            {
                WebUtility.EnsureSsl();
            }
            if (order.OrderItemCollection.Count <= 0)
            {
                Response.Redirect("~/cart.aspx", true);
            }

            orderSummary.Order = order;
        }
Esempio n. 17
0
 /// <summary>
 /// Sets the error logs properties.
 /// </summary>
 private void SetErrorLogsProperties()
 {
     this.Title = LocalizationUtility.GetText("titleErrorLogs");
 }
Esempio n. 18
0
 private void SetDownloadProperties()
 {
     this.Title        = LocalizationUtility.GetText("titleProductDownloads");
     tpFile.HeaderText = LocalizationUtility.GetText("tpFile");
 }
Esempio n. 19
0
        /// <summary>
        /// Handles the click event for deleting an image from server
        /// </summary>
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            string fileName = Path.GetFileName(txtImageFile.Text);

            File.Delete(Server.MapPath("~/repository/product/" + fileName));
            MasterPage.MessageCenter.DisplaySuccessMessage(string.Format("{0} {1}", fileName, LocalizationUtility.GetText("lblDeletedFromServer")));
            txtImageFile.Text = string.Empty;
        }
Esempio n. 20
0
        protected override void Render(HtmlTextWriter writer)
        {
            string      langId = Utils.GetParameter("langid", Constant.DB.langVn);
            CultureInfo ci     = WebUtils.getResource(langId);

            if ((int)ItemCount <= PageSize)
            {
                return;
            }
            PageClause       = LocalizationUtility.GetText("page_clause", ci);
            OfClause         = LocalizationUtility.GetText("of_clause", ci);
            ShowResultClause = LocalizationUtility.GetText("show_result_clause", ci);
            NextToPageClause = LocalizationUtility.GetText("next_to_page_clause", ci);
            BackToPageClause = LocalizationUtility.GetText("back_to_page_clause", ci);
            ToClause         = LocalizationUtility.GetText("to_clause", ci);
            PreviousClause   = LocalizationUtility.GetText("previous_clause", ci);
            NextClause       = LocalizationUtility.GetText("next_clause", ci);

            if (Page != null)
            {
                Page.VerifyRenderingInServerForm(this);
            }

            if (this.PageCount > this.SmartShortCutThreshold && GenerateSmartShortCuts)
            {
                CalculateSmartShortcutAndFillList();
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pages");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (GeneratePagerInfoSection)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "info");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                int startItem = 0;
                startItem = (CurrentIndex - 1) * PageSize;
                int endItem = startItem + PageSize;
                endItem = endItem > (int)ItemCount ? (int)ItemCount : endItem;

                writer.Write(ShowResultClause + " <b>" + (startItem + 1).ToString() + " - " + endItem.ToString() + "</b>&nbsp;&nbsp;");
                writer.RenderEndTag();
            }

            if (GenerateFirstLastSection && CurrentIndex != 1)
            {
                writer.Write(RenderFirst());
            }

            if (CurrentIndex != 1)
            {
                writer.Write(RenderBack());
            }

            if (CurrentIndex < CompactModePageCount)
            {
                if (CompactModePageCount > PageCount)
                {
                    CompactModePageCount = PageCount;
                }

                for (int i = 1; i < CompactModePageCount + 1; i++)
                {
                    if (i == CurrentIndex)
                    {
                        writer.Write(RenderCurrent());
                    }
                    else
                    {
                        writer.Write(RenderOther(i));
                    }
                }

                RenderSmartShortCutByCriteria(CompactModePageCount, true, writer);
            }
            else if (CurrentIndex >= CompactModePageCount && CurrentIndex < NormalModePageCount)
            {
                if (NormalModePageCount > PageCount)
                {
                    NormalModePageCount = PageCount;
                }

                for (int i = 1; i < NormalModePageCount + 1; i++)
                {
                    if (i == CurrentIndex)
                    {
                        writer.Write(RenderCurrent());
                    }
                    else
                    {
                        writer.Write(RenderOther(i));
                    }
                }

                RenderSmartShortCutByCriteria(NormalModePageCount, true, writer);
            }
            else if (CurrentIndex >= NormalModePageCount)
            {
                int gapValue  = NormalModePageCount / 2;
                int leftBand  = CurrentIndex - gapValue;
                int rightBand = CurrentIndex + gapValue;


                RenderSmartShortCutByCriteria(leftBand, false, writer);

                for (int i = leftBand; (i < rightBand + 1) && i < PageCount + 1; i++)
                {
                    if (i == CurrentIndex)
                    {
                        writer.Write(RenderCurrent());
                    }
                    else
                    {
                        writer.Write(RenderOther(i));
                    }
                }

                if (rightBand < this.PageCount)
                {
                    RenderSmartShortCutByCriteria(rightBand, true, writer);
                }
            }

            if (CurrentIndex != PageCount)
            {
                writer.Write(RenderNext());
            }

            if (GenerateFirstLastSection && CurrentIndex != PageCount)
            {
                writer.Write(RenderLast());
            }

            if (GenerateGoToSection)
            {
                writer.Write(RenderGoTo());
            }

            writer.RenderEndTag();
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "clr");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.RenderEndTag();

            if (GenerateGoToSection)
            {
                writer.Write(RenderGoToScript());
            }

            if (GenerateHiddenHyperlinks)
            {
                writer.Write(RenderHiddenDiv());
            }
        }
Esempio n. 21
0
 /// <summary>
 /// Sets the images properties.
 /// </summary>
 private void SetImagesProperties()
 {
     this.Page.Title             = LocalizationUtility.GetText("titleProductEditImages");
     hlImageSelector.NavigateUrl = string.Format("~/admin/imageselector.aspx?view=p&controlId={0}", txtImageFile.ClientID);
 }
Esempio n. 22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     base.MessageCenter.Title = LocalizationUtility.GetText("pnlMessageCenter");
     divMessageCenter.Controls.Add(base.MessageCenter);
 }
Esempio n. 23
0
 /// <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 {
         transactionId = Utility.GetIntParameter("tid");
         orderId       = Utility.GetIntParameter("oid");
         if (transactionId > 0)
         {
             Transaction transaction = new Transaction(transactionId);
             Order       order       = new OrderController().FetchOrder(transaction.OrderId, WebUtility.GetUserName());
             if (order.OrderId > 0)
             {
                 lblReceipt.Text = order.ToHtml();
             }
         }
         if (orderId > 0)
         {
             Order order = new OrderController().FetchOrder(orderId, WebUtility.GetUserName());
             if (order.OrderId > 0)
             {
                 lblReceipt.Text = order.ToHtml();
             }
         }
         this.Title = string.Format(WebUtility.MainTitleTemplate, Master.SiteSettings.SiteName, LocalizationUtility.GetText("lblReceipt"));
     }
     catch (Exception ex) {
         Logger.Error(typeof(receipt).Name + ".Page_Load", ex);
         throw;
     }
 }
Esempio n. 24
0
 /// <summary>
 /// Sets the login control properties.
 /// </summary>
 private void SetLoginControlProperties()
 {
     this.Title = string.Format(WebUtility.MainTitleTemplate, Master.SiteSettings.SiteName, LocalizationUtility.GetText("titleLogin"));
     llogin.UserNameLabelText    = LocalizationUtility.GetText("lloginUserNameLabelText");
     llogin.PasswordLabelText    = LocalizationUtility.GetText("lloginPasswordLabelText");
     llogin.TitleText            = LocalizationUtility.GetText("lloginTitleText");
     llogin.PasswordRecoveryText = LocalizationUtility.GetText("lloginPasswordRecoveryText");
     llogin.CreateUserText       = LocalizationUtility.GetText("lloginCreateUserText");
 }
Esempio n. 25
0
 /// <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)
 {
     dcProviderSettings.ProviderType = ProviderType.PaymentProvider;
     this.Title = LocalizationUtility.GetText("titlePaymentSettings");
 }
Esempio n. 26
0
        /// <summary>
        /// ItemDataBound
        /// </summary>
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string        img, alt, publishedTask;
                HtmlTableRow  tr  = (HtmlTableRow)e.Item.FindControl("trList");
                HtmlInputText txt = null;
                if (e.Item.ItemIndex % 2 == 0)
                {
                    tr.Attributes.Add("class", "even");
                }
                else
                {
                    tr.Attributes.Add("class", "old");
                }

                try
                {
                    PNK_ProductCategory data = (PNK_ProductCategory)e.Item.DataItem;

                    //Role
                    Literal ltr = null;
                    ltr      = (Literal)e.Item.FindControl("ltrchk");
                    ltr.Text = string.Format(@"<INPUT class='txt' TYPE='checkbox' ID='cb{0}' NAME='cid[]' value='{1}' onclick='isChecked(this.checked);' >",
                                             e.Item.ItemIndex, data.Id);

                    //Check
                    if (data.Published == "1")
                    {
                        img           = "tick.png";
                        alt           = LocalizationUtility.GetText(ltrAdminPublish.Text);
                        publishedTask = "unpublish";
                    }
                    else
                    {
                        img           = "publish_x.png";
                        alt           = LocalizationUtility.GetText(ltrAminUnPublish.Text);
                        publishedTask = "publish";
                    }

                    //Order
                    txt       = (HtmlInputText)e.Item.FindControl("txtOrder");
                    txt.Value = DBConvert.ParseString(data.Ordering);

                    //Id
                    HtmlInputButton btId = (HtmlInputButton)e.Item.FindControl("btId");
                    btId.Value = DBConvert.ParseString(data.Id);

                    //Base img
                    HtmlImage baseImage = (HtmlImage)e.Item.FindControl("baseImage");
                    baseImage.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], data.BaseImage);
                    HtmlAnchor hypBaseImage = (HtmlAnchor)e.Item.FindControl("hypBaseImage");

                    //set link
                    HyperLink hdflink = new HyperLink();
                    hdflink           = (HyperLink)e.Item.FindControl("hdflink");
                    hypBaseImage.HRef = hdflink.NavigateUrl = template_path + LinkHelper.GetAdminLink("edit_productcategory", data.Id);

                    //HtmlTableCell td = (HtmlTableCell)e.Item.FindControl("tdName");
                    //td.Attributes.Add("onclick", string.Format("listItemTask('cb{0}', 'Edit')", e.Item.ItemIndex));
                    //td = (HtmlTableCell)e.Item.FindControl("trUpdateDate");
                    //td.Attributes.Add("onclick", string.Format("listItemTask('cb{0}', 'Edit')", e.Item.ItemIndex));
                    ImageButton imgctr = (ImageButton)e.Item.FindControl("btnPublish");
                    imgctr.ImageUrl = string.Format("/Admin/images/{0}", img);
                    imgctr.Attributes.Add("alt", alt);
                    HtmlTableCell btn = (HtmlTableCell)e.Item.FindControl("tdbtn");
                    btn.Attributes.Add("onclick", string.Format(" return listItemTask('cb{0}', '{1}')", e.Item.ItemIndex, publishedTask));

                    //Name
                    ltr = (Literal)e.Item.FindControl("ltrName");
                    hypBaseImage.Attributes["title"] = baseImage.Alt = baseImage.Attributes["title"] = ltr.Text = data.ProductCategoryDesc.TreeNameDesc;
                    // Utils.GetScmplitBySpace(data.ProductCategoryDesc.Name, data.PathTree);
                    //Server.HtmlDecode(getScmplit(data.Lvl) + "&bull; | " + data.Lvl + " | " + data.ProductCategoryDesc.Name);
                }
                catch { }
            }
        }
Esempio n. 27
0
        private void GetProject()
        {
            try
            {
                ProductBLL pcBll = new ProductBLL();
                DataTable  dtb   = DBHelper.ExcuteFromCmd("SELECT * FROM dbo.fc_GetAllChildProductCategory(" + ConfigurationManager.AppSettings["parentIdProject"] + ",1)", null);
                if (dtb != null && dtb.Rows.Count > 0)
                {
                    string[] array = dtb.AsEnumerable()
                                     .Select(row => row.Field <Int32>("id").ToString())
                                     .ToArray();
                    string idFirst          = string.Join(",", array);
                    IList <PNK_Product> lst = pcBll.GetList(LangInt, string.Empty, "1", idFirst, string.Empty, string.Empty, string.Empty, 1, 6, out total);
                    if (lst.Count > 0)
                    {
                        this.rptProject.DataSource = lst;
                        this.rptProject.DataBind();
                    }
                }

                ProductCategoryBLL          pcBllCate = new ProductCategoryBLL();
                IList <PNK_ProductCategory> lstCate   = pcBllCate.GetList(LangInt, string.Empty, string.Empty, DBConvert.ParseInt(ConfigurationManager.AppSettings["parentIdProject"]), int.MinValue, false, string.Empty, 1, 1, out total);
                if (lstCate.Count > 0)
                {
                    ltrCateName.Text = string.Format("{0} {1}", lstCate[0].ProductCategoryDesc.Name, LocalizationUtility.GetText("ltrWorking", Ci));// lstCate[0].ProductCategoryDesc.Name;
                    //ltrCateBrief.Text = lstCate[0].ProductCategoryDesc.Brief;

                    hypContinusProject.HRef = LinkHelper.GetLink(lstCate[0].ProductCategoryDesc.NameUrl, LangId);
                    //ltrContinusProject.Text = LocalizationUtility.GetText("ltrContinus", Ci);
                }
            }
            catch (Exception ex)
            {
                Write2Log.WriteLogs("home", "GetProject", ex.Message);
            }
        }