Пример #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();
 }
Пример #2
0
 public MateriaDesktop(int ID, ModoForm modo)
     : this()
 {
     this.Modo = modo;
     MateriaLogic materia = new MateriaLogic();
     MateriaActual = materia.GetOne(ID);
     MapearDeDatos();
 }
Пример #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;
 }
Пример #4
0
 public void Listar()
 {
     MateriaLogic ml = new MateriaLogic();
     try
     {
         this.dgvMaterias.DataSource = ml.GetAll();
     }
     catch (Exception Ex)
     {
         MessageBox.Show(Ex.Message);
     }
 }
Пример #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();
 }
Пример #6
0
 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;
     }    
 }
Пример #7
0
 public override void GuardarCambios()
 {
     MapearADatos();
     MateriaLogic materia = new MateriaLogic();
     materia.Save(MateriaActual);
 }
Пример #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();
            }
        }
Пример #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);
            }

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