Skip to content

Instantly share code, notes, and snippets.

View zaidepilef's full-sized avatar
🙃
I may be slow to respond.

Felipe Diaz zaidepilef

🙃
I may be slow to respond.
  • Zaid
  • Viña del Mar, Chile
View GitHub Profile
private IList<CotizacionModel> BuscaBitacoraCotizacion(BitacoraCotizacionHogarViewModel model)
{
IList<CotizacionModel> listadoBitacora = new List<CotizacionModel>();
if (model.FechaTermino != null)
model.FechaTermino = model.FechaTermino.Value.AddDays(1);
CotizacionModel cotizacionModel = new CotizacionModel();
cotizacionModel.CodigoCanal = GetUser().CodigoCanal;
cotizacionModel.CodigoEstado = model.Estado;
@zaidepilef
zaidepilef / gist:c70e24202583228909e82159c09581c3
Created October 25, 2017 18:39
Controller que envia el lista en json para poblar en la vista
[HttpPost]
public JsonResult LlamarJson(BitacoraCotizacionHogarViewModel model)
{
IList<CotizacionModel> listadoBitacora = new List<CotizacionModel>();
//listadoBitacora = BuscaBitacoraCotizacion(model);
//var cotizacionesList = result.ToDataSourceResult(request);
foreach (var item in BuscaBitacoraCotizacion(model))
{
CotizacionModel laCotizacion = new CotizacionModel();
laCotizacion = item;
@zaidepilef
zaidepilef / cshtml
Created October 25, 2017 18:37
Ajax json ASP.NET MVC y poblar una tablagrilla
<!---ajax para traer listado bitacora-->
<script type="text/javascript">
$(function () {
$("#btnGet").click(function () {
var NumeroCotizacion = $("#NumeroCotizacion").val();
var NumeroPoliza = $("#NumeroPoliza").val();
var FechaInicio = $("#NumeroPoliza").val();
var FechaTermino = $("#NumeroPoliza").val();
@zaidepilef
zaidepilef / gist:d64764c26be5a7a8a3bcde7509ec2e6a
Created September 27, 2017 20:59
validacion JS para MVC5 en la carpeta Script
function convertToUtc(str) {
if (str != null) {
var date = new Date(str);
var year = date.getUTCFullYear();
var month = date.getUTCMonth() + 1;
var dd = date.getUTCDate();
var hh = date.getUTCHours();
var mi = date.getUTCMinutes();
var sec = date.getUTCSeconds();
theDate = year + "-" + pad(month, 2) + "-" + pad(dd, 2);