private void radioButtonReserved_CheckedChanged(object sender, EventArgs e) { try { labelSystemMessage.Text = Constants.msgLabelDefault; labelSystemMessage.ForeColor = System.Drawing.Color.Black; dataGridViewUserBookActivity.DataSource = null; BookWSIntegration.BookWS bookWS = new BookWSIntegration.BookWS(); dataGridViewUserBookActivity.DataSource = bookWS.GetAllBooksReservedViewByUserId(staticUserID); dataGridViewUserBookActivity.Columns[Constants.fieldUser].Visible = false; dataGridViewUserBookActivity.Columns[Constants.fieldReserveId].Visible = false; dataGridViewUserBookActivity.Columns[Constants.fieldUserId].Visible = false; } catch (SoapException ex) { //Error log simulate Console.WriteLine(ex.ToString()); Console.WriteLine(ex.GetBaseException().ToString()); dataGridViewUserBookActivity.DataSource = null; labelSystemMessage.ForeColor = System.Drawing.Color.Red; labelSystemMessage.Text = Constants.msgErrorBusinessToUser + ex.Message; } catch (Exception ex) { //Error log simulate Console.WriteLine(ex.ToString()); Console.WriteLine(ex.GetBaseException().ToString()); dataGridViewUserBookActivity.DataSource = null; labelSystemMessage.ForeColor = System.Drawing.Color.Red; labelSystemMessage.Text = Constants.msgErrorSystemToUser; } }
private void ConsultAndCancelBookReservedForm_Load(object sender, EventArgs e) { try { BookWSIntegration.BookWS bookWS = new BookWSIntegration.BookWS(); dataGridViewBookReserved.DataSource = bookWS.GetAllBooksReservedViewByUserId(staticUserID); if (dataGridViewBookReserved.RowCount == 0) { labelSystemMessage.ForeColor = System.Drawing.Color.Red; labelSystemMessage.Text = Constants.msgNoMatchesFound; } else { dataGridViewBookReserved.Columns[Constants.fieldUser].Visible = false; dataGridViewBookReserved.Columns[Constants.fieldReserveId].Visible = false; dataGridViewBookReserved.Columns[Constants.fieldUserId].Visible = false; } } catch (SoapException ex) { //Error log simulate Console.WriteLine(ex.ToString()); Console.WriteLine(ex.GetBaseException().ToString()); dataGridViewBookReserved.DataSource = null; labelSystemMessage.ForeColor = System.Drawing.Color.Red; labelSystemMessage.Text = Constants.msgErrorBusinessToUser + ex.Message; } catch (Exception ex) { //Error log simulate Console.WriteLine(ex.ToString()); Console.WriteLine(ex.GetBaseException().ToString()); dataGridViewBookReserved.DataSource = null; labelSystemMessage.ForeColor = System.Drawing.Color.Red; labelSystemMessage.Text = Constants.msgErrorSystemToUser; } }