Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public void SaveData()
        {
            if (!IsValid())
            {
                return;
            }

            if (IsInserting)
            {
                Data = new MsEmployee();
            }

            Data.Password = textBox2.Text;

            if (IsInserting)
            {
                db.MsEmployee.Add(Data);
            }

            db.SaveChanges();
            clear();
        }