Exemple #1
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());
            }
        }
Exemple #2
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());
            }
        }