Пример #1
0
        // 關於我們 - 法律依據
        public ActionResult Law(string cate_id = "", string id = "")
        {
            //抓取資料
            string    scate_id = "4,5,6,10,11,16,17,18,19";
            DataTable dt;
            DataTable d_cate;
            DataTable dt1;
            DataTable d_detail;
            DataTable d_log;
            string    err_msg = "";


            //======語系取得========
            string lang_id = GetLang();

            //======================

            d_cate = CAboutUs.Cate_List(ref err_msg, scate_id, "sort", "Y", "", lang_id);
            if (d_cate.Rows.Count > 0)
            {
                if (cate_id == "")
                {
                    cate_id = "4";
                }
            }

            dt1 = CAboutUs.List(ref err_msg, "", "sort desc", "Y", "", cate_id, lang_id);
            dt  = dt1.Copy();

            if (dt1.Rows.Count > 0)
            {
                if (id == "")
                {
                    id = dt1.Rows[0]["id"].ToString();
                }
            }

            dt1      = CAboutUs.List(ref err_msg, id, "sort desc", "Y", "", cate_id, lang_id);
            d_detail = dt1.Copy();


            ViewData["d_cate"]   = d_cate;
            ViewData["dt"]       = dt;
            ViewData["d_detail"] = d_detail;
            ViewData["id"]       = id;
            ViewData["cate_id"]  = cate_id;
            //=瀏覽記錄====================
            DB.Log_Insert(id, "AboutUs");
            d_log = DB.Log_List(ref err_msg, id, "AboutUs");
            ViewData["log_count"] = d_log.Rows.Count.ToString();
            //============================
            return(View());
        }