コード例 #1
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         var department = new Department
         {
             DepartmentId = int.Parse(txtDId.Text),
             Name         = txtName.Text
         };
         var updated = departmentCRUD.UpdateDepartment(department);
         if (updated)
         {
             MessageBox.Show("Department's record updated successfully");
         }
         else
         {
             MessageBox.Show("Failed to update record!", "Note", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #2
0
ファイル: DepartmentService.cs プロジェクト: bisshh/Mtech
 public void UpdateDeparment(Department dataToBeUpdated)
 {
     departmentTableActions.UpdateDepartment(dataToBeUpdated);
 }