This file contains 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 ExportToExcelService | |
{ | |
public void ToExcel(HttpResponseBase Response, object clientsList) | |
{ | |
var grid = new System.Web.UI.WebControls.GridView(); | |
grid.DataSource = clientsList; | |
grid.DataBind(); | |
Response.ClearContent(); | |
Response.AddHeader("content-disposition", "attachment; filename=FileName.xls"); | |
Response.ContentType = "application/excel"; |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
For more information on how to configure your ASP.NET application, please visit | |
http://go.microsoft.com/fwlink/?LinkId=301879 | |
--> | |
<configuration> | |
<appSettings> | |
<add key="webpages:Version" value="3.0.0.0" /> | |
<add key="webpages:Enabled" value="false" /> | |
<add key="ClientValidationEnabled" value="true" /> |
This file contains 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 AutoMapperConfig | |
{ | |
public static void RegisterMappings() | |
{ | |
Mapper.Initialize(c => | |
{ | |
c.AddProfile<DomainToViewModelMappingProfile>(); | |
c.AddProfile<ViewModelToDomainMappingProfile>(); | |
}); | |
} |
This file contains 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 XmlDocument CriarArquivoEnvio() | |
{ | |
var consultaServico = new StatusServicoEnvio("1.00", 2); | |
var serializer = new XmlSerializer(typeof (StatusServicoEnvio)); | |
using (var stream = new StreamWriter(PathEnvio)) | |
{ | |
serializer.Serialize(stream, consultaServico); | |
} | |
var doc = new XmlDocument(); | |
doc.Load(PathEnvio); |
This file contains 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 interface IServiceBase<TEntity> where TEntity : class | |
{ | |
void Add(TEntity obj); | |
TEntity GetById(int id); | |
IEnumerable<TEntity> GetAll(); | |
void Update(TEntity obj); | |
void Remove(TEntity obj); | |
void Dispose(); | |
} |
This file contains 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 interface IRepositoryBase<TEntity> where TEntity : class | |
{ | |
TEntity Add(TEntity item); | |
TEntity GetById(int id); | |
IEnumerable<TEntity> Get(); | |
bool Update(TEntity item); | |
int Count(); | |
void Dispose(); | |
} |
This file contains 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 AutoMapperConfig | |
{ | |
public static void RegisterMappings() | |
{ | |
Mapper.Initialize(c => | |
{ | |
c.AddProfile<DomainToViewModelMappingProfile>(); | |
c.AddProfile<ViewModelToDomainMappingProfile>(); | |
}); | |
} |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Diagnostics.Contracts; | |
using System.Web.Http.Dependencies; | |
using Ninject; | |
using Ninject.Syntax; | |
public class NinjectDependencyScope : IDependencyScope | |
{ | |
private IResolutionRoot resolver; |