protected internal override bool esValido() { Dto = ctx.tasas.Where(t => (t.fecha_inicio <= oDto.fecha_inicio && t.fecha_fin >= oDto.fecha_inicio) || (t.fecha_inicio <= oDto.fecha_fin && t.fecha_fin >= oDto.fecha_fin)).FirstOrDefault(); if (Dto == null) return true; else { byaRpt.Mensaje = "Fecha inicio o feha fin esta en un rango de fecha ya registrado"; byaRpt.Error = true; return false; } }
protected internal override bool esValido() { Dto = ctx.tasas.Where(t => t.id == oDto.id).FirstOrDefault(); if (Dto != null) return true; else { byaRpt.Error = true; byaRpt.Mensaje = "No existe ninguna tasa con este id"; return false; } }
protected internal override void Antes() { UltIdTasas(); ultid_tasas++; oDto.id = ultid_tasas; Dto = new tasas(); Mapper.Map(oDto, Dto); ctx.tasas.Add(Dto); }