Example #1
0
        private void Control_Init()
        {
            if (DataEval.IsEmptyQuery(_itemdetailid))
            {
                MultiView_ItemDetail.SetActiveView(View_New);
            }
            else
            {
                MultiView_ItemDetail.SetActiveView(View_Detail);

                if (Request.QueryString["PageLink"] == "Disable")
                {
                    hlink_Edit_Item.Enabled = false;
                }

                Lib.Photo myPhoto;

                // Init Comment Form
                if (!DataEval.IsEmptyQuery(Request["NexusPhotoID"]))
                {
                    Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr();

                    myPhoto = myPhotoMgr.Get_Photo(Request["NexusPhotoID"], _displayid);

                    if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page))
                    {
                        hlink_Edit_Item.Visible = true;

                        hlink_Edit_Item.Attributes["href"]    = "#";
                        hlink_Edit_Item.Attributes["onclick"] = string.Format(
                            "return Show_ControlManager('/App_AdminCP/SiteAdmin/PoP_ControlPanel.aspx?ControlID={0}&NexusPhotoID={1}');",
                            "43D902AF-A0DC-4036-BC46-C98EC84B6698",
                            myPhoto.PhotoID);
                    }
                    else
                    {
                        hlink_Edit_Item.Visible = false;
                    }

                    // Page Title
                    if (_ispagetitle)
                    {
                        Page.Title = myPhoto.Photo_Title;
                    }


                    Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates();

                    switch (_itemtemplate)
                    {
                    case "Default":
                        myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemDetail_Default.ascx";
                        break;

                    case "Custom":
                        myItemTemplate.ItemTemplatePath = _itemtemplateurl;
                        break;

                    default:
                        myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemDetail_Default.ascx";
                        break;
                    }

                    FormView_ItemDetail.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath);

                    List <Lib.Photo> myPhotos = new List <Lib.Photo>();
                    myPhotos.Add(myPhoto);

                    try
                    {
                        FormView_ItemDetail.DataSource   = myPhotos;
                        FormView_ItemDetail.DataKeyNames = new string[] { "PhotoID" };
                        FormView_ItemDetail.DataBind();
                    }
                    catch
                    {
                        // Load Template Failed
                    }
                }
                else
                {
                    // No Post ID
                    hlink_Edit_Item.Visible = false;
                }
            }
        }
        private void Control_Init()
        {
            if (DataEval.IsEmptyQuery(_ebay_itemdetailid))
            {
                MultiView_ItemDetail.SetActiveView(View_New);
            }
            else
            {
                MultiView_ItemDetail.SetActiveView(View_Detail);

                if (Request.QueryString["PageLink"] == "Disable")
                {
                    hlink_Edit_Item.Enabled = false;
                }

                Lib.Ebay_Item myEbay_Item;

                // Init Comment Form
                if (!DataEval.IsEmptyQuery(Request["NexusEbayItemID"]))
                {
                    Lib.EbayMgr myEbayMgr = new Lib.EbayMgr();

                    myEbay_Item = myEbayMgr.Get_Ebay_Item(Request["NexusEbayItemID"]);

                    if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page))
                    {
                        hlink_Edit_Item.Visible = true;

                        hlink_Edit_Item.Attributes["href"]    = "#";
                        hlink_Edit_Item.Attributes["onclick"] = string.Format("return Show_ControlManager('/App_AdminCP/SiteAdmin/PoP_ControlPanel.aspx?ControlID={0}&NexusEbayItemID={1}');", "8BF5ABB9-30D5-429E-8017-A168672AC15F", myEbay_Item.Ebay_ItemID);
                    }
                    else
                    {
                        hlink_Edit_Item.Visible = false;
                    }

                    // Page Title
                    if (_ispagetitle)
                    {
                        Page.Title = myEbay_Item.Ebay_Title;
                    }

                    // Init Form View
                    if (DataEval.IsEmptyQuery(myEbay_Item.Item_PicutreURL))
                    {
                        myEbay_Item.Item_PicutreURL = "/App_Control_Style/Nexus_Ebay/Images/EbaySample.png";
                    }

                    // Fillup Post Content
                    //lbl_Price.Text = myEbay_Item.Currency_Web + myEbay_Item.CurrentPrice.ToString();
                    //lbl_Title.Text = myEbay_Item.Ebay_Title;
                    //lbl_SubTitle.Text = myEbay_Item.Ebay_SubTitle;
                    //lbl_QuantityAvailable.Text = myEbay_Item.QuantityAvailable.ToString();
                    //lbl_QuantitySold.Text = myEbay_Item.QuantitySold.ToString();
                    //lbl_TotalView_Count.Text = myEbay_Item.Total_View_Count.ToString();

                    //string[] ItemPicutreURLs = myEbay_Item.Ebay_Picture.Split(new string[] { "||" }, StringSplitOptions.None);

                    //if (DataEval.IsEmptyQuery(ItemPicutreURLs[0]))
                    //    Img_Product.ImageUrl = "/App_Control_Style/Nexus_Ebay/Images/EbaySample.png";
                    //else
                    //    Img_Product.ImageUrl = ItemPicutreURLs[0];

                    //hlink_ViewItemURL.NavigateUrl = myEbay_Item.ViewItemURL;

                    //Literal_Item_Description.Text = myEbay_Item.Item_Description;
                    //Literal_Ebay_Description.Text = myEbay_Item.Ebay_Description;
                }
                else
                {
                    // No Post ID
                    myEbay_Item = new Lib.Ebay_Item();

                    hlink_Edit_Item.Visible     = false;
                    myEbay_Item.Item_PicutreURL = "/App_Control_Style/Nexus_Ebay/Images/EbaySample.png";
                }

                Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates();

                switch (_itemtemplate)
                {
                case "Default":
                    myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemDetail_Default.ascx";
                    break;

                case "Custom":
                    myItemTemplate.ItemTemplatePath = _itemtemplateurl;
                    break;

                default:
                    myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemDetail_Default.ascx";
                    break;
                }

                FormView_ItemDetail.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath);

                List <Lib.Ebay_Item> myEbay_Items = new List <Lib.Ebay_Item>();
                myEbay_Items.Add(myEbay_Item);

                try
                {
                    FormView_ItemDetail.DataSource   = myEbay_Items;
                    FormView_ItemDetail.DataKeyNames = new string[] { "Ebay_ItemID" };
                    FormView_ItemDetail.DataBind();
                }
                catch
                {
                    // Load Template Failed
                }
            }
        }