private void marcasToolStripMenuItem_Click(object sender, EventArgs e) { frmMakes frmMakes = new frmMakes(); frmMakes.Show(); Hide(); }
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(); } }
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(); } }