public cxc_CatalogoTipo_Info get_info(string IdCatalogo_tipo) { try { cxc_CatalogoTipo_Info info = new cxc_CatalogoTipo_Info(); using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_CatalogoTipo Entity = Context.cxc_CatalogoTipo.FirstOrDefault(q => q.IdCatalogo_tipo == IdCatalogo_tipo); if (Entity == null) { return(null); } info = new cxc_CatalogoTipo_Info { Descripcion = Entity.Descripcion, IdCatalogo_tipo = Entity.IdCatalogo_tipo }; } return(info); } catch (Exception) { throw; } }
public Boolean GuardarDB(cxc_CatalogoTipo_Info Info) { try { using (EntitiesCuentas_x_Cobrar Context = new EntitiesCuentas_x_Cobrar()) { var Address = new cxc_CatalogoTipo(); Address.IdCatalogo_tipo = Info.IdCatalogo_tipo; Address.Descripcion = Info.Descripcion; Context.cxc_CatalogoTipo.Add(Address); Context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public bool guardarDB(cxc_CatalogoTipo_Info info) { try { using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_CatalogoTipo Entity = new cxc_CatalogoTipo { Descripcion = info.Descripcion, IdCatalogo_tipo = info.IdCatalogo_tipo }; Context.cxc_CatalogoTipo.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool modificarDB(cxc_CatalogoTipo_Info info) { try { using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_CatalogoTipo Entity = Context.cxc_CatalogoTipo.FirstOrDefault(q => q.IdCatalogo_tipo == info.IdCatalogo_tipo); if (Entity == null) { return(false); } Entity.Descripcion = info.Descripcion; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }