Esempio n. 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            MasterPass master = new MasterPass();

            master.ShowDialog();
            if (master.Result())
            {
                // update failure for fail record
                try
                {
                    BLFailRecord failRecord = new BLFailRecord();
                    failRecord.UpdateFailureForFailrecord(oldId, Convert.ToInt32(numNewId.Value));
                }
                catch (Exception)
                {
                    MessageBox.Show("Lỗi chuyển tên sự cố ");
                }


                try
                {
                    //delete failure
                    Failure fail = new Failure();
                    fail.Remove(oldId);
                    MessageBox.Show("Đã xóa !");
                    result = true;
                    this.Close();
                }
                catch (Exception)
                {
                    MessageBox.Show("Lỗi xóa fail Record");
                }
            }
        }
 private void btnRemove_Click(object sender, EventArgs e)
 {
     try
     {
         MasterPass master = new MasterPass();
         master.ShowDialog();
         if (master.Result())
         {
             fail.RemoveEquip(Convert.ToInt32(txtId.Text));
             txtId.Clear();
             LoadData();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Can not remove equip. Please again !");
     }
 }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         MasterPass master = new MasterPass();
         master.ShowDialog();
         if (master.Result())
         {
             fail.AddEquip(txtEquipName.Text);
             txtEquipName.Clear();
             LoadData();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Can not add equip. Please again !");
     }
 }