protected void closeProjectButton_Click(object sender, EventArgs e) { if (projectDropDownList.SelectedIndex.Equals(0)) { errorLabel.Text = "Please select a project"; return; } try { Project projectObject = new Project(); projectObject.ID = projectDropDownList.SelectedItem.Value; projectObject.Status = "Close"; ProjectGateway ProjectGatewayObject = new ProjectGateway(); string message = ProjectGatewayObject.CloseProject(projectObject).ToString(); successLabel.Text = "Project has been closed"; errorLabel.Text = ""; LoadAllOpenProject(); } catch (SqlException sqlExceptionObject) { errorLabel.Text = sqlExceptionObject.Message; } catch (Exception exceptionObject) { errorLabel.Text = exceptionObject.Message; } }