示例#1
0
        private void llamar_Formulario(Cl_Enumeradores.eTipo_action Accion)
        {
            try
            {
                frm = new frmfa_Equipo_graf_Mant();

                if (Accion != Cl_Enumeradores.eTipo_action.grabar)
                {
                    Info_equipo = (fa_Equipo_graf_Info)cmb_Equipo.EditValue;
                    if (Info_equipo != null)
                    {
                        frm.Set_Info(Info_equipo);
                        frm.Set_Accion(Accion);
                        frm.Show();
                    }
                    else
                    {
                        MessageBox.Show("Para continuar seleccione un registro.", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    frm.Set_Accion(Accion);
                    frm.Show();
                }
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
示例#2
0
        public bool AnularDB(fa_Equipo_graf_Info Info, ref string mensaje)
        {
            try
            {
                using (EntitiesFacturacion_Grafinpren Context = new EntitiesFacturacion_Grafinpren())
                {
                    fa_Equipo_graf contact = Context.fa_Equipo_graf.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdEquipo == Info.IdEquipo);
                    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());
            }
        }
示例#3
0
        public bool GuardarDB(fa_Equipo_graf_Info Info, ref int IdEquipo, ref string mensaje)
        {
            try
            {
                IdEquipo = Get_Id(Info.IdEmpresa, ref mensaje);

                using (EntitiesFacturacion_Grafinpren Context = new EntitiesFacturacion_Grafinpren())
                {
                    fa_Equipo_graf contact = new fa_Equipo_graf();

                    contact.IdEmpresa         = Info.IdEmpresa;
                    contact.IdEquipo          = Info.IdEquipo = IdEquipo;
                    contact.nom_Equipo        = Info.nom_Equipo;
                    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.fa_Equipo_graf.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());
            }
        }
示例#4
0
 private void cmb_Activo_fijo_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         Info_equipo = (fa_Equipo_graf_Info)cmb_Equipo.Properties.View.GetFocusedRow();
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }
 private void gw_Equipo_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         Info_Equipo = gw_Equipo.GetRow(e.FocusedRowHandle) as fa_Equipo_graf_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(fa_Equipo_graf_Info _Info_Equipo)
 {
     try
     {
         Info_Equipo = _Info_Equipo;
     }
     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());
     }
 }
示例#7
0
 public bool AnularDB(fa_Equipo_graf_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);
     }
 }
示例#8
0
        public List <fa_Equipo_graf_Info> Get_List_Equipo(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 <fa_Equipo_graf_Info> Lista = new List <fa_Equipo_graf_Info>();

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

                    foreach (var item in lst)
                    {
                        fa_Equipo_graf_Info Info = new fa_Equipo_graf_Info();
                        Info.IdEmpresa         = item.IdEmpresa;
                        Info.IdEquipo          = item.IdEquipo;
                        Info.nom_Equipo        = item.nom_Equipo;
                        Info.estado            = item.estado;
                        Info.IdUsuario         = item.IdUsuario;
                        Info.Fecha_Transaccion = Convert.ToDateTime(item.Fecha_Transaccion);
                        Info.IdUsuarioUltModi  = item.IdUsuarioUltModi;
                        Info.Fecha_UltMod      = Convert.ToDateTime(item.Fecha_UltMod);
                        Info.IdUsuarioUltAnu   = item.IdUsuarioUltAnu;
                        Info.Fecha_UltAnu      = Convert.ToDateTime(item.Fecha_UltAnu);
                        Info.MotivoAnulacion   = item.MotivoAnulacion;
                        Info.nom_pc            = item.nom_pc;
                        Info.ip = item.ip;
                        Lista.Add(Info);
                    }
                }
                return(Lista);
            }
            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());
            }
        }
示例#9
0
 public fa_Equipo_graf_Info Get_Equipo()
 {
     try
     {
         if (cmb_Equipo.EditValue != null && (int)cmb_Equipo.EditValue != 0)
         {
             int IdEquipo = Convert.ToInt32(cmb_Equipo.EditValue);
             Info_equipo = List_Equipo.FirstOrDefault(q => q.IdEquipo == IdEquipo);
             return(Info_equipo);
         }
         else
         {
             return(new fa_Equipo_graf_Info());
         }
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
         return(new fa_Equipo_graf_Info());
     }
 }