This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mainCtrl = function($scope, $http) { | |
// la función obtenerPaises pasa a ser parte del Scope para ser identificada en la Vista | |
$scope.obtenerPaises = function() { | |
$http({ method: 'GET', url: '/api/values' }) | |
.success(function(data) { | |
$scope.paises = data; | |
}) | |
.error(function(data) { | |
$scope.error = data.Message; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model IEnumerable<PartialView_Ajax.Models.VentasMes> | |
@{ | |
ViewBag.Title = "Resumen"; | |
} | |
<h2>Resumen Ventas</h2> | |
<table> | |
<tr> | |
<th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_Start() | |
{ | |
AreaRegistration.RegisterAllAreas(); | |
//DI | |
IKernel kernel = new StandardKernel(); | |
kernel.Bind<IPaisRepository>().To<PaisRepository>(); | |
System.Web.Http.Dependencies.IDependencyResolver resolver = new NinjectResolver(kernel); | |
GlobalConfiguration.Configuration.DependencyResolver = resolver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static IKernel CreateKernel() | |
{ | |
var kernel = new StandardKernel(); | |
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel); | |
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>(); | |
RegisterServices(kernel); | |
//Integrar Ninject como Dependency Resolver en la Config. a nivel Global. | |
GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(kernel); | |
return kernel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PaisesSinDiController : ApiController | |
{ | |
private readonly IPaisRepository repositorio; | |
public PaisesSinDiController(IPaisRepository repositorio) | |
{ | |
this.repositorio = repositorio; | |
} | |
public IEnumerable<Pais> Get() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//IPaisRepository | |
public interface IPaisRepository | |
{ | |
IEnumerable<Pais> GetAll(); | |
} | |
//PaisRepository | |
public class PaisRepository:IPaisRepository | |
{ | |
private readonly IEnumerable<Pais> paises = new List<Pais>() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var nieto = new Nieto(); | |
Console.WriteLine(nieto.Sumar(1, 3)); | |
Console.ReadKey(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ElNuevoDiarioNi.Data; | |
using ElNuevoDiarioNi.Model; | |
using ElNuevoDiarioNi.ViewModel; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using Windows.ApplicationModel.DataTransfer; | |
using Windows.Foundation; | |
using Windows.Foundation.Collections; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void CrearTostadaSinExtensions() | |
{ | |
XmlDocument toastXML = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02); | |
XmlNodeList toastText = toastXML.GetElementsByTagName("text"); | |
toastText[0].InnerText = "Notificación"; | |
toastText[1].InnerText = "Esta es una notificación que NO usa NotificationExtensions"; | |
ToastNotification toast = new ToastNotification(toastXML); | |
ToastNotificationManager.CreateToastNotifier().Show(toast); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<string> GetImageInHtmlNotice(string url) | |
{ | |
var page = await GetNodeHtml(url); | |
string selector = string.Empty; | |
selector = ".image img"; | |
var consulta = (from item in page.QuerySelectorAll(selector) | |
select item).FirstOrDefault(); | |
NewerOlder