コード例 #1
0
ファイル: ClientForm.cs プロジェクト: BillTheBest/opencbs
 private void buttonViewAGarantors_Click(object sender, EventArgs e)
 {
     if (listViewGuarantors.SelectedItems.Count != 0)
     {
         try
         {
             AddGuarantorForm modifyGuarantor = new AddGuarantorForm((Guarantor)listViewGuarantors.SelectedItems[0].Tag, MdiParent, true, _credit.Product.Currency);
             modifyGuarantor.ShowDialog();
         }
         catch (NullReferenceException)
         {
             MessageBox.Show(@"Please select proper item from the guarantor list!");
         }
     }
 }
コード例 #2
0
ファイル: ClientForm.cs プロジェクト: BillTheBest/opencbs
        private void SelectAGuarantors()
        {
            var addGuarantor = new AddGuarantorForm(MdiParent, _credit.Product.Currency);
            addGuarantor.ShowDialog();

            if (!ServicesProvider.GetInstance().GetClientServices().GuarantorIsNull(addGuarantor.Guarantor))
            {
                if (_person != null)
                {
                    if (_person.Id != addGuarantor.Guarantor.Tiers.Id)
                    {
                        _listGuarantors.Add(addGuarantor.Guarantor);
                        DisplayGuarantors(_listGuarantors, _credit.Amount);
                        SaveContract();
                    }
                    else
                        MessageBox.Show(@"Person can not be a guarantor to himself/herself!", "Warning!",
                            MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    _listGuarantors.Add(addGuarantor.Guarantor);
                    DisplayGuarantors(_listGuarantors, _credit.Amount);
                    SaveContract();
                }
            }
        }
コード例 #3
0
ファイル: ClientForm.cs プロジェクト: BillTheBest/opencbs
        private void buttonModifyAGarantors_Click(object sender, EventArgs e)
        {
            if (listViewGuarantors.SelectedItems.Count != 0)
            {
                try
                {
                    AddGuarantorForm modifyGuarantor = new AddGuarantorForm((Guarantor)listViewGuarantors.SelectedItems[0].Tag, MdiParent, false, _credit.Product.Currency);
                    modifyGuarantor.ShowDialog();
                    if (!ServicesProvider.GetInstance().GetClientServices().GuarantorIsNull(modifyGuarantor.Guarantor))
                        DisplayGuarantors(_listGuarantors, _credit.Amount);

                }
                catch (NullReferenceException)
                {
                    MessageBox.Show("Please select proper item from the guarantor list!");
                }
            }
        }