Ejemplo n.º 1
0
        public ro_sala_Info Get_Info_sala(int IdEmpresa, int idsala)
        {
            try
            {
                ro_sala_Info Info = new ro_sala_Info();
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    var contact = from q in Context.ro_sala
                                  where q.IdEmpresa == IdEmpresa &&
                                  q.IdSala == idsala
                                  select q;

                    foreach (var item in contact)
                    {
                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdSala    = item.IdSala;
                        Info.Sala      = item.Sala;
                        Info.Estado    = item.Estado;
                        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());
            }
        }
Ejemplo n.º 2
0
 public bool AnularDB(ro_sala_Info Info, ref string mensaje)
 {
     try
     {
         using (EntityRoles_FJ Context = new EntityRoles_FJ())
         {
             ro_sala contact = Context.ro_sala.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdSala == Info.IdSala);
             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());
     }
 }
Ejemplo n.º 3
0
        public bool GuardarDB(ro_sala_Info Info, ref int IdRuta, ref string mensaje)
        {
            try
            {
                IdRuta = Get_Id(Info.IdEmpresa);

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

                    contact.IdEmpresa         = Info.IdEmpresa;
                    contact.IdSala            = Get_Id(Info.IdEmpresa);
                    contact.Sala              = Info.Sala;
                    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_sala.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());
            }
        }
Ejemplo n.º 4
0
 private void gvw_ruta_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         Info_sala = gvw_ruta.GetRow(e.FocusedRowHandle) as ro_sala_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());
     }
 }
Ejemplo n.º 5
0
 public bool AnularDB(ro_sala_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);
     }
 }
Ejemplo n.º 6
0
 public void Set_Info(ro_sala_Info _Info_Ruta)
 {
     try
     {
         Info_sala = _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());
     }
 }
Ejemplo n.º 7
0
        public List <ro_sala_Info> Get_List_sala(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_sala_Info> list_Ruta = new List <ro_sala_Info>();

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

                    foreach (var item in lst)
                    {
                        ro_sala_Info Info = new ro_sala_Info();
                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdSala    = item.IdSala;
                        Info.Sala      = item.Sala;
                        Info.Estado    = item.Estado;
                        list_Ruta.Add(Info);
                    }
                }
                return(list_Ruta);
            }
            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());
            }
        }