Beispiel #1
0
        private void ClientClick(UInt32 ClientID_UL)
        {
            // Load client info in each control
            String        SQLRequest_ST;
            SqlDataReader SqlDataReader_O;
            UInt32        TypeSocID_UL = 0;
            UInt32        CPID_UL      = 0;

            int RappConf_i = 0, NoteEnvoi_i = 0, Certif_i = 0;

            // Fill info in panel edit controls
            mInitializingData_b = true;

            TxtClientNumber.Clear();
            TxtClientName.Clear();
            TxtTel.Clear();
            TxtFax.Clear();
            TxtAdressFact.Clear();
            TxtAdressLivr.Clear();
            TxtContactMail.Clear();
            TxtContactTel.Clear();
            TxtContactName.Clear();
            TxtTVA.Clear();
            TxtMail.Clear();
            TxtRem.Clear();

            CheckBoxRappConf.Checked = false;
            CheckBoxNE.Checked       = false;
            CheckBoxCertif.Checked   = false;

            DBComboxTypeSoc.ClearSelectedItem();
            DBComboxCPFact.ClearSelectedItem();
            DBComboxCPLivr.ClearSelectedItem();
            DBComboxCPLibFact.ClearSelectedItem();
            DBComboxCPLibLivr.ClearSelectedItem();

            mInitializingData_b = false;


            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                SQLRequest_ST       = "SELECT * FROM Client WHERE ClientID=" + ClientID_UL;
                SqlDataReader_O     = mDBManager_O.Select(SQLRequest_ST);
                mInitializingData_b = true;

                while (SqlDataReader_O.Read())
                {
                    int.TryParse(SqlDataReader_O["RappConf"].ToString(), out RappConf_i);
                    int.TryParse(SqlDataReader_O["NoteEnvoi"].ToString(), out NoteEnvoi_i);
                    int.TryParse(SqlDataReader_O["Certif"].ToString(), out Certif_i);

                    // Fill info in panel edit controls
                    TxtClientNumber.Text = SqlDataReader_O["NumClientInterne"].ToString();
                    TxtClientName.Text   = SqlDataReader_O["ClientNom"].ToString();
                    TxtTel.Text          = SqlDataReader_O["ClientTel"].ToString();
                    TxtFax.Text          = SqlDataReader_O["ClientFax"].ToString();
                    TxtAdressFact.Text   = SqlDataReader_O["AdresseFact"].ToString();
                    TxtAdressLivr.Text   = SqlDataReader_O["AdresseLivraison"].ToString();
                    TxtContactMail.Text  = SqlDataReader_O["ContactEmail"].ToString();
                    TxtContactTel.Text   = SqlDataReader_O["ContactTel"].ToString();
                    TxtContactName.Text  = SqlDataReader_O["Contact"].ToString();
                    TxtTVA.Text          = SqlDataReader_O["NrTVA"].ToString();
                    TxtMail.Text         = SqlDataReader_O["ClientMail"].ToString();
                    TxtRem.Text          = SqlDataReader_O["ClientRem"].ToString();

                    CheckBoxRappConf.Checked = RappConf_i != 0 ? true : false;
                    CheckBoxNE.Checked       = NoteEnvoi_i != 0 ? true : false;
                    CheckBoxCertif.Checked   = Certif_i != 0 ? true : false;

                    if (UInt32.TryParse(SqlDataReader_O["TypeSocID"].ToString(), out TypeSocID_UL))
                    {
                        DBComboxTypeSoc.SelectItemByID(TypeSocID_UL);
                    }

                    if (UInt32.TryParse(SqlDataReader_O["CodePostalFactID"].ToString(), out CPID_UL))
                    {
                        DBComboxCPFact.SelectItemByID(CPID_UL);
                        DBComboxCPLibFact.SelectItemByID(CPID_UL);
                    }
                    else
                    {
                        DBComboxCPFact.ClearSelectedItem();
                        DBComboxCPLibFact.ClearSelectedItem();
                    }

                    if (UInt32.TryParse(SqlDataReader_O["CodePostalLivraisonID"].ToString(), out CPID_UL))
                    {
                        DBComboxCPLivr.SelectItemByID(CPID_UL);
                        DBComboxCPLibLivr.SelectItemByID(CPID_UL);
                    }
                    else
                    {
                        DBComboxCPLivr.ClearSelectedItem();
                        DBComboxCPLibLivr.ClearSelectedItem();
                    }

                    // Refresh job recap
                    if (!String.IsNullOrEmpty(SqlDataReader_O["ClientNom"].ToString()))
                    {
                        DBListViewComjobRecap.SetInitialFilter("ClientNom='" + SqlDataReader_O["ClientNom"].ToString() + "'", "DelaiPromis desc");
                        DBListViewComjobRecap.Refresh();
                    }
                }

                SqlDataReader_O.Close();
                mInitializingData_b = false;
            }
        }
Beispiel #2
0
        private void ProviderClick(UInt32 ProviderID_UL)
        {
            // Load provider info in each control
            String        SQLRequest_ST;
            SqlDataReader SqlDataReader_O;
            UInt32        TypeSocID_UL = 0;
            UInt32        CPID_UL      = 0;

            mInitializingData_b = true;

            TxtProviderNumber.Clear();
            TxtProviderName.Clear();
            TxtTel.Clear();
            TxtFax.Clear();
            TxtAdressFact.Clear();
            TxtContactMail.Clear();
            TxtContactTel.Clear();
            TxtContactName.Clear();
            TxtTVA.Clear();
            TxtMail.Clear();
            TxtRem.Clear();

            DBComboxTypeSoc.ClearSelectedItem();
            DBComboxCPFact.ClearSelectedItem();
            DBComboxCPLibFact.ClearSelectedItem();

            mInitializingData_b = false;

            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                SQLRequest_ST       = "SELECT * FROM Fourn WHERE FournID=" + ProviderID_UL;
                SqlDataReader_O     = mDBManager_O.Select(SQLRequest_ST);
                mInitializingData_b = true;

                while (SqlDataReader_O.Read())
                {
                    // Fill info in panel edit controls
                    TxtProviderNumber.Text = SqlDataReader_O["NumFournInterne"].ToString();
                    TxtProviderName.Text   = SqlDataReader_O["FournNom"].ToString();
                    TxtTel.Text            = SqlDataReader_O["FournTel"].ToString();
                    TxtFax.Text            = SqlDataReader_O["FournFax"].ToString();
                    TxtAdressFact.Text     = SqlDataReader_O["Adresse"].ToString();
                    TxtContactMail.Text    = SqlDataReader_O["ContactEmail"].ToString();
                    TxtContactTel.Text     = SqlDataReader_O["ContactTel"].ToString();
                    TxtContactName.Text    = SqlDataReader_O["Contact"].ToString();
                    TxtTVA.Text            = SqlDataReader_O["NrTVA"].ToString();
                    TxtMail.Text           = SqlDataReader_O["FournMail"].ToString();
                    TxtRem.Text            = SqlDataReader_O["FournRem"].ToString();

                    if (UInt32.TryParse(SqlDataReader_O["TypeSocID"].ToString(), out TypeSocID_UL))
                    {
                        DBComboxTypeSoc.SelectItemByID(TypeSocID_UL);
                    }
                    if (UInt32.TryParse(SqlDataReader_O["CodePostalID"].ToString(), out CPID_UL))
                    {
                        DBComboxCPFact.SelectItemByID(CPID_UL);
                        DBComboxCPLibFact.SelectItemByID(CPID_UL);
                    }
                    else
                    {
                        DBComboxCPFact.ClearSelectedItem();
                        DBComboxCPLibFact.ClearSelectedItem();
                    }
                }

                SqlDataReader_O.Close();
                mInitializingData_b = false;
            }
        }