Esempio n. 1
0
 private void btnAddClient_Click(object sender, System.EventArgs e)
 {
     BPS.BLL.Clients.coInterestRates InterestRates = new BPS.BLL.Clients.coInterestRates();
     InterestRates.FillDSReqType();
     System.Data.DataView dvRates = new System.Data.DataView(InterestRates.DsInterestRates.InterestRate);
     dvRates.AllowDelete  =
         dvRates.AllowNew = false;
     dvRates.AllowEdit    = true;
     BPS._Forms.Clients.AddClient AddClientForm = new BPS._Forms.Clients.AddClient(base.dvGroups, dvRates);
     if (this.cmbGroups.SelectedIndex == -1 || this.cmbMembers.SelectedIndex == -1)
     {
         AddClientForm.tbClient.Text = this.cmbMembers.Text;
         AddClientForm.cmbGroup.Text = this.cmbGroups.Text;
     }
     AddClientForm.AddGroup += new BPS._Forms.Clients.AddClient.AddGroupEventHandler(AddGroup);
     AddClientForm.ShowDialog();
     if (AddClientForm.DialogResult == DialogResult.OK)
     {
         try
         {
             BPS.BLL.Clients.DataSets.dsClients.ClientsRow rw = (BPS.BLL.Clients.DataSets.dsClients.ClientsRow) this.dvMembers.Table.NewRow();
             rw.ClientGroupID = (int)AddClientForm.cmbGroup.SelectedValue;
             rw.ClientName    = AddClientForm.tbClient.Text;
             rw.ClientRemarks = AddClientForm.tbRemarks.Text;
             rw.IsInner       = false;
             rw.IsSpecial     = false;
             rw.Password      = AddClientForm.tbPassw.Text;
             this.dvMembers.Table.Rows.Add(rw);
             App.BPSClients.UpdateGroups();
             App.BPSClients.UpdateClients();
             this.cmbGroups.SelectedIndex  = this.dvGroups.Find(rw.ClientGroupID);
             this.cmbMembers.SelectedIndex = this.dvMembers.Find(rw.ClientID);
         }
         catch (Exception ex)
         {
             AM_Controls.MsgBoxX.Show(ex.Message, "BPS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
 }
Esempio n. 2
0
 public ClientView(BPS.BLL.Clients.DataSets.dsClients dsClnt, BPS.BLL.Clients.DataSets.dsGroups dsGroups)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     InterestRates           = new BPS.BLL.Clients.coInterestRates();
     this.dvClientRate.Table = dsInterestRate1.InterestRate;
     BPS.App.SetDataGridTableStyle(this.dataGridTableStyle2);
     this.BindingContext[this.dataView1].CurrentChanged += new EventHandler(BindingContextChange);
     this.dsClients1      = dsClnt;
     this.dataView1.Table = dsClients1.Clients;
     // Groups
     this.dvGroups.Table = dsGroups.ClientsGroups;
     // InterestRates
     dsInterestRate1         = InterestRates.DsInterestRates;
     this.dvClientRate.Table = dsInterestRate1.InterestRate;
     // ReqTypes
     InterestRates.FillDSReqType();
     // InterestRatesList
     InterestRates.FillDSInterestRateList();
     this.dsInterestRateList1 = this.InterestRates.DSInterestRateList;
     this.dvRateList.Table    = this.dsInterestRateList1.InterestRates;
 }