コード例 #1
0
        private void Add()
        {
            NewsInfo model = new NewsInfo();

            model.ID         = int.Parse(Request.Form["ID"]);
            model.CategoryID = int.Parse(Request.Form["CategoryID"]);
            model.Title      = Request.Form["Title"];
            if (Request.Form["Release_time"].Trim() == "")
            {
                model.Release_time = DateTime.Now;
            }
            else
            {
                model.Release_time = Convert.ToDateTime(Request.Form["Release_time"]);
            }
            model.Release_people = Request.Form["Release_people"];
            model.Click          = int.Parse(Request.Form["Click"]);
            model.IsHost         = Convert.ToBoolean(Request.Form["IsHost"]);
            model.State          = Convert.ToBoolean(Request.Form["State"]);

            //大文本处理

            int id = dao.Add(model);

            /////////////////////

            NewsDao.AddGive(id);

            Log.WritePage(id > 0 ? "SUCCESS" : "Error");
        }