protected void BtnBuscar_Click(object sender, EventArgs e)
        {
            if (TXTBuscar.Text.Trim() == string.Empty)
            {
                TXTBuscar.BorderColor = System.Drawing.Color.Red;
                AlertaID.Visible      = true;
                ListarProblema();
            }
            else
            {
                Controlador.ControladorTareas AuxControladorTarea = new Controlador.ControladorTareas();

                Modelo.Reportar_Problema reportar = new Modelo.Reportar_Problema();

                reportar = AuxControladorTarea.ObtenerIDReportarProblema(Convert.ToInt32(TXTBuscar.Text));


                if (reportar.ID_PROBLEMA1 != Convert.ToInt32(TXTBuscar.Text))
                {
                    TXTBuscar.BorderColor    = System.Drawing.Color.Red;
                    AlertaIDNoExiste.Visible = true;
                    AlertaID.Visible         = false;
                }
                else
                {
                    TXTBuscar.BorderColor    = System.Drawing.Color.Green;
                    AlertaID.Visible         = false;
                    AlertaIDNoExiste.Visible = false;
                    ListarProblemaConFiltro();
                }
            }
        }
        protected void BtnAgregarMotivo_Click(object sender, EventArgs e)
        {
            if (TXTMotivo.Text.Trim() == string.Empty)
            {
                TXTBuscar.BorderColor = System.Drawing.Color.Red;
                Alerta.Visible        = true;
                AlertaExito.Visible   = false;
            }
            else
            {
                TXTMotivo.BorderColor = System.Drawing.Color.Green;
                Alerta.Visible        = false;
                AlertaExito.Visible   = true;

                Controlador.ControladorTareas AuxControladorTarea = new Controlador.ControladorTareas();

                Modelo.Reportar_Problema AuxReportar = new Modelo.Reportar_Problema();

                AuxReportar.ID_TAREA1 = Convert.ToInt32(IDTRANSFERIDO.Text);
                AuxReportar.Motivo1   = TXTMotivo.Text;
                AuxReportar.FechaHoy1 = DateTime.Today;

                AuxControladorTarea.ReportarProblema(AuxReportar);

                ListarProblema();
            }
        }
Ejemplo n.º 3
0
        public bool ReportarProblema(Modelo.Reportar_Problema reportar)
        {
            try
            {
                Conexion         conexion = new Conexion();
                OracleConnection conn     = new OracleConnection();
                conn = conexion.getConn();

                conn.Open();

                OracleCommand comando = new OracleCommand("AGREGARREPORTARPROBLEMA", conn);
                comando.CommandType = System.Data.CommandType.StoredProcedure;

                comando.Parameters.Add("@idtarea", OracleDbType.Int32).Value   = reportar.ID_TAREA1;
                comando.Parameters.Add("@motivo", OracleDbType.Varchar2).Value = reportar.Motivo1;
                comando.Parameters.Add("@fecha", OracleDbType.Date).Value      = reportar.FechaHoy1;

                comando.ExecuteNonQuery();

                conn.Close();
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
        public Modelo.Reportar_Problema ObtenerIDReportarProblema(int idproblema)
        {
            Modelo.Reportar_Problema reportar = new Modelo.Reportar_Problema();

            Conexion         conexion = new Conexion();
            OracleConnection conn     = new OracleConnection();

            conn = conexion.getConn();

            conn.Open();
            OracleCommand comando = new OracleCommand("SELECT * FROM REPORTAR_PROBLEMA WHERE ID_PROBLEMA = :IDPROBLEMA", conn);

            comando.Parameters.Add(":IDPROBLEMA", idproblema);

            OracleDataReader lector = comando.ExecuteReader();

            if (lector.Read())
            {
                reportar.ID_PROBLEMA1 = Convert.ToInt32(lector["ID_PROBLEMA"].ToString());
            }
            conn.Close();

            return(reportar);
        }