コード例 #1
0
        public ActionResult Create([Bind(Include = "AId,AccessName")] TB_UserAccess tB_UserAccess)
        {
            if (ModelState.IsValid)
            {
                db.TB_UserAccess.Add(tB_UserAccess);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tB_UserAccess));
        }
コード例 #2
0
        public ActionResult SetPwd(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var lg = db.TB_LoginOn.FirstOrDefault(t => t.LId == id);

            lg.LoginPwd = md5.MD5Encrypt("123456");
            db.SaveChanges();
            return(Content("<script>alert('密码重置成功!');history.go(-1);</script>"));
        }
コード例 #3
0
        public ActionResult Create([Bind(Include = "MId,MenuName,AId")] TB_ShowMenu tB_ShowMenu)
        {
            if (ModelState.IsValid)
            {
                db.TB_ShowMenu.Add(tB_ShowMenu);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AId = new SelectList(db.TB_UserAccess, "AId", "AccessName", tB_ShowMenu.AId);
            return(View(tB_ShowMenu));
        }
コード例 #4
0
        public ActionResult Create([Bind(Include = "UId,UserFace,LId")] TB_UserFace tB_UserFace)
        {
            if (ModelState.IsValid)
            {
                db.TB_UserFace.Add(tB_UserFace);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.LId = new SelectList(db.TB_LoginOn, "LId", "LoginNo", tB_UserFace.LId);
            return(View(tB_UserFace));
        }
コード例 #5
0
        public ActionResult Create([Bind(Include = "FId,Schedule,FollowDate,LId,BId,DId")] TB_Follow Follow)
        {
            if (ModelState.IsValid)
            {
                db.TB_Follow.Add(Follow);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.BId = new SelectList(db.TB_BugSubmit, "BId", "AppName", Follow.BId);
            ViewBag.LId = new SelectList(db.TB_LoginOn, "LId", "LoginName", Follow.LId);
            ViewBag.LId = new SelectList(db.TB_LoginOn, "DId", "DLevel", Follow.LId);
            return(View(Follow));
        }
コード例 #6
0
ファイル: FollowController.cs プロジェクト: TeTanT/SubmitBug
        public ActionResult Details()
        {
            var Dt = Request.Params["FollowDate"];

            if (Dt == null)
            {
                Dt = DateTime.Now.ToShortDateString();
            }
            TB_Schedule tb_Follow = new TB_Schedule
            {
                BId        = Convert.ToInt32(Request.Params["BId"]),
                FId        = Convert.ToInt32(Request.Params["FId"]),
                FinishDate = Convert.ToDateTime(Dt)
            };

            db.TB_Schedule.Add(tb_Follow);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #7
0
        public ActionResult Update(int id)
        {
            TB_Schedule tb = db.TB_Schedule.Find(id);

            if (tb != null)
            {
                int          bid = tb.BId;
                TB_BugSubmit YN  = db.TB_BugSubmit.Where(t => t.BId == bid).FirstOrDefault();
                YN.YN = "Y";
                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
コード例 #8
0
        public ActionResult SetPwd(TB_LoginOn login)
        {
            using (SubBugEntities db = new SubBugEntities())
            {
                var        lid = ((TB_LoginOn)Session["LoginName"]).LId;
                TB_LoginOn lg  = db.TB_LoginOn.Where(t => t.LId == lid).FirstOrDefault();
                lg.LoginPwd = md5.MD5Encrypt(login.LoginPwd);
                db.SaveChanges();
                Session.Clear();

                return(Content("<script>alert('密码修改成功!');window.location.href='Login';</script>"));
            }
        }
コード例 #9
0
 public ActionResult Edit([Bind(Include = "LId,LoginNo,LoginName,LoginPwd,LPhone,ComputerNo")] TB_LoginOn loginOn)
 {
     if (ModelState.IsValid)
     {
         using (SubBugEntities db = new SubBugEntities())
         {
             db.Entry(loginOn).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     return(View(loginOn));
 }