private void btnSave_Click(object sender, EventArgs e) { Data = new MsEmployee(); string id = Data.Id; db.MsEmployee.Find(id); if (Data == null) { MessageBox.Show("isi"); return; } IsInserting = false; SaveData(); }
public void SaveData() { if (!IsValid()) { return; } if (IsInserting) { Data = new MsEmployee(); } Data.Password = textBox2.Text; if (IsInserting) { db.MsEmployee.Add(Data); } db.SaveChanges(); clear(); }