Esempio n. 1
0
        public void RevisaEstado()
        {
            CLSRFC estado = new CLSRFC();

            estado.ObtenerEstado();
            if (estado.Estado.Equals("D"))
            {
                MessageBox.Show("Se ha detectado que el Sistema de Contingencia se encuentra deshabilitado, imposible continuar con la aplicaión!");
                Application.Exit();
            }
        }
Esempio n. 2
0
        protected string ConsultarEstado(string psCriterio)
        {
            DataSet        ds     = new DataSet();
            SqlDataAdapter da     = new SqlDataAdapter();
            string         estado = "";
            CLSRFC         claseEstado;

            try
            {
                da.SelectCommand             = new SqlCommand(Procedimientos.sp_ConsEstado, this.Conexion);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.Add("@Criterio", SqlDbType.VarChar).Value = psCriterio;
                da.Fill(ds);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    int renglones = ds.Tables[0].Rows.Count;
                    int columnas  = ds.Tables[0].Columns.Count;

                    for (int contador = 0; contador < ds.Tables[0].Rows.Count; contador++)
                    {
                        claseEstado        = new CLSRFC();
                        claseEstado.Estado = ds.Tables[0].Rows[contador]["EstadoContingencia"].ToString().Trim();
                        estado             = claseEstado.Estado;
                    }
                }

                return(estado);
            }
            catch (Exception ex)
            {
                throw new Exception(Errores.ConsultarRegistro + Errores.MensajeOriginal + ex.Message.ToString());
            }
            finally
            {
                this.Conexion.Close();
            }
        }