Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (CardID != 0)
         {
             Cards card = new Cards();
             card.LoadByPrimaryKey(CardID);
             uiLabelName.Text = card.CardNameEng;
             uiLabelPriceFrom.Text = card.PriceBefore.ToString();
             uiLabelPriceTo.Text = card.PriceNow.ToString();
             uiImagemain.ImageUrl = card.MainPhoto;
             uiLabelDate.Text = card.UploadDate.ToString("dd/MM/yyyy");
             uiLiteralDesc.Text = card.DescriptionEng;
             CardColor colors = new CardColor();
             colors.GetCardColorsByCardID(card.CardID);
             uiRepeaterColor.DataSource = colors.DefaultView;
             uiRepeaterColor.DataBind();
             uiLinkButtonCustomize.PostBackUrl = "customize.aspx?cid=" + card.CardID;
             BindReviews();
         }
         else
         {
             Response.Redirect("~/browse.aspx");
         }
     }
 }
Esempio n. 2
0
        protected void uiButtonSaveColor_Click(object sender, EventArgs e)
        {
            CardColor color = new CardColor();
            CardColor temp = new CardColor();
            temp.LoadByPrimaryKey(Convert.ToInt32(uiDropDownListBackColor.SelectedValue), CurrentCard.CardID);
            if (!(temp.RowCount > 0))
            {
                color.AddNew();
                color.CardID = CurrentCard.CardID;
                color.ColorID = Convert.ToInt32(uiDropDownListBackColor.SelectedValue);
                color.Save();

                BindCardColors();
                ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-4\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-4\"]').addClass('active'); });", true);
                uiDropDownListBackColor.SelectedIndex = 0;
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-4\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-4\"]').addClass('active'); });", true);
                return;
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (CardID != 0)
                {
                    Cards card = new Cards();
                    card.LoadByPrimaryKey(CardID);
                    uiLabelName.Text = card.CardNameEng;
                    uiLabelPriceFrom.Text = card.PriceBefore.ToString();
                    if (card.PriceBefore == 0 || (card.PriceBefore <= card.PriceNow))
                        uiPlaceholderPriceFrom.Visible = false;
                    else
                        uiPlaceholderPriceFrom.Visible = true;
                    uiLabelPriceTo.Text = card.PriceNow.ToString();
                    uiImagemain.ImageUrl = card.GeneralPreviewPhoto;
                    uiLabelDate.Text = card.UploadDate.ToString("dd/MM/yyyy");
                    uiLiteralDesc.Text = card.DescriptionEng;
                    if (card.IsPartySupplier)
                    {
                        uipanelIsCard.Visible = false;
                        uiLinkButtonCustomize.Visible = false;
                        uiLinkButtonAddToCart.Visible = true;
                        uipanelImages.Visible = true;
                        uiImagemain.Visible = false;

                        PartySupplierImages images = new PartySupplierImages();
                        images.Where.CardID.Value = card.CardID;
                        images.Where.CardID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                        images.Query.Load();
                        images.AddNew();
                        images.CardID = card.CardID;
                        images.ImagePath = card.GeneralPreviewPhoto;
                        uiRepeaterImages.DataSource = images.DefaultView;
                        uiRepeaterImages.DataBind();

                        uiRepeaterthumbs.DataSource = images.DefaultView;
                        uiRepeaterthumbs.DataBind();

                    }
                    else
                    {
                        uipanelImages.Visible = false;
                        CardColor colors = new CardColor();
                        colors.GetCardColorsByCardID(card.CardID);
                        uiRepeaterColor.DataSource = colors.DefaultView;
                        uiRepeaterColor.DataBind();
                        uiLinkButtonCustomize.PostBackUrl = "customize.aspx?cid=" + card.CardID;
                    }
                    BindReviews();

                    Master.PageTitle = card.CardNameEng;

                    Categories cat = new Categories();
                    cat.LoadByPrimaryKey(card.CategoryID);

                    MainCat mcat = new MainCat();
                    mcat.LoadByPrimaryKey(cat.MainCatId);

                    TopLevelCat tcat = new TopLevelCat();
                    tcat.LoadByPrimaryKey(mcat.TopLevelCatID);

                    Master.Path = "<li><a href='#'>" + tcat.NameEng + "</a></li>" + "<li><a href='#'>" + mcat.NameEng + "</a></li>";
                    Master.ViewPath = true;

                }
                else
                {
                    Response.Redirect("~/browse.aspx");
                }
            }
        }
Esempio n. 4
0
        protected void uiRepeaterCards_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                DataRowView row = (DataRowView)e.Item.DataItem;
                CardColor colors = new CardColor();
                colors.GetCardColorsByCardIDTop3(Convert.ToInt32(row["CardID"].ToString()));

                Repeater uiRepeaterColor = (Repeater)e.Item.FindControl("uiRepeaterColor");

                uiRepeaterColor.DataSource = colors.DefaultView;
                uiRepeaterColor.DataBind();
            }
        }
Esempio n. 5
0
        private void LoadCardInfo()
        {
            CardLayouts layout = new CardLayouts();
            layout.GetCardLayoutByCardID(CardID);
            for (int i = 0; i < layout.RowCount; i++)
            {
                uiRadioButtonListLayouts.Items.Add(new ListItem(String.Format("<img src='{0}' style='width:100px' />", "../" + layout.LayoutImage), "../" + layout.LayoutImage + "#" + "../" + layout.LayeoutBackImage));
                layout.MoveNext();
            }

            CardColor colors = new CardColor();
            colors.GetCardColorsByCardID(CardID);
            uiRepeaterColors.DataSource = colors.DefaultView;
            uiRepeaterColors.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiRepeaterSizes.DataSource = dims.DefaultView;
            uiRepeaterSizes.DataBind();

            CardText texts = new CardText();
            texts.GetCardTxtByCardID(CardID);
            uiDataListCardText.DataSource = texts.DefaultView;
            uiDataListCardText.DataBind();

            Cards card = new Cards();
            card.LoadByPrimaryKey(CardID);

            uiImageMain.ImageUrl = "../" + card.MainPhoto;
        }
Esempio n. 6
0
        private void LoadCardInfo()
        {
            CardLayouts layout = new CardLayouts();
            layout.GetCardLayoutByCardID(CardID);
            for (int i = 0; i < layout.RowCount; i++)
            {
                uiRadioButtonListLayouts.Items.Add(new ListItem(String.Format("<img src='{0}' style='width:100px' />", ".." + layout.LayoutImage), ".." + layout.LayoutImage + "#" + ".." + layout.LayeoutBackImage));
                layout.MoveNext();
            }

            if (uiRadioButtonListLayouts.Items.Count > 0)
                uiRadioButtonListLayouts.Items[0].Selected = true;

            CardColor colors = new CardColor();
            colors.GetCardColorsByCardID(CardID);
            uiRepeaterColors.DataSource = colors.DefaultView;
            uiRepeaterColors.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiRepeaterSizes.DataSource = dims.DefaultView;
            uiRepeaterSizes.DataBind();

            CardText texts = new CardText();
            texts.GetCardTxtByCardID(CardID);
            uiDataListCardText.DataSource = texts.DefaultView;
            uiDataListCardText.DataBind();

            CardImages images = new CardImages();
            images.GetCardImageByCardID(CardID);
            if (images.RowCount > 0)
            {
                uiDataListImages.DataSource = images.DefaultView;
                uiDataListImages.DataBind();
                uiPanelNoImages.Visible = false;
            }
            else
            {
                uiDataListImages.Visible = false;
                uiPanelNoImages.Visible = true;
            }

            Cards card = new Cards();
            card.LoadByPrimaryKey(CardID);

            Categories cat = new Categories();
            cat.LoadByPrimaryKey(card.CategoryID);

            MainCat mcat = new MainCat();
            mcat.LoadByPrimaryKey(cat.MainCatId);

            TopLevelCat tcat = new TopLevelCat();
            tcat.LoadByPrimaryKey(mcat.TopLevelCatID);

            uiImageMain.ImageUrl = "../" + card.GeneralPreviewPhoto;
            FullPath = tcat.NameEng + " > " + mcat.NameEng + " > " + cat.CatNameEng;
        }
Esempio n. 7
0
 private void BindCardColors()
 {
     CardColor colors = new CardColor();
     colors.GetCardColorsByCardID(CurrentCard.CardID);
     uiGridViewColors.DataSource = colors.DefaultView;
     uiGridViewColors.DataBind();
 }
Esempio n. 8
0
 protected void uiGridViewColors_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeleteColor")
     {
         try
         {
             CardColor objData = new CardColor();
             objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()), CurrentCard.CardID);
             objData.MarkAsDeleted();
             objData.Save();
             BindCardColors();
             ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-4\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-4\"]').addClass('active'); });", true);
         }
         catch (Exception ex)
         {
             return;
         }
     }
 }
Esempio n. 9
0
        protected void uiGridViewCards_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditCard")
            {
                Cards objData = new Cards();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));

                uiTextBoxCardNameEn.Text = objData.CardNameEng;
                uiTextBoxCardNameAr.Text = objData.CardNameAr;
                uiTextBoxDescEn.Text = objData.DescriptionEng;
                uiTextBoxDescAr.Text = objData.DescriptionAr;
                if (!objData.IsColumnNull("DefaultFont"))
                {
                    uiDropDownListFonts.SelectedValue = objData.DefaultFont;
                }

                if (!objData.IsColumnNull("DimensionID"))
                    uiDropDownListDim.SelectedValue = objData.DimensionID.ToString();

                uiTextBoxPriceAfter.Text = objData.PriceNow.ToString();
                uiTextBoxPriceBefore.Text = objData.PriceBefore.ToString();

                uiPanelAllCards.Visible = false;
                uiPanelEdit.Visible = true;
                tabs.Visible = true;
                tabscontent.Visible = true;
                CurrentCard = objData;

                BindData();
                BindCardTxt();
                BindCardLayout();
                BindCardColors();
                BindCardImages();

                uiLabelCatName.Text = uiDropDownListCats.SelectedItem.Text;
                uiLabelCardName.Text = objData.CardNameEng;
            }
            else if (e.CommandName == "DeleteCard")
            {
                try
                {
                    int id = Convert.ToInt32(e.CommandArgument.ToString());

                    CardImages images = new CardImages();
                    images.GetCardImageByCardID(id);
                    int irows = images.RowCount;
                    for (int i = 0; i < irows; i++)
                    {
                        images.MarkAsDeleted();
                        images.MoveNext();
                    }
                    images.Save();

                    CardLayouts layouts = new CardLayouts();
                    layouts.GetCardLayoutByCardID(id);
                    int lrows = layouts.RowCount;
                    for (int i = 0; i < lrows; i++)
                    {
                        layouts.MarkAsDeleted();
                        layouts.MoveNext();
                    }

                    layouts.Save();

                    CardText texts = new CardText();
                    texts.GetCardTxtByCardID(id);
                    int trows = texts.RowCount;
                    for (int i = 0; i < trows; i++)
                    {
                        texts.MarkAsDeleted();
                        texts.MoveNext();
                    }

                    texts.Save();

                    CardColor colors = new CardColor();
                    colors.GetCardColorsByCardID(id);
                    int crows = colors.RowCount;
                    for (int i = 0; i < crows; i++)
                    {
                        colors.MarkAsDeleted();
                        colors.MoveNext();
                    }

                    colors.Save();

                    Cards objData = new Cards();
                    objData.LoadByPrimaryKey(id);
                    objData.MarkAsDeleted();
                    objData.Save();
                    CurrentCard = null;
                    BindData();
                }
                catch (Exception ex)
                {
                    return;
                }
            }
        }