Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        packageid = Request["packageid"];
        Route myRoute = RouteData.Route as Route;

        if (myRoute != null)
        {
            packageid = RouteData.Values["id"].ToString();
        }
        if (packageid == null || packageid == "")
        {
            Response.Write("<script>alert('資料有誤');</script>");
            Response.End();
        }
        List <productController.Package> gd = new List <productController.Package>();

        productController.Package pd = new productController.Package();
        pd.Packageid = int.Parse(packageid);
        gd           = productController.GetPackageList(pd);
        string pic = "";

        foreach (var g in gd)
        {
            if (g.Status != "Y")
            {
                Response.Write("<script>alert('此商品並無販售');history.back();</script>");
                Response.End();
            }
            productname          = g.Packagename;
            description          = g.Description;
            ship_price           = g.Shippingfee;
            shippingKind         = g.ShippingKind;
            DESCRIPTION          = g.Description;
            freeship             = g.Freeship;
            Repeater1.DataSource = g.PackageItem;
            Repeater1.DataBind();
            pic     = g.PackageItem[0].Pic;
            ReMark  = g.ReMark;
            Refunds = g.Refunds;
        }

        Session["title"]       = productname + "│" + Application["site_name"];
        Session["image"]       = Session["websiteurl"] + pic;
        Session["description"] = unity.classlib.noHTML(description);
        Session["keywords"]    = productname;


        s = Unitlib.Get_UnitData(37, "");
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    unitid   = 0;
        string pagename = "";
        Route  myRoute  = RouteData.Route as Route;

        if (myRoute != null)
        {
            unitid = RouteData.Values["id"] == null ? 0 :int.Parse(RouteData.Values["id"].ToString());

            pagename = RouteData.Values["pagename"] == null ? "1" : RouteData.Values["pagename"].ToString();
        }

        Unitlib.MainData MainData = new Unitlib.MainData();
        MainData         = Unitlib.Get_UnitData(unitid, pagename);
        contents         = MainData.Contents;
        unitname         = MainData.Subject;
        Session["title"] = unitname + "│" + Application["site_name"];
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Articleid = Request.QueryString["Articleid"];
        Route myRoute = RouteData.Route as Route;

        if (myRoute != null)
        {
            Articleid = RouteData.Values["Articleid"].ToString();
        }
        List <article.Lecturer> Lecturer = new List <article.Lecturer>();

        if (Articleid != null && Articleid != "0")
        {
            MainData = article.DbHandle.Get_article(int.Parse(Articleid));
        }
        else if (Session["MainData"] != null)
        {
            MainData = HttpContext.Current.Session["MainData"] as article.MainData;
        }
        if (MainData != null)
        {
            status           = MainData.Status;
            Session["title"] = MainData.Subject + "│" + Application["site_name"];
            pic = MainData.Pic;
            Session["image"] = Session["websiteurl"] + pic;
            pic = "<a href=\"" + pic + "\">" + "<img class=\"image-full modal-image size-full\" src=\"" + pic + "\" width=\"1350\" height=\"900\" /></a>";
            if (MainData.Lesson.Id > 0)
            {
                //lessondetail = MainData.Lesson.LessonDetail;
                //if ( DateTime.Compare(DateTime.Today, MainData.Lesson.EndDay) <= 0)
                // lessondetail = MainData.Lesson.LessonDetail.Find(x => x.Flag == "Y");

                Repeater2.DataSource = MainData.Lesson.LessonDetail.FindAll(x => x.Flag == "Y");
                Repeater2.DataBind();
                //}
                //else
                //{
                //    Repeater3.DataSource = MainData.Lesson.LessonDetail;
                //    Repeater3.DataBind();
                //}


                Lecturer             = article.DbHandle.Get_Lecturer_list(MainData.Lesson.Lecturer);
                Repeater1.DataSource = Lecturer;
                Repeater1.DataBind();
            }

            keywords  = article.Web.Get_Keyword_link(MainData.Keywords);
            viewcount = MainData.Viewcount.ToString();
            tags      = article.Web.Get_category_link(MainData.Id);
            Session["description"] = unity.classlib.noHTML(MainData.Contents);
            Session["keywords"]    = MainData.Keywords;
            article.DbHandle.Add_views(MainData.Id);
            List <article.Category> cate = new List <article.Category>();
            cate = (List <article.Category>)article.DbHandle.Get_article_category(MainData.Id);
            foreach (var a in cate)
            {
                List <Unitlib.MenuModel> subMenu = (List <Unitlib.MenuModel>)Session["webmenu"];
                var data = subMenu.SelectMany(x => x.Detial).FirstOrDefault(c => c.Id == a.CategoryId);
                if (data != null)
                {
                    var p = subMenu.Find(x => x.Id == data.ParentId);
                    if (p != null)
                    {
                        pageunit += "<li class=\"active\"><a href=\"/catalog/" + p.Id.ToString() + "\">" + p.Title.ToString() + "</a></li>";
                    }
                    pageunit += "<li class=\"active\"><a href=\"/catalog/" + data.Id.ToString() + "\">" + data.Title.ToString() + "</a></li>";
                }

                break;
            }
        }


        s = Unitlib.Get_UnitData(37, "");
    }