Skip to content

Instantly share code, notes, and snippets.

View jesulink2514's full-sized avatar
🎯
Focusing

Jesus Angulo jesulink2514

🎯
Focusing
View GitHub Profile
@jesulink2514
jesulink2514 / Size.cs
Last active January 21, 2016 05:19
struct Size para el frameworkBootstrap
namespace RefactorView.Infraestructure.Html
{
public struct Size
{
public Size(byte lg,byte md,byte sm,byte xs)
{
this.Lg = lg;
this.Md = md;
this.Sm = sm;
this.Xs = xs;
@jesulink2514
jesulink2514 / FormControl.cshtml
Created January 21, 2016 05:22
Vista parcial para el renderizado de controles bootstrap
@model RefactorView.Infraestructure.Html.FormControl
<div class="form-group">
@Model.Label
<div class="@Model.ContainerSize">
@Model.Control
@Model.Validation
</div>
</div>
@jesulink2514
jesulink2514 / BootstrapHelpers.cs
Created January 21, 2016 05:49
BootstrapHelpers - metodos de extension
using System;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.Mvc.Html;
namespace RefactorView.Infraestructure.Html
{
public static class BootstrapHelpers
{
private const string PartialBaseFolder = "~/Views/Shared/Controls/";
@jesulink2514
jesulink2514 / Nuevo.cshtml
Created January 21, 2016 05:57
Nuevo.cshtml refactorizado para usar el framework Bootstrap
@model RefactorView.Models.Product
@{
ViewBag.Title = "Nuevo";
var controlSize = new Size(10,10,6,12);
}
<h2>Nuevo</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
@model AspMvcDemo.Models.FormModel
@{
ViewBag.Title = "Index";
var types = ViewBag.TypesList as List<SelectListItem>;
var subtypes = ViewBag.SubTypesList as List<SelectListItem>;
}
<div class="row">
$(document).on('change', '[data-cascade-combo]', function (event) {
var id = $(this).attr('data-cascade-combo');
var url = $(this).attr('data-cascade-combo-source');
var paramName = $(this).attr('data-cascade-combo-param-name');
var data = {};
data[paramName] = id;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using AspMvcDemo.Models;
namespace AspMvcDemo.Controllers
{
public class HomeController : Controller
{
// GET: Home
@jesulink2514
jesulink2514 / EmailService.cs
Created February 11, 2017 18:45
Default EmailService
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
namespace MVCDesdeCero.Security
{
public class EmailService : IEmailService
{
public Task SendAsync(IdentityMessage message)
{
// Plug in your email service here to send an email.
@jesulink2514
jesulink2514 / SmsService.cs
Created February 11, 2017 18:47
Default SmsService
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
namespace MVCDesdeCero.Security
{
public class SmsService: ISmsService
{
public Task SendAsync(IdentityMessage message)
{
// Plug in your SMS service here to send a text message.
@jesulink2514
jesulink2514 / AppUserManager.cs
Created February 11, 2017 18:52
UserManager
using System;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
namespace MVCDesdeCero.Security
{
public class AppUserManager: UserManager<AppUser>
{
public AppUserManager(IUserStore<AppUser> store) : base(store)