Пример #1
0
 private void ReadingsForm_Load(object sender, EventArgs e)
 {
     Gas_input_textBox.Hide();
     Light_input_textBox.Hide();
     Water_input_textBox.Hide();
     Mobile_input_textBox.Hide();
     Tenant_Name_input_textBox.Hide();
     Tenant_Name_textBox.Hide();
     Mobile_textBox.Hide();
     Water_textBox.Hide();
     Light_textBox.Hide();
     Gas_textBox.Hide();
     Fill_Apart();
     currentAppart = apart_listBox.SelectedIndex;
 }
Пример #2
0
        private void ShowReadings()
        {
            if (currentAppart != -1)
            {
                foreach (Apartment a in apList)
                {
                    if (a.Index == currentAppart)
                    {
                        Tenant_Name_input_textBox.Text     = a.owner.Name;
                        Tenant_Name_input_textBox.ReadOnly = true;
                        Tenant_Name_input_textBox.Enabled  = false;
                        Mobile_input_textBox.Text          = a.owner.Mobile;
                        Mobile_input_textBox.ReadOnly      = true;
                        Mobile_input_textBox.Enabled       = false;
                        Water_input_textBox.Text           = a.ReadWater;
                        Water_input_textBox.ReadOnly       = true;
                        Water_input_textBox.Enabled        = false;
                        Light_input_textBox.Text           = a.ReadLight;
                        Light_input_textBox.ReadOnly       = true;
                        Light_input_textBox.Enabled        = false;
                        Gas_input_textBox.Text             = a.ReadGas;
                        Gas_input_textBox.ReadOnly         = true;
                        Gas_input_textBox.Enabled          = false;

                        Gas_input_textBox.Show();
                        Light_input_textBox.Show();
                        Water_input_textBox.Show();
                        Mobile_input_textBox.Show();
                        Tenant_Name_input_textBox.Show();
                        Tenant_Name_textBox.Show();
                        Tenant_Name_textBox.ReadOnly = true;
                        Tenant_Name_textBox.Enabled  = false;
                        Mobile_textBox.Show();
                        Mobile_textBox.ReadOnly = true;
                        Mobile_textBox.Enabled  = false;
                        Water_textBox.Show();
                        Water_textBox.ReadOnly = true;
                        Water_textBox.Enabled  = false;
                        Light_textBox.Show();
                        Light_textBox.ReadOnly = true;
                        Light_textBox.Enabled  = false;
                        Gas_textBox.Show();
                        Gas_textBox.ReadOnly = true;
                        Gas_textBox.Enabled  = false;
                    }
                }
            }
        }
Пример #3
0
 private void ShowTextBoxes(string str)
 {
     HideTextBoxes();
     // show global atributts
     Name_textBox.Show();
     Name_input_textBox.Show();
     Mobile_textBox.Show();
     Mobile_input_textBox.Show();
     Email_OR_Address_textBox.Show();
     Email_OR_Address_input_textBox.Show();
     Tax_Number_textBox.Show();
     Tax_Number_input_textBox.Show();
     if (str.Equals("tenant"))
     {
         // Show Tenant only attributs
         Email_OR_Address_textBox.Text = "Email:";
         Apartment_textBox.Show();
         if (AddTenant || edit)
         {
             EnableAllWriteTextboxes();
             apart_comboBox.Show();
         }
         else
         {
             DisableAllWriteTextboxes();
             apart_input_textBox.Show();
         }
     }
     else if (str.Equals("sp"))
     {
         // Show Service Provider only attributs
         Email_OR_Address_textBox.Text = "Address:";
         Type_textBox.Show();
         if (AddSP || edit)
         {
             EnableAllWriteTextboxes();
             type_comboBox.Show();
             //TODO fill dropdown
         }
         else
         {
             DisableAllWriteTextboxes();
             Type_input_textBox.Show();
         }
     }
 }
Пример #4
0
        private void HideTextBoxes()
        {
            // Hide Contact Info
            Name_textBox.Hide();
            Name_input_textBox.Hide();

            Mobile_textBox.Hide();
            Mobile_input_textBox.Hide();

            Email_OR_Address_textBox.Hide();
            Email_OR_Address_input_textBox.Hide();

            Type_textBox.Hide();
            Apartment_textBox.Hide();

            Type_input_textBox.Hide();
            apart_input_textBox.Hide();

            apart_comboBox.Hide();
            type_comboBox.Hide();

            Tax_Number_textBox.Hide();
            Tax_Number_input_textBox.Hide();
        }