Beispiel #1
0
        public bool GuardarDB(ro_fuerza_Info Info, ref int IdFuerza, ref string mensaje)
        {
            try
            {
                IdFuerza = Get_Id(Info.IdEmpresa, ref mensaje);

                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_fuerza contact = new ro_fuerza();

                    contact.IdEmpresa         = Info.IdEmpresa;
                    contact.IdFuerza          = Info.IdFuerza = IdFuerza;
                    contact.fu_descripcion    = Info.fu_descripcion;
                    contact.Estado            = Info.Estado;
                    contact.IdUsuario         = Info.IdUsuario;
                    contact.Fecha_Transaccion = Info.Fecha_Transaccion;
                    contact.nom_pc            = Info.nom_pc;
                    contact.ip = Info.ip;

                    Context.ro_fuerza.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());
            }
        }
Beispiel #2
0
        public bool AnularDB(ro_fuerza_Info Info, ref string mensaje)
        {
            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_fuerza contact = Context.ro_fuerza.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdFuerza == Info.IdFuerza);
                    if (contact != null)
                    {
                        contact.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                        contact.Fecha_UltAnu    = Info.Fecha_UltAnu;
                        contact.MotivoAnulacion = Info.MotivoAnulacion;
                        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());
            }
        }
Beispiel #3
0
 public bool ModificarDB(ro_fuerza_Info Info, ref string mensaje)
 {
     try
     {
         using (EntityRoles_FJ Context = new EntityRoles_FJ())
         {
             ro_fuerza contact = Context.ro_fuerza.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdFuerza == Info.IdFuerza);
             if (contact != null)
             {
                 contact.fu_descripcion   = Info.fu_descripcion;
                 contact.IdUsuarioUltModi = Info.IdUsuarioUltModi;
                 contact.Fecha_UltMod     = DateTime.Now;
                 contact.nom_pc           = Info.nom_pc;
                 contact.ip                = Info.ip;
                 contact.IdCentroCosto     = Info.IdCentroCosto;
                 contact.IdSuccentroCosto  = Info.IdSuccentroCosto;
                 contact.cedula_gasto      = Info.cedula_gasto;
                 contact.descripcion_gasto = Info.descripcion_gasto;
                 contact.valor_gasto       = Info.valor_gasto;
                 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());
     }
 }
Beispiel #4
0
        public List <ro_fuerza_Info> Get_List_Fuerza(int IdEmpresa, DateTime FechaIni, DateTime FechaFin, ref string mensaje)
        {
            try
            {
                DateTime Fecha_Ini = Convert.ToDateTime(FechaIni.ToShortDateString());
                DateTime Fecha_Fin = Convert.ToDateTime(FechaFin.ToShortDateString());
                List <ro_fuerza_Info> list_fuerza = new List <ro_fuerza_Info>();

                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    var lst = from q in Context.ro_fuerza
                              where q.IdEmpresa == IdEmpresa
                              //   && q.Fecha_Transaccion >= Fecha_Ini
                              //   && q.Fecha_Transaccion <= Fecha_Fin
                              select q;

                    foreach (var item in lst)
                    {
                        ro_fuerza_Info Info = new ro_fuerza_Info();
                        Info.IdEmpresa         = item.IdEmpresa;
                        Info.IdFuerza          = item.IdFuerza;
                        Info.fu_descripcion    = item.fu_descripcion;
                        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;
                        Info.MotivoAnulacion   = item.MotivoAnulacion;
                        Info.nom_pc            = item.nom_pc;
                        Info.ip                = item.ip;
                        Info.IdCentroCosto     = item.IdCentroCosto;
                        Info.IdSuccentroCosto  = item.IdSuccentroCosto;
                        Info.cedula_gasto      = item.cedula_gasto;
                        Info.descripcion_gasto = item.descripcion_gasto;
                        Info.valor_gasto       = item.valor_gasto;
                        list_fuerza.Add(Info);
                    }
                }
                return(list_fuerza);
            }
            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());
            }
        }
Beispiel #5
0
 private void gvw_fuerza_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         Info_Fuerza = gvw_fuerza.GetRow(e.FocusedRowHandle) as ro_fuerza_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());
     }
 }
Beispiel #6
0
        public List <ro_fuerza_Info> Get_List_MO(int IdEmpresa)
        {
            List <ro_fuerza_Info> list_fuerza = new List <ro_fuerza_Info>();

            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    var contact = from q in Context.ro_fuerza
                                  where q.IdEmpresa == IdEmpresa &&
                                  q.IdFuerza > 0
                                  select q;

                    foreach (var item in contact)
                    {
                        ro_fuerza_Info Info = new ro_fuerza_Info();
                        Info.IdEmpresa         = item.IdEmpresa;
                        Info.IdFuerza          = item.IdFuerza;
                        Info.fu_descripcion    = item.fu_descripcion;
                        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;
                        Info.MotivoAnulacion   = item.MotivoAnulacion;
                        Info.nom_pc            = item.nom_pc;
                        Info.ip                = item.ip;
                        Info.IdCentroCosto     = item.IdCentroCosto;
                        Info.IdSuccentroCosto  = item.IdSuccentroCosto;
                        Info.cedula_gasto      = item.cedula_gasto;
                        Info.descripcion_gasto = item.descripcion_gasto;
                        Info.valor_gasto       = item.valor_gasto;

                        list_fuerza.Add(Info);
                    }
                }
                return(list_fuerza);
            }
            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());
            }
        }
Beispiel #7
0
 public void Set_Info(ro_fuerza_Info _Info_Disco)
 {
     try
     {
         Info_Fuerza = _Info_Disco;
     }
     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());
     }
 }
Beispiel #8
0
 public bool AnularDB(ro_fuerza_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);
     }
 }
Beispiel #9
0
        public ro_fuerza_Info Get_Info_Fuerza(int IdEmpresa, int IdFuerza)
        {
            try
            {
                ro_fuerza_Info Info = new ro_fuerza_Info();
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    var contact = from q in Context.ro_fuerza
                                  where q.IdEmpresa == IdEmpresa &&
                                  q.IdFuerza == IdFuerza
                                  select q;

                    foreach (var item in contact)
                    {
                        Info.IdEmpresa         = item.IdEmpresa;
                        Info.IdFuerza          = item.IdEmpresa;
                        Info.fu_descripcion    = item.fu_descripcion;
                        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;
                        Info.MotivoAnulacion   = item.MotivoAnulacion;
                        Info.nom_pc            = item.nom_pc;
                        Info.ip = item.ip;
                    }
                }
                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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }