Пример #1
0
        public ActionResult NewsReleaseList()
        {
            int    pageCount  = 0;
            int    pageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页
            int    PageSize   = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);    //每页显示数量
            int    searchDesc = string.IsNullOrEmpty(Request["searchDesc"]) ? 0 : Int32.Parse(Request["searchDesc"]); //排序方式
            string category   = string.IsNullOrEmpty(Request["category"]) ? "" : Request["category"];                 //审核状态
            int    type       = string.IsNullOrEmpty(Request["type"]) ? 0 : Int32.Parse(Request["type"]);             //查询条件选择
            //string stime = string.IsNullOrEmpty(Request["r_begin"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["r_begin"];
            //string etime = string.IsNullOrEmpty(Request["r_end"]) ? DateTime.Now.ToString("yyyy-MM-dd") : Request["r_end"];
            string sea_name = string.IsNullOrEmpty(Request["sea_name"]) ? "" : Request["sea_name"];//查询条件内容
            List <JMP.MDL.newsrelease> list = new List <JMP.MDL.newsrelease>();

            JMP.BLL.newsrelease bll = new JMP.BLL.newsrelease();
            list = bll.SelectList(category, sea_name, type, searchDesc, pageIndexs, PageSize, out pageCount);
            ViewBag.searchDesc = searchDesc;
            ViewBag.type       = type;
            ViewBag.sea_name   = sea_name;

            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;
            ViewBag.category   = category;
            ViewBag.locUrl     = GetVoidHtml();
            return(View());
        }
Пример #2
0
        public ActionResult Zixun()
        {
            string UserRegister = ConfigurationManager.AppSettings["UserRegister"];
            string Userpassword = ConfigurationManager.AppSettings["Userpassword"];

            ViewBag.UserRegister = UserRegister;
            ViewBag.Userpassword = Userpassword;
            #region 公司新闻
            int pageCount  = 0;
            int count      = string.IsNullOrEmpty(Request["count"]) ? 0 : Int32.Parse(Request["count"]);           //标示
            int pageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页
            int PageSize   = 5;                                                                                    //每页显示数量
            List <JMP.MDL.newsrelease> gslist = new List <JMP.MDL.newsrelease>();
            JMP.BLL.newsrelease        bll    = new JMP.BLL.newsrelease();
            gslist             = bll.GetListsByType(1, pageIndexs, PageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = gslist;
            ViewBag.count      = count;
            #endregion

            ViewBag.UploadUrl = ConfigurationManager.AppSettings["imgurl"];
            return(View());
        }
Пример #3
0
        /// <summary>
        /// 新闻中心
        /// </summary>
        /// <returns></returns>
        public ActionResult News()
        {
            string UserRegister = ConfigurationManager.AppSettings["UserRegister"];
            string Userpassword = ConfigurationManager.AppSettings["Userpassword"];

            ViewBag.UserRegister = UserRegister;
            ViewBag.Userpassword = Userpassword;

            #region 行业新闻
            int hypageCount  = 0;
            int hycount      = string.IsNullOrEmpty(Request["count"]) ? 0 : Int32.Parse(Request["count"]);           //标示
            int hypageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页
            int hyPageSize   = 5;                                                                                    //每页显示数量
            List <JMP.MDL.newsrelease> hylist = new List <JMP.MDL.newsrelease>();
            JMP.BLL.newsrelease        hybll  = new JMP.BLL.newsrelease();
            hylist = hybll.GetListsByType(2, hypageIndexs, hyPageSize, out hypageCount);
            ViewBag.hypageIndexs = hypageIndexs;
            ViewBag.hyPageSize   = hyPageSize;
            ViewBag.hypageCount  = hypageCount;
            ViewBag.hylist       = hylist;
            ViewBag.hycount      = hycount;
            #endregion
            ViewBag.UploadUrl = ConfigurationManager.AppSettings["imgurl"];
            return(View());
        }
Пример #4
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());
        }
Пример #5
0
        public JsonResult InsertUpdateNewsRelease(JMP.MDL.newsrelease model)
        {
            object retJson = new { success = 0, msg = "操作失败" };

            JMP.BLL.newsrelease bll = new JMP.BLL.newsrelease();
            //string xgzfc = "";
            if (model.n_id > 0)
            {
                // 修改新闻管理
                JMP.MDL.newsrelease modComplaint = new JMP.MDL.newsrelease();
                modComplaint = bll.GetModel(model.n_id);
                var modComplaintClone = modComplaint.Clone();
                modComplaint.n_title     = model.n_title;
                modComplaint.n_info      = model.n_info;
                modComplaint.n_picture   = model.n_picture;
                modComplaint.n_category  = model.n_category;
                modComplaint.keywords    = model.keywords;
                modComplaint.description = model.description;
                //model.n_count = modComplaint.n_count;
                //model.n_time = modComplaint.n_time;
                //model.n_user = modComplaint.n_user;

                if (bll.Update(modComplaint))
                {
                    Logger.ModifyLog("修改新闻信息", modComplaintClone, model);
                    retJson = new { success = 1, msg = "修改成功" };
                }
                else
                {
                    retJson = new { success = 0, msg = "修改失败" };
                }
            }
            else
            {
                model.n_time  = DateTime.Now;
                model.n_user  = UserInfo.UserName;
                model.n_count = 0;
                int cg = bll.Add(model);
                if (cg > 0)
                {
                    Logger.CreateLog("添加新闻", model);
                    retJson = new { success = 1, msg = "添加成功" };
                }
                else
                {
                    retJson = new { success = 1, msg = "添加失败" };
                }
            }
            return(Json(retJson));
        }
Пример #6
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());
        }
Пример #7
0
        // GET: Index
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            string UserRegister = ConfigurationManager.AppSettings["UserRegister"];
            string Userpassword = ConfigurationManager.AppSettings["Userpassword"];

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

            JMP.BLL.newsrelease bll = new JMP.BLL.newsrelease();
            list         = bll.SelectListxw();
            ViewBag.list = list;
            return(View());
        }