protected void uiGridViewCats_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditCat")
            {
                TopLevelCat objData = new TopLevelCat();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));

                uiTextBoxEnName.Text = objData.NameEng;
                uiTextBoxArName.Text = objData.NameAr;

                uiPanelAllCats.Visible = false;
                uiPanelEditCat.Visible = true;
                CurrentTopCat = objData;

                BindCats();
            }
            else if (e.CommandName == "DeleteCat")
            {
                try
                {
                    TopLevelCat objData = new TopLevelCat();
                    objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                    objData.MarkAsDeleted();
                    objData.Save();
                    CurrentTopCat = null;
                    BindCats();
                }
                catch (Exception ex)
                {
                    uipanelError.Visible = true;
                }
            }
        }
Example #2
0
        private void LoadTopCats()
        {
            string menu = "";
            TopLevelCat cats = new TopLevelCat();
            cats.LoadAll();
            for (int i = 0; i < cats.RowCount; i++)
            {
                menu += "<li><a href='browsec.aspx?tcid=" + cats.TopLevelCatID.ToString() + (cats.IsPartySupplier ? "&ps=true" : "") +"'>" + cats.NameEng + "</a> ";
                menu += LoadMainCats(cats.TopLevelCatID);
                menu += "</li>";
                cats.MoveNext();
            }

            uiLiteralmenu.Text = menu;
        }
Example #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");
                }
            }
        }
 private void LoadDDLs()
 {
     TopLevelCat cats = new TopLevelCat();
     cats.Where.IsPartySupplier.Value = true;
     cats.Where.IsPartySupplier.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
     cats.Sort = "NameEng";
     cats.Query.Load();
     uiDropDownListTLCats.DataSource = cats.DefaultView;
     uiDropDownListTLCats.DataTextField = "NameEng";
     uiDropDownListTLCats.DataValueField = "TopLevelcatID";
     uiDropDownListTLCats.DataBind();
 }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (IsPartySupplier)
                {
                    ucSearch1.Visible = false;
                }

                BindData();
                if (CatID != 0)
                {
                    Categories cat = new Categories();
                    cat.LoadByPrimaryKey(CatID);
                    Master.PageTitle = cat.CatNameAr;

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

                    TopLevelCat Tcat = new TopLevelCat();
                    Tcat.LoadByPrimaryKey(Mcat.TopLevelCatID);

                    Master.Path = "<li><a href='#'>" + Tcat.NameAr + "</a></li>" + "<li><a href='#'>" + Mcat.NameAr + "</a></li>";

                    Master.ViewPath = true;
                }
                else if (MainCatID != 0)
                {
                    MainCat cat = new MainCat();
                    cat.LoadByPrimaryKey(MainCatID);
                    Master.PageTitle = cat.NameAr;

                    TopLevelCat Tcat = new TopLevelCat();
                    Tcat.LoadByPrimaryKey(cat.TopLevelCatID);

                    Master.Path = "<li><a href='#'>" + Tcat.NameAr + "</a></li>";

                    Master.ViewPath = true;
                }
                else if (TopCatID != 0)
                {
                    TopLevelCat cat = new TopLevelCat();
                    cat.LoadByPrimaryKey(TopCatID);
                    Master.PageTitle = cat.NameAr;

                    Master.ViewPath = true;
                }

            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
                if (MainCatID != 0)
                {
                    MainCat cat = new MainCat();
                    cat.LoadByPrimaryKey(MainCatID);
                    Master.PageTitle = cat.NameAr;

                    TopLevelCat Tcat = new TopLevelCat();
                    Tcat.LoadByPrimaryKey(cat.TopLevelCatID);

                    Master.Path = "<li><a href='#'>" + Tcat.NameAr + "</a></li>";
                    Master.ViewPath = true;
                }
                else if (TopCatID != 0)
                {
                    TopLevelCat cat = new TopLevelCat();
                    cat.LoadByPrimaryKey(TopCatID);
                    Master.PageTitle = cat.NameAr;
                    Master.ViewPath = true;
                }
            }
        }
 protected void uiLinkButtonBack_Click(object sender, EventArgs e)
 {
     ClearFields();
     CurrentTopCat = null;
     uiPanelEditCat.Visible = false;
     uiPanelAllCats.Visible = true;
     BindCats();
 }
 private void BindCats()
 {
     TopLevelCat cats = new TopLevelCat();
     cats.Where.IsPartySupplier.Value = true;
     cats.Where.IsPartySupplier.Operator = MyGeneration.dOOdads.WhereParameter.Operand.NotEqual;
     cats.Sort = "NameEng";
     cats.Query.Load();
     uiGridViewCats.DataSource = cats.DefaultView;
     uiGridViewCats.DataBind();
 }
        protected void uiLinkButtonOK_Click(object sender, EventArgs e)
        {
            TopLevelCat cat = new TopLevelCat();
            if (CurrentTopCat == null)
            {
                cat.AddNew();
                cat.IsPartySupplier = false;
            }
            else
                cat = CurrentTopCat;

            cat.NameEng = uiTextBoxEnName.Text;
            cat.NameAr = uiTextBoxArName.Text;
            cat.IsPartySupplier = false;

            if (uiFileUploadImage.HasFile)
            {
                string filepath = "/images/Category/" + DateTime.Now.ToString("ddMMyyyyhhmmss") + "_" + uiFileUploadImage.FileName;
                uiFileUploadImage.SaveAs(Server.MapPath("~" + filepath));
                cat.ImagePath = filepath;
            }
            if (uiFileUploadHover.HasFile)
            {
                string filepath = "/images/Category/" + DateTime.Now.ToString("ddMMyyyyhhmmss") + "_" + uiFileUploadHover.FileName;
                uiFileUploadHover.SaveAs(Server.MapPath("~" + filepath));
                cat.HoverImage = filepath;
            }

            cat.Save();
            ClearFields();
            CurrentTopCat = null;
            uiPanelEditCat.Visible = false;
            uiPanelAllCats.Visible = true;
            BindCats();
        }
 private void LoadDDLs()
 {
     TopLevelCat Tcats = new TopLevelCat();
     Tcats.LoadAll();
     uiDropDownListTC.DataSource = Tcats.DefaultView;
     uiDropDownListTC.DataTextField = "NameEng";
     uiDropDownListTC.DataValueField = "TopLevelCatID";
     uiDropDownListTC.DataBind();
     LoadMainCat();
 }
Example #11
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;
        }
 private void BindCats()
 {
     TopLevelCat cats = new TopLevelCat();
     cats.LoadAll();
     cats.Sort = "NameEng";
     uiGridViewCats.DataSource = cats.DefaultView;
     uiGridViewCats.DataBind();
 }
Example #13
0
        private void LoadDDLs()
        {
            Color colors = new Color();
            colors.LoadAll();
            uiDropDownListColor.DataSource = colors.DefaultView;
            uiDropDownListColor.DataTextField = "ColorNameEng";
            uiDropDownListColor.DataValueField = "ColorID";
            uiDropDownListColor.DataBind();

            uiDropDownListBackColor.DataSource = colors.DefaultView;
            uiDropDownListBackColor.DataTextField = "ColorNameEng";
            uiDropDownListBackColor.DataValueField = "ColorID";
            uiDropDownListBackColor.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiDropDownListDim.DataSource = dims.DefaultView;
            uiDropDownListDim.DataTextField = "DisplayName";
            uiDropDownListDim.DataValueField = "DimensionID";
            uiDropDownListDim.DataBind();

            TopLevelCat Tcats = new TopLevelCat();
            Tcats.LoadAll();
            uiDropDownListTC.DataSource = Tcats.DefaultView;
            uiDropDownListTC.DataTextField = "NameEng";
            uiDropDownListTC.DataValueField = "TopLevelCatID";
            uiDropDownListTC.DataBind();
            LoadMainCat();
        }
Example #14
0
        private void LoadDDLs()
        {
            Color colors = new Color();
            colors.LoadAll();
            uiDropDownListColor.DataSource = colors.DefaultView;
            uiDropDownListColor.DataTextField = "ColorNameEng";
            uiDropDownListColor.DataValueField = "ColorID";
            uiDropDownListColor.DataBind();

            uiDropDownListBackColor.DataSource = colors.DefaultView;
            uiDropDownListBackColor.DataTextField = "ColorNameEng";
            uiDropDownListBackColor.DataValueField = "ColorID";
            uiDropDownListBackColor.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiDropDownListDim.DataSource = dims.DefaultView;
            uiDropDownListDim.DataTextField = "DisplayName";
            uiDropDownListDim.DataValueField = "DimensionID";
            uiDropDownListDim.DataBind();

            TopLevelCat Tcats = new TopLevelCat();
            Tcats.Where.IsPartySupplier.Value = true;
            Tcats.Where.IsPartySupplier.Operator = MyGeneration.dOOdads.WhereParameter.Operand.NotEqual;
            Tcats.Sort = "NameEng";
            Tcats.Query.Load();
            uiDropDownListTC.DataSource = Tcats.DefaultView;
            uiDropDownListTC.DataTextField = "NameEng";
            uiDropDownListTC.DataValueField = "TopLevelCatID";
            uiDropDownListTC.DataBind();
            LoadMainCat();
        }