private void button6_Click(object sender, EventArgs e) { try { pointReferences(); if (Convert.ToInt32(label9.Text) > 0) { InvestmentGroup aInvestmentGroup = new InvestmentGroup(); aInvestmentGroup.ID = anInvestmentGroupDetail.InvestmentGroupID; var bindingList = InvestmentGroupDetailH.Show(aInvestmentGroup); var source = new BindingSource(bindingList, null); dataGridView_Member.DataSource = source; } else { MessageBox.Show("Please Select an Investment Group to show investment details against it.", "Investment Group Management", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (DataExistence ex) { MessageBox.Show(ex.Message, "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.Message, "Data Entry Error - Unhandled", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public BindingList <InvestmentGroupDetail> Show(InvestmentGroup aType) { try { var myList = new InvestmentGroupDetailDataHelper().SelectByGroupID(aType.ID); var bindingList = new BindingList <InvestmentGroupDetail>(myList); return(bindingList); } catch (ArgumentNullException) { throw new DataExistence("No Data Found! No Members are avialable in selected Investment group."); } }
private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e) { label9.Text = comboBox_InvestmentGroupID.SelectedValue.ToString(); if (Convert.ToInt32(label9.Text) > 0) { anInvestmentGroup.ID = Convert.ToInt32(label9.Text); anInvestmentGroup = investmentGroupH.Show(anInvestmentGroup.ID); textBox_InHand_Group.Text = Convert.ToString(anInvestmentGroup.InHand); textBox_BackUp_Group.Text = Convert.ToString(anInvestmentGroup.BackUp); textBox_TotalAmount_Group.Text = Convert.ToString(anInvestmentGroup.TotalAmount); } }
private void comboBox2_SelectionChangeCommitted(object sender, EventArgs e) { label_InvestmentGroupID.Text = comboBox_InvestmentGroupID.SelectedValue.ToString(); if (Convert.ToInt32(label_InvestmentGroupID.Text) > 0) { anInvestmentGroup.ID = Convert.ToInt32(label_InvestmentGroupID.Text); anInvestmentGroup = aInvestmentGroupH.GetItem(anInvestmentGroup.ID); //label16.Text = Convert.ToString(anInvestmentGroup.TotalAmount); label_Amount.Text = Convert.ToString(anInvestmentGroup.InHand); } else { //label16.Text = "0"; label_Amount.Text = "0"; } }
private void button3_Click(object sender, EventArgs e) { try { InvestmentGroupDetailH.Accumulate(anInvestmentGroup.ID); anInvestmentGroup = investmentGroupH.Show(anInvestmentGroup.ID); textBox_InHand_Group.Text = Convert.ToString(anInvestmentGroup.InHand); textBox_BackUp_Group.Text = Convert.ToString(anInvestmentGroup.BackUp); textBox_TotalAmount_Group.Text = Convert.ToString(anInvestmentGroup.TotalAmount); MessageBox.Show("Accumulation Done!", "Investment Group Data Entry", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "Data Entry Error - Unhandled", MessageBoxButtons.OK, MessageBoxIcon.Error); } }