예제 #1
0
        public ActionResult Create(TariffModel model)
        {
            IUser currentUser = Authorization.GetAuthroizedUser();
            if ( currentUser == null )
                return Redirect( "/" );

            if ( currentUser.IsSuperuser() )
            {
                try
                {
                    if ( ModelState.IsValid )
                    {
                        model.Insert( model );

                        return RedirectToAction( "Index" );
                    }
                }
                catch
                {
                    return View( model );
                }
            }

            return View( model );
        }