コード例 #1
0
        public void modificar()
        {
            string mensaje = "";

            if (txtId.Text == string.Empty)
            {
                mensaje = mensaje + "Introduce la Clave \n";
            }
            if (txtNombre.Text == string.Empty)
            {
                mensaje = mensaje + "Introduce el contenido\n";
            }

            if (mensaje.Trim().Length == 0)
            {
                BO.Sinopsis            obj     = new BO.Sinopsis();
                Servicios.SinopsisCtrl objCtrl = new Servicios.SinopsisCtrl();
                obj.Id_sinopsis = Convert.ToInt32(txtId.Text);
                obj.Contenido   = txtNombre.Text;
                string msn = objCtrl.actualizaObj(obj);
                if (msn == "La operación se realizó de manera correcta")
                {
                    Response.Redirect("wfTablaSinopsis.aspx");
                }
                else
                {
                    Mensaje(msn);
                }
            }
            else
            {
                Mensaje("Favor de ingresar los siguientes datos:\n" + mensaje);
            }
        }
コード例 #2
0
        public void agregar()
        {
            string mensaje = "";

            if (txtNombre.Text == string.Empty)
            {
                mensaje += "Introduce el contenido\n";
            }

            if (mensaje.Trim().Length == 0)
            {
                BO.Sinopsis            obj     = new BO.Sinopsis();
                Servicios.SinopsisCtrl objCtrl = new Servicios.SinopsisCtrl();
                obj.Contenido = txtNombre.Text;
                string msn = objCtrl.creaSinopsis(obj);
                if (msn == "La operación se realizó de manera correcta")
                {
                    Response.Redirect("wfTablaSinopsis.aspx");
                }
                else
                {
                    Mensaje(msn);
                }
            }
            else
            {
                Mensaje("Favor de ingresar los siguientes datos:\n" + mensaje);
            }
        }
コード例 #3
0
        public void DoOpen()
        {
            BO.Sinopsis            oSinopsis     = new BO.Sinopsis();
            Servicios.SinopsisCtrl oSinopsisCtrl = new Servicios.SinopsisCtrl();
            DataTable dt = oSinopsisCtrl.devuelveObj(oSinopsis);

            gvSinopsis.DataSource = dt;
            gvSinopsis.DataBind();
        }
コード例 #4
0
        public void buscar()
        {
            BO.Sinopsis            obj     = (BO.Sinopsis)Session["frmSinopsisBO"];
            Servicios.SinopsisCtrl objCtrl = new Servicios.SinopsisCtrl();
            DataTable dt = objCtrl.devuelveObj(obj);

            if (dt.Rows.Count != 0)
            {
                txtId.Text     = dt.Rows[0]["id_sinopsis"].ToString();
                txtNombre.Text = dt.Rows[0]["contenido"].ToString();
            }
        }
コード例 #5
0
        public void eliminar()
        {
            BO.Sinopsis            obj     = (BO.Sinopsis)Session["frmSinopsisBO"];
            Servicios.SinopsisCtrl objCtrl = new Servicios.SinopsisCtrl();
            obj.Id_sinopsis = Convert.ToInt32(txtId.Text.Trim());
            string mensaje = objCtrl.eliminaObj(obj);

            if (mensaje == "La operación se realizó de manera correcta")
            {
                Response.Redirect("wfTablaCategoria.aspx");
            }
            else
            {
                Mensaje(mensaje);
            }
        }