Exemplo n.º 1
0
 /// <summary>
 /// Выбор веса из списка
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void comboBoxWeight_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (curLab.lineType == 1)
     {
         comboBoxType.DataSource    = Conformity.WeightToType(comboBoxWeight.Text, comboBoxTPA.Text);
         comboBoxType.Enabled       = comboBoxType.Items.Count > 1;
         comboBoxCount.SelectedItem = Conformity.WeightToCount(comboBoxWeight.Text, comboBoxTPA.Text);
     }
     comboBoxColorants.SelectedItem = Conformity.NameAndColorToCode(comboBoxWeight.Text, comboBoxColor.Text);
     MakeSaveEnable();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Обновление кнопочек на главном окне в соответствии на настройками
 /// </summary>
 void RefreshMain()
 {
     labelClock.Text    = DateTime.Now.ToString("HH:mm");
     labelClock.Visible = true;
     if (Data.isTerminal)
     {
         labelformname.Text = "Выбор Линии";
         buttonShift.Text   = Shift.Current;
     }
     else
     {
         labelformname.Text = Shift.Current;
         смена1ToolStripMenuItem.Checked = Shift.Current == Shift.Names[0];
         смена2ToolStripMenuItem.Checked = Shift.Current == Shift.Names[1];
         смена3ToolStripMenuItem.Checked = Shift.Current == Shift.Names[2];
         смена4ToolStripMenuItem.Checked = Shift.Current == Shift.Names[3];
     }
     try
     {
         labelP1.Text  = Data.lines[0].LabelUnderButton();
         labelP2.Text  = Data.lines[1].LabelUnderButton();
         labelP3.Text  = Data.lines[2].LabelUnderButton();
         labelP4.Text  = Data.lines[3].LabelUnderButton();
         labelP5.Text  = Data.lines[4].LabelUnderButton();
         labelP6.Text  = Data.lines[5].LabelUnderButton();
         labelP7.Text  = Data.lines[6].LabelUnderButton();
         labelP8.Text  = Data.lines[7].LabelUnderButton();
         labelP9.Text  = Data.lines[8].LabelUnderButton();
         labelP10.Text = Data.lines[9].LabelUnderButton();
         labelC1.Text  = Data.lines[10].LabelUnderButton();
         labelC2.Text  = Data.lines[11].LabelUnderButton();
         labelR1.Text  = Data.lines[12].LabelUnderButton();
         Conformity.SetColor(buttonP1, 0);
         Conformity.SetColor(buttonP2, 1);
         Conformity.SetColor(buttonP3, 2);
         Conformity.SetColor(buttonP4, 3);
         Conformity.SetColor(buttonP5, 4);
         Conformity.SetColor(buttonP6, 5);
         Conformity.SetColor(buttonP7, 6);
         Conformity.SetColor(buttonP8, 7);
         Conformity.SetColor(buttonP9, 8);
         Conformity.SetColor(buttonP10, 9);
         Conformity.SetColor(buttonC1, 10);
         Conformity.SetColor(buttonC2, 11);
         Conformity.SetColor(buttonR1, 12);
         tableLayoutPanel1.Visible = true;
         labelProblem.Visible      = false;
     }
     catch { }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Печать этикетки
 /// </summary>
 /// <param name="num">Номер ящика</param>
 /// <param name="packer">Фамилия упаковщика</param>
 /// <param name="count">Количество этикеток (0 - если одна двойная)</param>
 public void Print(int num, string packer, int count)
 {
     Print(num, packer, count, AutoLabel.Shift.Date, DateTime.Now.ToString("HH:mm"), AutoLabel.Shift.Current, false);
     Save();
     Net.Log("Печать этикетки \"" + Conformity.LabelName(lineType) + "\"");
     //Запись данных для статистики
     try
     {
         using (TcpClient client = new TcpClient())
         {
             client.Connect(Settings.server, Net.Port);
             using (NetworkStream stream = client.GetStream())
             {
                 BinaryWriter writer = new BinaryWriter(stream);
                 BinaryReader reader = new BinaryReader(stream);
                 writer.Write("StatWrite");
                 writer.Write(Environment.MachineName);
             }
         }
     }
     catch { }
 }
Exemplo n.º 4
0
 private void comboBoxColor_SelectedIndexChanged(object sender, EventArgs e)
 {
     comboBoxColorants.SelectedItem = Conformity.NameAndColorToCode(comboBoxWeight.Text, comboBoxColor.Text);
     MakeSaveEnable();
 }