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 DbContextUnitOfWork //: IUnitOfWork | |
{ | |
public System.Data.Entity.DbContext Context { get; private set; } | |
private bool _disposed; | |
public DbContextUnitOfWork(System.Data.Entity.DbContext context) | |
{ | |
Context = context; | |
} | |
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
[HttpPost] | |
public ActionResult Salvar(Estoque estoque) | |
{ | |
if (!ModelState.IsValid) | |
{ | |
return new HttpStatusCodeResult(400, "Erros de Validação"); | |
} | |
using (var unitOfWork = new CustomUnitOfWork()) | |
{ |
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 EstoqueRepository : RepositoryBase<Estoque> | |
{ | |
public EstoqueRepository(CustomUnitOfWork uow) | |
: base(uow) | |
{ | |
} | |
public override bool Validate(Estoque estoque) | |
{ | |
var isValid = base.Validate(estoque); |
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 IRepository<T> where T : class, new() | |
{ | |
T Find(object key); | |
IEnumerable<T> Query(Func<T, bool> predicate); | |
IQueryable<T> AsQueryable(); | |
void Add(T instance); | |
void Edit(T instance); | |
void Remove(T instance); | |
} |
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
/*Global.asax.cs ou RouteConfig.cs*/ | |
var routes = RouteTable.Routes; | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(?i)(asp|aspx|css|js|xml|txt|png|gif|jpg|jpeg|bmp|ico|woff|svg|ttf|eot)(/.*)?" }); | |
routes.IgnoreRoute("Content/{*pathInfo}"); | |
routes.IgnoreRoute("Scripts/{*pathInfo}"); | |
routes.IgnoreRoute("Bundles/{*pathInfo}"); |
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
cat .gitmodules |while read i | |
do | |
if [[ $i == \[submodule* ]]; then | |
mpath=$(echo $i | cut -d\" -f2) | |
read i; read i; | |
murl=$(echo $i|cut -d\ -f3) | |
mcommit=`eval "git submodule status ${mpath} |cut -d\ -f2"` | |
mname=$(basename $mpath) | |
echo -e "$name\t$mpath\t$murl\t$mcommit" | |
git submodule deinit $mpath |
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
<dependentAssembly> | |
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | |
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" /> | |
</dependentAssembly> |
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
Ext.define('App.controller.Clientes', { | |
extend: 'Ext.app.Controller', | |
init: function () { | |
this.control({ | |
"grid": { | |
meuevento: function (record) { //captura o evento que será disparado pelo grid, quando o ícone for clicado | |
console.log(record); | |
}, |
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.Drawing; | |
using System.Drawing.Imaging; | |
using System.Drawing.Printing; | |
using System.IO; | |
using Microsoft.Reporting.WinForms; | |
// ReSharper disable once CheckNamespace | |
namespace JonePolvora { |
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.ComponentModel.DataAnnotations; | |
using System.Data; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; |