Esempio n. 1
0
 public ActionResult Add(string N_id)
 {
     if (!string.IsNullOrWhiteSpace(N_id))
     {
         return(View(DALTuhuNews.SelectNewsbyID(new SqlConnection(strConn), Convert.ToInt32(N_id))));
     }
     else
     {
         return(View(new tbl_TuhuNews()
         {
             IssueTime = DateTime.Now
         }));
     }
 }
Esempio n. 2
0
        public ActionResult Add(tbl_TuhuNews tn)
        {
            var    userName = HttpContext.User.Identity.Name;
            string strGUID  = System.Guid.NewGuid().ToString();

            tn.NewsGuid = new Guid(strGUID);
            int          result   = (int)DALTuhuNews.InsertTuhuNews(new SqlConnection(strConn), tn);
            tbl_TuhuNews Tuhunews = DALTuhuNews.SelectNewsbyID(new SqlConnection(strConn));

            if (result > 0)
            {
                var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                {
                    ObjectID   = result,
                    ObjectType = "TuhuNews",
                    Author     = userName,
                    Operation  = "添加途虎新闻"
                };
                new Tuhu.Provisioning.Business.OprLogManagement.OprLogManager().AddOprLog(oprLog);
            }
            return(Json(result));
        }