Beispiel #1
0
 public ActionResult Create([Bind(Include = "ID,COMPLETED,DATCOMPLETED,TITLE,STARTDATE,DESCRIPTION")] PROJECT pROJECT)
 {
     if (ModelState.IsValid)
     {
         db.PROJECTs.Add(pROJECT);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pROJECT));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,disabled,FirstName,LastName,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName,Discriminator")] AspNetUser aspNetUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetUser));
 }
Beispiel #3
0
        public ActionResult AddSpecialty(SPECIALTY model)
        {
            var specialty = new SPECIALTY
            {
                expertID    = User.Identity.GetUserId(),
                NAME        = model.NAME,
                DESCRIPTION = model.DESCRIPTION
            };

            if (ModelState.IsValid)
            {
                _dbContext.SPECIALTies.Add(specialty);
                _dbContext.SaveChanges();
                return(RedirectToAction("Index", "Manage"));
            }
            _dbContext.SPECIALTies.Add(specialty);
            _dbContext.SaveChanges();

            return(RedirectToAction("ViewSpecialties", "Manage"));
        }
Beispiel #4
0
        public ActionResult Create([Bind(Include = "RecieverID,TEXT")] Message message)
        {
            var mes = new Message
            {
                SenderID     = User.Identity.GetUserId(),
                RecieverID   = message.RecieverID,
                DATETIMEMADE = DateTime.Now,
                TEXT         = message.TEXT
            };

            if (ModelState.IsValid)
            {
                db.Messages.Add(mes);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.RecieverID = new SelectList(db.AspNetUsers, "Id", "Email", message.RecieverID);
            ViewBag.SenderID   = new SelectList(User.Identity.GetUserName(), "Id", "Email", message.SenderID);
            return(View(message));
        }
Beispiel #5
0
        public ActionResult Create([Bind(Include = "ID,REPLIED_TO_POST_ID,USERID,SUBJECT,TITLE,DATETIMEPOSTED")] POST pOST)
        {
            if (ModelState.IsValid)
            {
                var Forms = new POST
                {
                    // AspNetUser= User.Identity.Name,
                    USERID = User.Identity.GetUserId(),
                    //USERID= User.Identity.GetUserName,
                    DATETIMEPOSTED = System.DateTime.Now,
                    SUBJECT        = pOST.SUBJECT,
                    TITLE          = pOST.TITLE,
                };
                db.POSTs.Add(Forms);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            //ViewBag.USERID = new SelectList(db.AspNetUsers, "Id", "FirstName", pOST.USERID);
            //ViewBag.REPLIED_TO_POST_ID = new SelectList(db.POSTs, "ID", "USERID", pOST.REPLIED_TO_POST_ID);
            return(View(pOST));
        }