示例#1
0
        private void marcasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmMakes frmMakes = new frmMakes();

            frmMakes.Show();
            Hide();
        }
示例#2
0
 private void btnSave_Click(object sender, System.EventArgs e)
 {
     if (IsValid())
     {
         Make make = rentACarEntities.Makes.Where(m => m.Id == Make.Id).FirstOrDefault();
         make.Description = txtDescription.Text;
         rentACarEntities.Entry(make).State = System.Data.Entity.EntityState.Modified;
         rentACarEntities.SaveChanges();
         MessageBox.Show("La marca fue editada correctamente.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
         frmMakes frmMakes = new frmMakes();
         frmMakes.Show();
         Hide();
     }
 }
示例#3
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            if (IsValid())
            {
                rentACarEntities.Makes.Add(new Make()
                {
                    Description = txtDescription.Text,
                    Status      = true,
                    Created     = DateTime.Now
                });

                rentACarEntities.SaveChanges();

                MessageBox.Show("La marca fue agregada correctamente.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                frmMakes frmMakes = new frmMakes();
                frmMakes.Show();
                Close();
            }
        }