protected void uiGridViewCats_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditCat") { MainCat objData = new MainCat(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxEnName.Text = objData.NameEng; uiTextBoxArName.Text = objData.NameAr; uiPanelAllCats.Visible = false; uiPanelEditCat.Visible = true; CurrentMainCat = objData; BindCats(); } else if (e.CommandName == "DeleteCat") { try { MainCat objData = new MainCat(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); CurrentMainCat = null; BindCats(); } catch (Exception ex) { uipanelError.Visible = true; } } }
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"); } } }
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 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; } } }
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; }