public ro_marcaciones_Equipo_Info Get_Info_marcaciones_Equipo(int id) { ro_marcaciones_Equipo_Info Info = new ro_marcaciones_Equipo_Info(); try { using (EntitiesRoles context = new EntitiesRoles()) { var contenido = context.ro_marcaciones_Equipo.First(var => var.IdEquipoMar == id); Info.IdEquipoMar = contenido.IdEquipoMar; Info.Nombre_Equipo = contenido.Nombre_Equipo; Info.Modelo_Equipo = contenido.Modelo_Equipo; Info.CadenaConexion = contenido.CadenaConexion; Info.Tabla_Vista = contenido.Tabla_Vista; Info.FormatoHora = contenido.FormatoHora; Info.FormatoFecha = contenido.FormatoFecha; Info.TipoBd = contenido.TipoBd; Info.FechaUltimaImportacionMarcaiones = contenido.FechaUltimaImportacionMarcaiones; Info.Estado = contenido.Estado; return(Info); } } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
private void preparar_formulario(Cl_Enumeradores.eTipo_action _Accion) { try { Info = (ro_marcaciones_Equipo_Info)gridViewEquipos.GetFocusedRow(); frm = new frmRo_Equipos_Mantenimiento(); if (_Accion == Cl_Enumeradores.eTipo_action.actualizar || _Accion == Cl_Enumeradores.eTipo_action.consultar || _Accion == Cl_Enumeradores.eTipo_action.Anular) { if (Info.IdEquipoMar == 0) { MessageBox.Show("Seleccione una fila", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } frm.set_Info(Info); } if (_Accion == Cl_Enumeradores.eTipo_action.Anular) { if (Info.Estado == "I") { MessageBox.Show("El departamento ya fue anulado", "Informativo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frm.set_Info(Info); } frm.set_Accion(_Accion); frm.Event_frmRo_Marcaciones_Equipos_Mantenimiento_FormClosing += frm_Event_frmRo_Marcaciones_Equipos_Mantenimiento_FormClosing; frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); Log_Error_bus.Log_Error(ex.ToString()); } }
public Boolean AnularDB(ro_marcaciones_Equipo_Info info) { try { EntitiesRoles context = new EntitiesRoles(); var contenido = context.ro_marcaciones_Equipo.First(var => var.IdEquipoMar == info.IdEquipoMar); contenido.Estado = "I"; contenido.IdUsuarioUltAnu = info.IdUsuarioUltAnu; contenido.Fecha_UltAnu = info.Fecha_UltAnu; context.SaveChanges(); return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
private void cmbTipoEquipo_EditValueChanged(object sender, EventArgs e) { try { ro_marcaciones_Equipo_Info Info = new ro_marcaciones_Equipo_Info(); Info = (ro_marcaciones_Equipo_Info)cmbTipoEquipo.Properties.View.GetFocusedRow(); Ocon = Info.CadenaConexion; DtpFechaI.Value = Info.FechaUltimaImportacionMarcaiones.AddDays(1); } catch (Exception ex) { MessageBox.Show(ex.ToString()); Log_Error_bus.Log_Error(ex.ToString()); } }
public Boolean AnularDB(ro_marcaciones_Equipo_Info info) { try { info.IdUsuarioUltAnu = param.IdUsuario; info.Fecha_UltAnu = param.GetDateServer(); return(data.AnularDB(info)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "AnularDB", ex.Message), ex) { EntityType = typeof(ro_marcaciones_Equipo_Bus) }; } }
public List <ro_marcaciones_Equipo_Info> Get_List_marcaciones_Equipo(int IdEmpresa, int IdSucursal) { List <ro_marcaciones_Equipo_Info> Lista = new List <ro_marcaciones_Equipo_Info>(); try { using (EntitiesRoles oEnti = new EntitiesRoles()) { var registros = from C in oEnti.ro_marcaciones_Equipo where C.IdEmpresa == IdEmpresa && C.IdSucursal == IdSucursal select C; foreach (var tipo in registros) { ro_marcaciones_Equipo_Info info = new ro_marcaciones_Equipo_Info(); info.IdEmpresa = tipo.IdEmpresa; info.IdEquipoMar = tipo.IdEquipoMar; info.FormatoFecha = tipo.FormatoFecha; info.Nombre_Equipo = tipo.Nombre_Equipo; info.Modelo_Equipo = tipo.Modelo_Equipo; info.Tabla_Vista = tipo.Tabla_Vista; info.CadenaConexion = tipo.CadenaConexion; info.FormatoFecha = tipo.FormatoFecha; info.FormatoHora = tipo.FormatoHora; info.Estado = tipo.Estado; info.IdUsuario = tipo.IdUsuario; info.FechaUltimaImportacionMarcaiones = tipo.FechaUltimaImportacionMarcaiones; Lista.Add(info); } return(Lista); } } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean GrabarDB(ro_marcaciones_Equipo_Info info) { try { info.IdUsuario = param.IdUsuario; info.Ip = param.ip; info.Fecha_Transac = param.Fecha_Transac; info.nom_pc = param.nom_pc; return(data.GrabarDB(info)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GrabarDB", ex.Message), ex) { EntityType = typeof(ro_marcaciones_Equipo_Bus) }; } }
public void set_Info(ro_marcaciones_Equipo_Info _Info) { try { txtid.Text = (_Info.IdEquipoMar.ToString()); txtNombreEquipo.Text = (_Info.Nombre_Equipo); txtModeloEquipo.Text = (_Info.Modelo_Equipo); txtTabla.Text = _Info.Tabla_Vista; txt_cadena_conexion.Text = _Info.CadenaConexion; cmb_formato_fecha.Text = _Info.FormatoFecha; cmb_formato_hora.Text = _Info.FormatoHora; dateTimeFechaUltProceso.Value = _Info.FechaUltimaImportacionMarcaiones; cmb_tipo_base.Text = _Info.TipoBd; cBoxEstado.Checked = (_Info.Estado == "A") ? true : false; Info = _Info; } catch (Exception ex) { MessageBox.Show(ex.ToString()); Log_Error_bus.Log_Error(ex.ToString()); } }
public Boolean GrabarDB(ro_marcaciones_Equipo_Info info) { try { using (EntitiesRoles Context = new EntitiesRoles()) { ro_marcaciones_Equipo address = new ro_marcaciones_Equipo(); address.IdEmpresa = info.IdEmpresa; address.IdSucursal = info.IdSucursal; address.IdEquipoMar = info.IdEquipoMar = getId(); address.Modelo_Equipo = info.Modelo_Equipo; address.Nombre_Equipo = info.Nombre_Equipo; address.TipoBd = info.TipoBd; address.CadenaConexion = info.CadenaConexion; address.Tabla_Vista = info.Tabla_Vista; address.FormatoFecha = info.FormatoFecha; address.FormatoHora = info.FormatoHora; address.FechaUltimaImportacionMarcaiones = DateTime.Now; address.IdUsuario = info.IdUsuario; address.Fecha_Transac = info.Fecha_Transac; address.nom_pc = info.nom_pc; address.Ip = info.Ip; address.Estado = "A"; Context.ro_marcaciones_Equipo.Add(address); // hace lo mismo Context.ro_marcaciones_Equipo.Add(address); Context.SaveChanges(); } return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean ActualizaUltimaFechaCorte(ro_marcaciones_Equipo_Info info) { try { using (EntitiesRoles context = new EntitiesRoles()) { var address = context.ro_marcaciones_Equipo.First(var => var.IdEquipoMar == info.IdEquipoMar); address.FechaUltimaImportacionMarcaiones = info.FechaUltimaImportacionMarcaiones; context.SaveChanges(); } return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean ModificarDB(ro_marcaciones_Equipo_Info info) { try { using (EntitiesRoles context = new EntitiesRoles()) { var address = context.ro_marcaciones_Equipo.First(var => var.IdEquipoMar == info.IdEquipoMar); address.Modelo_Equipo = info.Modelo_Equipo; address.Nombre_Equipo = info.Nombre_Equipo; address.TipoBd = info.TipoBd; address.CadenaConexion = info.CadenaConexion; address.Tabla_Vista = info.Tabla_Vista; address.FormatoFecha = info.FormatoFecha; address.FormatoHora = info.FormatoHora; address.FechaUltimaImportacionMarcaiones = info.FechaUltimaImportacionMarcaiones; address.IdUsuario = info.IdUsuario; address.nom_pc = info.nom_pc; address.Ip = info.Ip; address.Estado = info.Estado; address.IdUsuarioUltModi = info.IdUsuarioUltModi; address.Fecha_UltMod = info.Fecha_UltMod; context.SaveChanges(); } return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }