Beispiel #1
0
 public ActionResult Index([Bind(Include = "reply")] reply_infos reply_Infos)
 {
     if (ModelState.IsValid && reply_Infos.reply != null)
     {
         reply_Infos.theme_id    = Convert.ToInt32(Session["did"]);
         reply_Infos.ReplyAuthor = Session["uid"].ToString();
         reply_Infos.ReplyTime   = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
         db.reply_infos.Add(reply_Infos);
         db.SaveChanges();
         if (Session["uid"].ToString() == "FYZY" && reply_Infos.reply.Contains("已解决"))
         {
             var pm = from u in db.discuss_infos
                      where u.id == reply_Infos.theme_id
                      select u;
             discuss_infos di = new discuss_infos();
             foreach (var k in pm)
             {
                 di = (discuss_infos)k;
             }
             di.solve           = "已解决";
             db.Entry(di).State = EntityState.Modified;
             db.Entry(di).Property(u => u.id).IsModified = true;
             db.SaveChanges();
         }
         return(RedirectToAction("Index", "discuss_infos", "创建成功"));
     }
     return(RedirectToAction("Index", "discuss_infos", "创建失败"));
 }
 public ActionResult Edit([Bind(Include = "id,theme,AllContent,time,author")] discuss_infos discuss_infos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(discuss_infos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(discuss_infos));
 }
 public ActionResult Edit([Bind(Include = "ID,loginname,balance,status")] yicraft_infos yicraft_infos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(yicraft_infos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(yicraft_infos));
 }
 public ActionResult Edit([Bind(Include = "id,uid,pwd")] player_infos player_infos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(player_infos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(player_infos));
 }