Exemple #1
0
 private void tsbEliminar_Click(object sender, EventArgs e)
 {
     int ID = ((Entidades.Materia)this.dgvMaterias.SelectedRows[0].DataBoundItem).IdMateria;
     MateriaLogic md = new MateriaLogic();
     md.Delete(ID);
     this.Listar();
 }
Exemple #2
0
 public MateriaDesktop(int ID, ModoForm modo)
     : this()
 {
     this.Modo = modo;
     MateriaLogic materia = new MateriaLogic();
     MateriaActual = materia.GetOne(ID);
     MapearDeDatos();
 }
Exemple #3
0
 protected void btnAceptar_Click(object sender, EventArgs e)
 {
     MateriaLogic ml = new MateriaLogic();
     listmateria = ml.GetAll(listplan[ddlPlan.SelectedIndex].ID);
     this.gvPlan.DataSource = listmateria;
     this.gvPlan.DataBind();
     this.gridPanel.Visible = true;
 }
Exemple #4
0
 public void Listar()
 {
     MateriaLogic ml = new MateriaLogic();
     try
     {
         this.dgvMaterias.DataSource = ml.GetAll();
     }
     catch (Exception Ex)
     {
         MessageBox.Show(Ex.Message);
     }
 }
Exemple #5
0
 public MateriaDesktop(int ID, ModoForm modo): this()
 {
     this.Modo = modo;
     MateriaLogic ml = new MateriaLogic();
     try
     {
         MateriaActual = ml.GetOne(ID);
     }
     catch (Exception Ex)
     {
         this.Notificar(Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     this.MapearDeDatos();
 }
 public MateriaDesktop(ModoForm modo,int ID): this()
 {
     _modo=modo;
     MateriaLogic ml = new MateriaLogic();
     MateriaActual = ml.GetOne(ID);
     this.MapearDeDatos();
     switch(_modo)
     {case ModoForm.Modificacion:
     btnAceptar.Text = "Guardar";
     break;
     case ModoForm.Baja:
     btnAceptar.Text = "Eliminar";
     break;
     case ModoForm.Consulta:
     btnAceptar.Text = "Aceptar";
     break;
     }    
 }
Exemple #7
0
 public override void GuardarCambios()
 {
     MapearADatos();
     MateriaLogic materia = new MateriaLogic();
     materia.Save(MateriaActual);
 }
Exemple #8
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (btnAceptar.Text == "Guardar")
            {
                if (Validar())
                {
                    GuardarCambios();
                    Plan planSeleccionado = listplan[cmbIDPlan.SelectedIndex];
                    MateriaActual.State = Entidad.States.Modificado;
                    this.Close();
                }
            }

            if (btnAceptar.Text == "Eliminar")
            {
                MateriaLogic mat = new MateriaLogic();
                mat.Delete(MateriaActual.ID);
                MateriaActual.State = Entidad.States.Eliminado;
                this.Close();
            }
        }
Exemple #9
0
        public void GuardarCambios()
        {
            this.MapearADatos();
            MateriaLogic Materia = new MateriaLogic();
            try
            {
                Materia.Save(MateriaActual);
            }
            catch (Exception Ex)
            {
                this.Notificar(Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

        }
 public override void GuardarCambios()
 {
     this.MapearADatos();
     MateriaLogic ml = new MateriaLogic();
     ml.Save(MateriaActual);
 }
Exemple #11
0
 public void Listar()
 {
     MateriaLogic ml = new MateriaLogic();
     this.dgvMaterias.DataSource = ml.GetAll();
 }
Exemple #12
0
 private void CargarMaterias(int IDPlan)
 {
     MateriaLogic ml = new MateriaLogic();
     ml.GetAll(IDPlan);
     DropDownListMateria.DataSource=listmat;
     DropDownListMateria.DataTextField= "Descripcion";
     DropDownListMateria.DataBind();
 }