public DATA.USER.CausalMora toCausalMora(ENTIDADES.CausalMora o) { return(new DATA.USER.CausalMora() { causalMoraID = o.causalMoraID, Nombre = o.Nombre }); }
public bool add(ENTIDADES.CausalMora o) { try { using (var db = new DATA.USER.COBRANZA_CBEntities()) { db.CausalMoras.Add(toCausalMora(o)); db.SaveChanges(); return(true); } } catch (System.Exception ex) { throw new System.Exception("Logica:add", ex); } }
public bool delete(ENTIDADES.CausalMora o) { try { using (var db = new DATA.USER.COBRANZA_CBEntities()) { var dr = db.CausalMoras.Where(x => x.causalMoraID == o.causalMoraID).FirstOrDefault(); if (dr != null) { db.CausalMoras.Remove(dr); db.SaveChanges(); return(true); } else { return(false); } } } catch (System.Exception ex) { throw new System.Exception("Logica:delete", ex); } }