Beispiel #1
0
 public ActionResult Create(Projects projects)
 {
     if (ModelState.IsValid)
     {
         if ((new ProjectWorker(new AustContext())).AddProject(projects))
             return RedirectToAction("Index");
         else
             return HttpNotFound();
     }
     return View(projects);
 }
Beispiel #2
0
        public Boolean UpdateProject(Projects project)
        {
            Boolean rv = false;

            try
            {
                db.Entry(project).State = EntityState.Modified;
                db.SaveChanges();
                rv = true;
            }
            catch (Exception ex)
            {
                throw new AustException(ErrorMessages.ErrorUpdatingProject, ex);
            }

            return rv;
        }
Beispiel #3
0
        public Boolean AddProject(Projects projects)
        {
            Boolean rv = false;

            try
            {
                db.Projects.Add(projects);
                db.SaveChanges();
                rv = true;
            }
            catch (Exception ex)
            {
                throw new AustException(ErrorMessages.ErrorAddingProject, ex);
            }

            return rv;
        }