Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.28 KB | None | 0 0
  1. @model PizzariaOvenzinho.Models.Produto
  2.  
  3. @{
  4.     ViewBag.Title = "Create";
  5.     Layout = "~/Views/Shared/TemplateAdmin.cshtml";
  6. }
  7.  
  8. <h2 style="color:#fff;text-align:center;font-size:50px;font-family:Brush Script Std, Brush Script MT, cursive;">Cadastrar</h2>
  9. @using (Html.BeginForm("Create", "Produtos", new {id = ViewContext.RouteData.Values["id"] }, FormMethod.Post,
  10.                                                                 new { enctype = "multipart/form-data" }))
  11. {
  12.     @Html.AntiForgeryToken()
  13.  
  14.     <div class="form-horizontal">
  15.         <h4 style="color:#fff;font-size:50px;text-align:center;font-family:Brush Script Std, Brush Script MT, cursive;">Produto</h4>
  16.         <hr />
  17.         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  18.         <div class="form-group">
  19.             @Html.LabelFor(model => model.Nome, htmlAttributes: new { @class = "control-label col-md-2", @style = "color:#fff;" })
  20.             <div class="col-md-10">
  21.                 @Html.EditorFor(model => model.Nome, new { htmlAttributes = new { @class = "form-control", @style = "width:300px;" } })
  22.                 @Html.ValidationMessageFor(model => model.Nome, "", new { @class = "text-danger" })
  23.             </div>
  24.         </div>
  25.  
  26.         <div class="form-group">
  27.             @Html.LabelFor(model => model.Descricao, htmlAttributes: new { @class = "control-label col-md-2", @style = "color:#fff;" })
  28.             <div class="col-md-10">
  29.                 @Html.EditorFor(model => model.Descricao, new { htmlAttributes = new { @class = "form-control", @style = "width:300px;" } })
  30.                 @Html.ValidationMessageFor(model => model.Descricao, "", new { @class = "text-danger" })
  31.             </div>
  32.         </div>
  33.  
  34.         <div class="form-group">
  35.             @Html.LabelFor(model => model.Valor, htmlAttributes: new { @class = "control-label col-md-2", @style = "color:#fff;" })
  36.             <div class="col-md-10">
  37.                 @Html.EditorFor(model => model.Valor, new { htmlAttributes = new { @class = "form-control", @style = "width:300px;" } })
  38.                 @Html.ValidationMessageFor(model => model.Valor, "", new { @class = "text-danger" })
  39.             </div>
  40.         </div>
  41.  
  42.         <div class="form-group">
  43.             @Html.LabelFor(model => model.CategoriaId, "CategoriaId", htmlAttributes: new { @class = "control-label col-md-2", @style = "color:#fff;" })
  44.             <div class="col-md-10">
  45.                 @Html.DropDownList("CategoriaId", null, htmlAttributes: new { @class = "form-control", @style = "width:300px;" })
  46.                 @Html.ValidationMessageFor(model => model.CategoriaId, "", new { @class = "text-danger" })
  47.             </div>
  48.         </div>
  49.  
  50.         <div style="background-color:#fff;width:400px;">
  51.             <label for="file">Upload de Imagem:</label>
  52.             <input type="file" name="file" id="file" style="width: 100%;" />
  53.             <input type="submit" value="Upload" class="btn btn-primary" />
  54.         </div>
  55.  
  56.         <div class="form-group">
  57.             <div class="col-md-offset-2 col-md-10">
  58.                 <input type="submit" value="Cadastrar" class="btn btn-default" />
  59.             </div>
  60.         </div>
  61.     </div>
  62. }
  63.  
  64. <div>
  65.     @Html.ActionLink("Voltar a lista", "Index", "Produtos", null, new { @class = "btn btn-default" })
  66. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement