public bool AnularDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref string mensaje) { try { using (EntityRoles_FJ Context = new EntityRoles_FJ()) { ro_fectividad_Entrega_tipoServicio contact = Context.ro_fectividad_Entrega_tipoServicio.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdServicio == Info.IdServicio); if (contact != null) { contact.IdUsuarioUltAnu = Info.IdUsuarioUltAnu; contact.Fecha_UltAnu = Info.Fecha_UltAnu; contact.Estado = false; 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.ToString(); throw new Exception(ex.ToString()); } }
public bool ModificarDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref string mensaje) { try { using (EntityRoles_FJ Context = new EntityRoles_FJ()) { ro_fectividad_Entrega_tipoServicio contact = Context.ro_fectividad_Entrega_tipoServicio.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdServicio == Info.IdServicio); if (contact != null) { contact.ts_Descripcion = Info.ts_Descripcion; contact.ts_codigo = Info.ts_codigo; contact.Porcentaje = Info.Porcentaje; contact.Efectividad_entrega = Info.Efectividad_entrega; contact.Efectividad_volumen = Info.Efectividad_volumen; contact.Recuperacion_cartera = Info.Recuperacion_cartera; contact.Genera_novedad = Info.Genera_novedad; contact.IdUsuarioUltModi = Info.IdUsuarioUltModi; contact.Fecha_UltMod = DateTime.Now; 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.ToString(); throw new Exception(ex.ToString()); } }
private void gvw_ruta_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { info_servicio = gvw_ruta.GetRow(e.FocusedRowHandle) as ro_fectividad_Entrega_tipoServicio_Info; } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
public void Set_Info(ro_fectividad_Entrega_tipoServicio_Info _Info_Ruta) { try { info_servicio = _Info_Ruta; } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
public bool AnularDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref string mensaje) { try { return(oData.AnularDB(Info, ref mensaje)); } catch (Exception ex) { mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(mensaje); } }
private void gridView_Efectividad_KeyDown(object sender, KeyEventArgs e) { try { ro_fectividad_Entrega_tipoServicio_Info = bus_servicio.Get_Info(param.IdEmpresa, Convert.ToInt32(cmb_servicios.EditValue)); if (e.KeyCode == Keys.V && e.Control == true) { Pegar_Data(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public List <ro_fectividad_Entrega_tipoServicio_Info> Get_List(int IdEmpresa) { List <ro_fectividad_Entrega_tipoServicio_Info> list_Ruta = new List <ro_fectividad_Entrega_tipoServicio_Info>(); try { using (EntityRoles_FJ Context = new EntityRoles_FJ()) { var contact = from q in Context.ro_fectividad_Entrega_tipoServicio where q.IdEmpresa == IdEmpresa select q; foreach (var item in contact) { ro_fectividad_Entrega_tipoServicio_Info Info = new ro_fectividad_Entrega_tipoServicio_Info(); Info.IdEmpresa = item.IdEmpresa; Info.IdServicio = item.IdServicio; Info.ts_Descripcion = item.ts_Descripcion; Info.ts_codigo = item.ts_codigo; Info.Porcentaje = item.Porcentaje; Info.Efectividad_entrega = item.Efectividad_entrega; Info.Efectividad_volumen = item.Efectividad_volumen; Info.Recuperacion_cartera = item.Recuperacion_cartera; Info.Genera_novedad = item.Genera_novedad; Info.Estado = item.Estado; Info.IdUsuario = item.IdUsuario; Info.Fecha_Transaccion = item.Fecha_Transaccion; Info.IdUsuarioUltModi = item.IdUsuarioUltModi; Info.Fecha_UltMod = item.Fecha_UltMod; Info.IdUsuarioUltAnu = item.IdUsuarioUltAnu; Info.Fecha_UltAnu = item.Fecha_UltAnu; list_Ruta.Add(Info); } } return(list_Ruta); } 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.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public bool GuardarDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref int IdServicio, ref string mensaje) { try { IdServicio = Get_Id(Info.IdEmpresa, ref mensaje); using (EntityRoles_FJ Context = new EntityRoles_FJ()) { ro_fectividad_Entrega_tipoServicio contact = new ro_fectividad_Entrega_tipoServicio(); contact.IdEmpresa = Info.IdEmpresa; contact.IdServicio = Info.IdServicio = IdServicio; contact.ts_Descripcion = Info.ts_Descripcion; contact.ts_codigo = Info.ts_codigo; contact.Porcentaje = Info.Porcentaje; contact.Estado = Info.Estado; contact.IdUsuario = Info.IdUsuario; contact.Fecha_Transaccion = Info.Fecha_Transaccion; contact.Efectividad_entrega = Info.Efectividad_entrega; contact.Efectividad_volumen = Info.Efectividad_volumen; contact.Recuperacion_cartera = Info.Recuperacion_cartera; contact.Genera_novedad = Info.Genera_novedad; Context.ro_fectividad_Entrega_tipoServicio.Add(contact); 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.ToString(); throw new Exception(ex.ToString()); } }