Esempio n. 1
0
        public async Task <ActionResult> Create(LabsCreateViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            try
            {
                await LabsDao.Create(this, model);
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.ToString());
                return(View(model));
            }

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public async Task <IHttpActionResult> Create(LabsCreateViewModel model)
 {
     return(JsonWithPermissions(await LabsDao.Create(this, model), true, true, User.IsAdmin()));
 }