Exemplo n.º 1
0
        public ActionResult Edit([Bind(Include = "Id,Name,Description,Date,CreateUser,CompanyId,PersionId")] Task task)
        {
            if (ModelState.IsValid)
            {
                noteService.CreateNote(db, CrudOperation.Update, UserManager.FindById(User.Identity.GetUserId()), null, null, task);

                db.Entry(task).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(task));
        }
Exemplo n.º 2
0
        public ActionResult Edit([Bind(Include = "Id,Name,Zip,City,Country,CreateUser")] Company company)
        {
            if (ModelState.IsValid)
            {
                noteService.CreateNote(db, CrudOperation.Update, UserManager.FindById(User.Identity.GetUserId()), null, company);

                company.CreateUser = User.Identity.GetUserId();

                db.Entry(company).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(company));
        }
Exemplo n.º 3
0
        public ActionResult Edit([Bind(Include = "Id,Forename,Surname,Email,Phone,CompanyId")] Person person)
        {
            if (ModelState.IsValid)
            {
                noteService.CreateNote(db, CrudOperation.Update, UserManager.FindById(User.Identity.GetUserId()), person, null, null);

                db.Entry(person).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            var companyList = GetCompanySelectList();

            ViewBag.CompanyList = companyList;

            return(View(person));
        }
Exemplo n.º 4
0
        public ActionResult Edit([Bind(Include = "Id,Name,Description,CreateUser,CreateDate,CompanyId,PersonId,TaskId")] Note note)
        {
            if (ModelState.IsValid)
            {
                db.Entry(note).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            var companyList = GetCompanySelectList();

            ViewBag.CompanyList = companyList;
            var personList = GetPersonSelectList();

            ViewBag.PersonList = personList;

            return(View(note));
        }