public bool guardarDB(tb_banco_procesos_bancarios_x_empresa_Info info) { try { using (Entities_general Context = new Entities_general()) { tb_banco_procesos_bancarios_x_empresa Entity = new tb_banco_procesos_bancarios_x_empresa { IdEmpresa = info.IdEmpresa, NombreProceso = info.NombreProceso, IdProceso = info.IdProceso = get_id(info.IdEmpresa), // IdProceso = info.IdProceso = get_id(), IdBanco = info.IdBanco, IdProceso_bancario_tipo = info.IdProceso_bancario_tipo, Codigo_Empresa = info.Codigo_Empresa, estado = info.estado = "A", IdTipoNota = info.IdTipoNota, Se_contabiliza = info.Se_contabiliza }; Context.tb_banco_procesos_bancarios_x_empresa.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool modificarDB(tb_banco_procesos_bancarios_x_empresa_Info info) { try { using (Entities_general Context = new Entities_general()) { tb_banco_procesos_bancarios_x_empresa Entity = Context.tb_banco_procesos_bancarios_x_empresa.FirstOrDefault(q => q.IdProceso == info.IdProceso && q.IdEmpresa == info.IdEmpresa); if (Entity == null) { return(false); } Entity.IdProceso_bancario_tipo = info.IdProceso_bancario_tipo; Entity.IdBanco = info.IdBanco; Entity.NombreProceso = info.NombreProceso; Entity.Codigo_Empresa = info.Codigo_Empresa; Entity.Se_contabiliza = info.Se_contabiliza; Entity.IdTipoNota = info.IdTipoNota; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public tb_banco_procesos_bancarios_x_empresa_Info get_info(int IdEmpresa, int IdProceso) { try { tb_banco_procesos_bancarios_x_empresa_Info info = new tb_banco_procesos_bancarios_x_empresa_Info(); using (Entities_general Context = new Entities_general()) { tb_banco_procesos_bancarios_x_empresa Entity = Context.tb_banco_procesos_bancarios_x_empresa.FirstOrDefault(q => q.IdEmpresa == IdEmpresa && q.IdProceso == IdProceso); if (Entity == null) { return(null); } info = new tb_banco_procesos_bancarios_x_empresa_Info { IdBanco = Entity.IdBanco, IdProceso_bancario_tipo = Entity.IdProceso_bancario_tipo, estado = Entity.estado, Codigo_Empresa = Entity.Codigo_Empresa, NombreProceso = Entity.NombreProceso }; } return(info); } catch (Exception) { throw; } }
public bool GuardarDB(tb_banco_procesos_bancarios_x_empresa_Info Info) { try { try { using (EntitiesGeneral Context = new EntitiesGeneral()) { tb_banco_procesos_bancarios_x_empresa Entity = new tb_banco_procesos_bancarios_x_empresa(); Entity.IdEmpresa = Info.IdEmpresa; Entity.IdProceso_bancario_tipo = Info.IdProceso_bancario_tipo; Entity.IdBanco = Info.IdBanco; Entity.cod_banco = Info.cod_banco; Entity.Codigo_Empresa = Info.Codigo_Empresa; Entity.Secuencial_detalle_inicial = Info.Secuencial_detalle_inicial; Entity.IdTipoNota = Info.IdTipoNota; Entity.Se_contabiliza = Info.Se_contabiliza; Context.tb_banco_procesos_bancarios_x_empresa.Add(Entity); Context.SaveChanges(); } return(true); } catch (DbEntityValidationException 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.ToString() + " " + ex.Message; mensaje = "Error al Grabar" + ex.Message; throw new Exception(ex.ToString()); } } 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.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public bool anularDB(tb_banco_procesos_bancarios_x_empresa_Info info) { try { using (Entities_general Context = new Entities_general()) { tb_banco_procesos_bancarios_x_empresa Entity = Context.tb_banco_procesos_bancarios_x_empresa.FirstOrDefault(q => q.IdProceso == info.IdProceso && q.IdEmpresa == info.IdEmpresa); if (Entity == null) { return(false); } Entity.estado = info.estado = "I"; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }