Esempio n. 1
0
        public bool AnularDB(ro_placa_Info Info, ref string mensaje)
        {
            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_placa contact = Context.ro_placa.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdPlaca == Info.IdPlaca);
                    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());
            }
        }
Esempio n. 2
0
        public bool GuardarDB(ro_placa_Info Info, ref int IdPlaca, ref string mensaje)
        {
            try
            {
                IdPlaca = Get_Id(Info.IdEmpresa, ref mensaje);

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

                    contact.IdEmpresa         = Info.IdEmpresa;
                    contact.IdPlaca           = Info.IdPlaca = IdPlaca;
                    contact.Placa             = Info.Placa;
                    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_placa.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());
            }
        }
Esempio n. 3
0
 private void gvw_placa_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         Info_Placa = gvw_placa.GetRow(e.FocusedRowHandle) as ro_placa_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());
     }
 }
Esempio n. 4
0
 public void Set_Info(ro_placa_Info _Info_Disco)
 {
     try
     {
         Info_Placa = _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());
     }
 }
Esempio n. 5
0
 public bool AnularDB(ro_placa_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);
     }
 }
Esempio n. 6
0
        public List <ro_placa_Info> Get_List_Placa(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_placa_Info> list_placa = new List <ro_placa_Info>();

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

                    foreach (var item in lst)
                    {
                        ro_placa_Info Info = new ro_placa_Info();
                        Info.IdEmpresa         = item.IdEmpresa;
                        Info.IdPlaca           = item.IdPlaca;
                        Info.Placa             = item.Placa;
                        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;
                        list_placa.Add(Info);
                    }
                }
                return(list_placa);
            }
            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());
            }
        }
Esempio n. 7
0
        public List <ro_placa_Info> Get_List_Placa(int IdEmpresa)
        {
            List <ro_placa_Info> list_placa = new List <ro_placa_Info>();

            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    var contact = from q in Context.ro_placa
                                  where q.IdEmpresa == IdEmpresa
                                  select q;

                    foreach (var item in contact)
                    {
                        ro_placa_Info Info = new ro_placa_Info();
                        Info.IdEmpresa         = item.IdEmpresa;
                        Info.IdPlaca           = item.IdPlaca;
                        Info.Placa             = item.Placa;
                        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;
                        list_placa.Add(Info);
                    }
                }
                return(list_placa);
            }
            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());
            }
        }