コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (condicionPago == null)
                {
                    Clases.CondicionPago newCondicionDePago = new Clases.CondicionPago();
                    newCondicionDePago.Nombre = nombre.Text;

                    context.CondicionesDePago.Add(newCondicionDePago);
                }
                else
                {
                    Clases.CondicionPago newCondicionDePago = context.CondicionesDePago.Find(condicionPago.CondicionPagoId);
                    newCondicionDePago.Nombre = nombre.Text;
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
コード例 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            int idCondicion = (int)dataGridView1.SelectedRows[0].Cells["CondicionPagoId"].Value;
            //
            FixamoContext context = new FixamoContext();

            Clases.CondicionPago condicionSeleccionado = context.CondicionesDePago.Find(idCondicion);
            condicionSeleccionado.Habilitado = false;
            context.SaveChanges();
            //
            this.AdministracionCondicionesDePago_Load(null, null);
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();

                Clases.CondicionPago newCondicionDePago = new Clases.CondicionPago();
                newCondicionDePago.Nombre = nombreAgregar.Text;

                FixamoContext context = new FixamoContext();
                context.CondicionesDePago.Add(newCondicionDePago);
                context.SaveChanges();

                limpiarDatos();

                this.AdministracionCondicionesDePago_Load(null, null);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
コード例 #4
0
 public AMCondicionesDePago(Clases.CondicionPago condicionPagoP)
 {
     InitializeComponent();
     condicionPago = condicionPagoP;
 }