private void ComboType_SelectedIndexChanged(object sender, EventArgs e)
 {
     NumCabel = pr.CabelExisting(ComboType.Text.Trim());
     if (ComboType.Text.Contains("M"))
     {
         ODU.Size    = new System.Drawing.Size(51, 20);
         label6.Text = "ODU";
         label5.Text = "Msan";
         ODU.Clear();
         ODU.Focus();
     }
     else
     {
         ODU.Clear();
         ODU.Size    = new System.Drawing.Size(0, 0);
         label6.Text = "";
         label5.Text = "كابل";
         CabinaCabel.Focus();
     }
 }
 private void ComboType_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter && ComboType.Text != string.Empty)
     {
         NumCabel = pr.CabelExisting(NumCentral.ToString() + ComboType.Text);
         if (ComboType.Text.Contains("M"))
         {
             ODU.Size    = new System.Drawing.Size(51, 20);
             label6.Text = "ODU";
             label5.Text = "Msan";
             ODU.Focus();
         }
         else
         {
             ODU.Size    = new System.Drawing.Size(0, 0);
             label6.Text = "";
             label5.Text = "كابل";
             CabinaCabel.Focus();
         }
     }
 }
 private void combocent_SelectedIndexChanged(object sender, EventArgs e)
 {
     NumCentral = pr.GetNumber(combocent.Text);
     if (combocent.Text != CentrlName)
     {
         CentrlName = combocent.Text;
         Main.CabelInfo.Clear();
         ComboType.Items.Clear();
         MyList.Clear();
         var DBonWork       = new DB.SmartCentralDB(Properties.Settings.Default.ConctToDataBase);
         var SelectAllCabel = (from c in DBonWork.Cabels
                               where c.IDcentral == NumCentral
                               select new { c.IDCable, c.CableNumber });
         foreach (var item in SelectAllCabel)
         {
             Main.CabelInfo.Add(item.IDCable, item.CableNumber);
             ComboType.Items.Add(item.CableNumber);
         }
         var j = from c in DBonWork.Cabels
                 where c.IDcentral == NumCentral
                 from p in DBonWork.Cabinas
                 where p.IDCable == c.IDCable
                 select p.CabinaGeneral;
         foreach (var item in j)
         {
             MyList.Add(item);
         }
     }
     if (button1.Text == "حفظ")
     {
         CabinaCabel.Clear();
     }
     label6.Text = "";
     ODU.Clear();
     ComboType.Focus();
 }