public bool guardarDB(cxc_Catalogo_Info info) { try { using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_Catalogo Entity = new cxc_Catalogo { IdCatalogo_tipo = info.IdCatalogo_tipo, IdCatalogo = info.IdCatalogo, Estado = info.Estado = "A", Orden = info.Orden, Nombre = info.Nombre, IdUsuario = info.IdUsuario }; Context.cxc_Catalogo.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public cxc_Catalogo_Info get_info(string IdCatalogo_tipo, string IdCatalogo) { try { cxc_Catalogo_Info info = new cxc_Catalogo_Info(); using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_Catalogo Entity = Context.cxc_Catalogo.FirstOrDefault(q => q.IdCatalogo_tipo == IdCatalogo_tipo && q.IdCatalogo == IdCatalogo); if (Entity == null) { return(null); } info = new cxc_Catalogo_Info { IdCatalogo_tipo = Entity.IdCatalogo_tipo, IdCatalogo = Entity.IdCatalogo, Estado = Entity.Estado, Nombre = Entity.Nombre, Orden = Entity.Orden }; } return(info); } catch (Exception) { throw; } }
public bool modificarDB(cxc_Catalogo_Info info) { try { using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_Catalogo Entity = Context.cxc_Catalogo.FirstOrDefault(q => q.IdCatalogo_tipo == info.IdCatalogo_tipo && q.IdCatalogo == info.IdCatalogo); if (Entity == null) { return(false); } Entity.IdCatalogo_tipo = info.IdCatalogo_tipo; Entity.Nombre = info.Nombre; Entity.Orden = info.Orden; Entity.IdUsuarioUltMod = info.IdUsuarioUltMod; Entity.FechaUltMod = DateTime.Now; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public Boolean GuardarDB(cxc_catalogo_Info Info) { try { using (EntitiesCuentas_x_Cobrar Context = new EntitiesCuentas_x_Cobrar()) { var Address = new cxc_Catalogo(); Address.IdCatalogo = Info.IdCatalogo; Address.IdCatalogo_tipo = Info.IdCatalogo_tipo; Address.Nombre = Info.Nombre; Address.Estado = "A"; Address.Orden = Info.Orden; Address.IdUsuario = Info.IdUsuario; Address.nom_pc = Info.nom_pc; Address.ip = Info.ip; Context.cxc_Catalogo.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 anularDB(cxc_Catalogo_Info info) { try { using (Entities_cuentas_por_cobrar Context = new Entities_cuentas_por_cobrar()) { cxc_Catalogo Entity = Context.cxc_Catalogo.FirstOrDefault(q => q.IdCatalogo_tipo == info.IdCatalogo_tipo && q.IdCatalogo == info.IdCatalogo); if (Entity == null) { return(false); } Entity.Estado = info.Estado = "I"; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }