public void Filtro(string id) { int esto = Int32.Parse(id); var bt = bd.conceptos.FirstOrDefault(x => x.idconcepto == esto); bd.Entry(bt).Reload(); ConceptoActual = bt; PrincipalViewModel.EstatusNuevo = false; NotifyPropertyChanged("ConceptoActual"); }
public void Buscar(string texto) { var bt = bd.conceptos.FirstOrDefault(x => x.codigo == texto); if (bt != null) { ConceptoActual = bt; PrincipalViewModel.EstatusNuevo = false; } else { ConceptoActual = new conceptos { codigo = texto }; PrincipalViewModel.EstatusNuevo = true; } }
protected internal override bool esValido() { Dto = ctx.conceptos.Where(t => t.id == oDto.id).FirstOrDefault(); if (Dto != null) return true; else { byaRpt.Error = true; byaRpt.Mensaje = "No existe ningun concepto con este id"; return false; } }
protected internal override bool esValido() { Dto = ctx.conceptos.Where(t => t.nombre == oDto.nombre).FirstOrDefault(); if (Dto == null) return true; else { byaRpt.Mensaje = "Existe un concepto con un nombre exactamente igual"; byaRpt.Error = true; return false; } }
protected internal override void Antes() { UltIdConceptos(); ultid_conceptos++; oDto.id = ultid_conceptos; Dto = new conceptos(); Mapper.Map(oDto,Dto); ctx.conceptos.Add(Dto); }
public void Nuevo() { ConceptoActual = new conceptos(); PrincipalViewModel.EstatusNuevo = true; }