Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            UserMSG userMSG = db.UserMSG.Find(id);

            db.UserMSG.Remove(userMSG);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "userid,password,zt,username,workcode,Email,phoneNumber,address,departmentid,company,login")] UserMSG userMSG)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userMSG).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userMSG));
 }
Beispiel #3
0
        // GET: UserMSGs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserMSG userMSG = db.UserMSG.Find(id);

            if (userMSG == null)
            {
                return(HttpNotFound());
            }
            return(View(userMSG));
        }
        public void AddUserMag()
        {
            UserMsgService userMsgService = new UserMsgService();

            UserMSG userMSG = new UserMSG()
            {
                address = "ads", username = "******", departmentid = "22", userid = 11
            };

            if (userMsgService.Add(userMSG))
            {
            }
            else
            {
                Assert.Fail();
            }
        }