示例#1
0
        /// <summary>
        /// 新闻详细
        /// </summary>
        /// <param name="n_id"></param>
        /// <returns></returns>
        public ActionResult NewDetil(int id = 0)
        {
            string UserRegister = ConfigurationManager.AppSettings["UserRegister"];
            string Userpassword = ConfigurationManager.AppSettings["Userpassword"];

            ViewBag.UserRegister = UserRegister;
            ViewBag.Userpassword = Userpassword;
            JMP.MDL.newsrelease        model = new JMP.MDL.newsrelease();
            JMP.BLL.newsrelease        bll   = new JMP.BLL.newsrelease();
            List <JMP.MDL.newsrelease> list  = new List <JMP.MDL.newsrelease>();

            if (id > 0)
            {
                model = bll.SelectId(id);
                if (model != null)
                {
                    bll.UpdateCount(id);
                    list = bll.SelectUpDw(id, model.n_category);
                }
            }
            ViewBag.id        = id;
            ViewBag.list      = list;
            ViewBag.UploadUrl = ConfigurationManager.AppSettings["imgurl"];
            ViewBag.model     = model == null ? new JMP.MDL.newsrelease() : model;
            return(View());
        }
示例#2
0
        /// <summary>
        /// 添加/修改新闻
        /// </summary>
        /// <returns></returns>
        public ActionResult NewsReleaseAdd()
        {
            int c_id = string.IsNullOrEmpty(Request["c_id"]) ? 0 : Int32.Parse(Request["c_id"]);

            JMP.BLL.newsrelease bll   = new JMP.BLL.newsrelease();
            JMP.MDL.newsrelease model = new JMP.MDL.newsrelease();
            if (c_id > 0)
            {
                model = bll.SelectId(c_id);
            }
            ViewBag.model     = model == null ? new JMP.MDL.newsrelease() : model;
            ViewBag.UploadUrl = ConfigurationManager.AppSettings["imgurl"];
            return(View());
        }