예제 #1
0
        public bool AgregarRechazoSubTarea(Modelo.RechazoSubTarea rechazo)
        {
            try
            {
                Conexion         conexion = new Conexion();
                OracleConnection conn     = new OracleConnection();
                conn = conexion.getConn();

                conn.Open();
                OracleCommand comando = new OracleCommand("AGREGARRECHAZOSUBTAREA", conn);

                comando.CommandType = System.Data.CommandType.StoredProcedure;

                comando.Parameters.Add("ID_SUBTAREA", OracleDbType.Int32).Value       = rechazo.ID_SubTarea1;
                comando.Parameters.Add("MOTIVO_RECHAZO", OracleDbType.Varchar2).Value = rechazo.Motivo1;
                comando.Parameters.Add("FECHA_RECHAZO", OracleDbType.Date).Value      = rechazo.Fecha_Hoy1;


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

            return(true);
        }
        protected void BtnAgregarMotivo_Click(object sender, EventArgs e)
        {
            if (TXTMotivo.Text.Trim() == string.Empty)
            {
                TXTMotivo.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.ControladorRechazo AuxControladorRechazo = new Controlador.ControladorRechazo();

                Modelo.RechazoSubTarea rechazo = new Modelo.RechazoSubTarea();

                rechazo.ID_SubTarea1 = Convert.ToInt32(Filtro.Text);
                rechazo.Motivo1      = TXTMotivo.Text;
                rechazo.Fecha_Hoy1   = DateTime.Today;

                AuxControladorRechazo.AgregarRechazoSubTarea(rechazo);

                ListarRechazoSubTarea();
            }
        }