Esempio n. 1
0
        private void Initialize()
        {
            tClientContractBindingSource = new BindingSource();
            ClientComboBox.DataSource    = TableClients;
            ClientComboBox.DisplayMember = "ClientName";
            ClientComboBox.ValueMember   = "ClientID";

            CurrencyComboBox.DataSource    = TableCurrency;
            CurrencyComboBox.DisplayMember = "CurrencyType";
            CurrencyComboBox.ValueMember   = "CurrencyTypeID";

            //tClientContractBindingSource = ClientPayments.ClientContractBindingSource.Filter = "ClientID = " + ClientComboBox.SelectedValue.ToString();
            ContractComboBox.DataSource    = ClientPayments.Filter(ClientComboBox.SelectedValue.ToString());
            ContractComboBox.DisplayMember = "ContractNumber";
            ContractComboBox.ValueMember   = "ContractId";

            FirmComboBox.DataSource    = TableFactory;
            FirmComboBox.DisplayMember = "FactoryName";
            FirmComboBox.ValueMember   = "FactoryID";
        }
        private void ClientComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            if (ClientCheckBox.Checked)
            {
                ContractFilteComboBox.DataSource = ClientPayments.Filter(((DataRowView)ClientComboBox.SelectedItem).Row["ClientID"].ToString());
                if (TPSCheckBox.Checked)
                {
                    FilterContractCheckBox.Checked = false;
                    ProfilCheckBox.Checked         = false;
                    ClientPayments.UpdateClientsPaymentsDataGrid(ClientComboBox.SelectedValue.ToString(), TPSCheckBox.Checked, ProfilCheckBox.Checked, ClientCheckBox.Checked);
                }
                else
                {
                    if (!ProfilCheckBox.Checked)
                    {
                        ClientPayments.GetAllPeriodPayments(ClientCheckBox.Checked, ClientComboBox.SelectedValue.ToString());
                        UpdateLabelPayments();
                    }
                }

                if (ProfilCheckBox.Checked)
                {
                    FilterContractCheckBox.Checked = false;
                    TPSCheckBox.Checked            = false;
                    ClientPayments.UpdateClientsPaymentsDataGrid(ClientComboBox.SelectedValue.ToString(), TPSCheckBox.Checked, ProfilCheckBox.Checked, ClientCheckBox.Checked);
                }
                else
                {
                    if (!TPSCheckBox.Checked)
                    {
                        ClientPayments.GetAllPeriodPayments(ClientCheckBox.Checked, ClientComboBox.SelectedValue.ToString());
                        UpdateLabelPayments();
                    }
                }
            }
        }