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
//baseado em http://jsfiddle.net/digitalbush/R6MPU/ | |
jQuery(function ($) { | |
function empenhoViewModel() { | |
var self = this; | |
self.valorTotal = ko.observable().dinheiro(); | |
}; | |
var format = function (value) { | |
if (value === '' || isNaN(value)) value = 0; | |
toks = Number(value).toFixed(2).replace('-', '').split('.'); |
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.Web.Mvc; | |
using ExemploDeDataPreenchida.Models; | |
namespace ExemploDeDataPreenchida.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
// | |
// GET: /Home/ |
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
<ul data-bind="template: { name: 'choiceTmpl', foreach: choices, templateOptions: { selections: selectedChoices } }"></ul> | |
<script id="choiceTmpl" type="text/html"> | |
<li> | |
<input type="checkbox" data-bind="attr: { value: $data.id }, checked: $item.selections" /> | |
<span data-bind="text: $data.descricao"></span> | |
</li> | |
</script> | |
<hr /> |
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
<ul data-bind="foreach: items"> | |
<li> | |
<input type="checkbox" data-bind="attr: { value: id }, checked: $root.checked" /> | |
<span data-bind="text: descricao"></span> | |
</li> | |
</ul> | |
<hr/> | |
<div data-bind="text: ko.toJSON($root)"></div> |
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
/* COMOANDOS DE CRUD */ | |
/*------------------------------------------------*/ | |
//Busca uma pessoa por nome, que o nome comece com | |
//find Json | |
{ | |
"PessoaFisica.Nome": /^ANDERSON LOPES OLI/ | |
} | |
//baseado no filtro acima aplica o update, tem que usar o $set, se não ele apagar as propriedades existentes |
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
//Selecionando objetos distintos usando Linq | |
//Agrupando com uma propriedade | |
List<Pessoa> pessoasDistintas = todasAsPessoas | |
.GroupBy(p => p.Id) | |
.Select(g => g.First()) | |
.ToList(); | |
//Agrupando com varias propriedades | |
List<Pessoa> pessoasDistintas = todasAsPessoas |
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
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( | |
"~/Scripts/jquery.unobtrusive*", | |
"~/Scripts/jquery.validate*", | |
"~/Scripts/methods_pt.js")); |
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 1 column, instead of 2. in line 4.
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
NUMCAP;CATINIC;CATFIM;DESCRICAO;DESCRABREV; | |
1;A00;B99;Capítulo I - Algumas doenças infecciosas e parasitárias;I. Algumas doenças infecciosas e parasitárias; | |
2;C00;D48;Capítulo II - Neoplasias [tumores];II. Neoplasias (tumores); | |
3;D50;D89;Capítulo III - Doenças do sangue e dos órgãos hematopoéticos e alguns transtornos imunitários;III. Doenças sangue órgãos hemat e transt imunitár; | |
4;E00;E90;Capítulo IV - Doenças endócrinas, nutricionais e metabólicas;IV. Doenças endócrinas nutricionais e metabólicas; |
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.Collections.ObjectModel; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace MvcApplication6.Controllers | |
{ | |
public class HomeController : Controller |
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; | |
namespace TimeZone | |
{ | |
class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
Console.WriteLine("Data/Hora atual UTC : {0}", DateTime.UtcNow.ToString("dd/MM/yyyy HH:mm:ss")); | |
Console.WriteLine("Data/Hora (UTC -4 Rondônia) : {0}", DateTime.UtcNow.AddHours(-4).ToString("dd/MM/yyyy HH:mm:ss")); |
OlderNewer