Exemple #1
0
        private void MostrarDatos()
        {
            Metodo oRegistro = new Metodo();

            oRegistro      = (Metodo)oRegistro.Get(typeof(Metodo), int.Parse(Request["id"].ToString()));
            txtNombre.Text = oRegistro.Nombre;
        }
        private void Eliminar(object p)
        {
            Metodo oRegistro = new Metodo();

            oRegistro = (Metodo)oRegistro.Get(typeof(Metodo), int.Parse(p.ToString()));
            Usuario oUser = new Usuario();

            oRegistro.Baja = true;
            oRegistro.IdUsuarioRegistro = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
            oRegistro.FechaRegistro     = DateTime.Now;
            oRegistro.Save();
        }
Exemple #3
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Metodo oRegistro = new Metodo();
                if (Request["id"] != null)
                {
                    oRegistro = (Metodo)oRegistro.Get(typeof(Metodo), int.Parse(Request["id"].ToString()));
                }
                Guardar(oRegistro);

                if (Request["id"] != null)
                {
                    Response.Redirect("MetodoList.aspx", false);
                }
                else
                {
                    Response.Redirect("MetodoEdit.aspx", false);
                }
            }
        }