private void Set_Client_fields()
        {
            //NOTE: lb_clientID is currently being used as NAME label, until i make Name field a unquie key)
            Label[]       labels = { lb_clientID, lb_clientAddress, lb_clientTelephone, lb_clientMobile, lb_clientEmail, lb_clientLatepaid };
            List <string> Cdata  = sql.FillForm(FM_LoginScreen.conString, "ClientTable", cb_clientName.Text);

            // Seting fields ( note 4 data strings to lb_clientaddress label )
            lb_clientAddress.Text = ""; // set address field to empty

            int data = 1;

            for (int i = 0; i < labels.Length; i++)
            {
                if (i == 1)                                   // if we are on client addresslabel
                {
                    for (int ii = 2; ii < 6; ii++, data++)    // loop 4 sets of data
                    {
                        labels[i].Text += Cdata[data] + "\n"; // setting address label
                    }
                }
                else
                {
                    labels[i].Text = Cdata[data]; data++;
                }                                              // setting all other labels
            }
        }
        // set fields with current selected client in combo box ( make sure combo box Text is an int )
        private void Set_fields()
        {
            TextBox[]     o_fields = { tb_clientName, tb_addressL1, tb_addressL2, tb_postcode, tb_city, tb_telephone, tb_mobile, tb_email };
            List <string> l_fields = sql.FillForm(FM_LoginScreen.conString, "ClientTable", cb_clientselection.Text);

            for (int i = 0; i < (o_fields.Length); i++)
            {
                o_fields[i].Text = l_fields[i + 1];
            }
            lb_clientID.Text = l_fields[0];
            if (l_fields[l_fields.Count - 1] == "null")
            {
                lb_latepayments.Text = "0";
            }
            else
            {
                lb_latepayments.Text = l_fields[l_fields.Count - 1];
            }
        }
Example #3
0
 private void SetClientInfoList()
 {
     _client_data = sql.FillForm(FM_LoginScreen.conString, "ClientTable", cb_clientID.Text);
     FillForm();
 }