Esempio n. 1
0
        public static void CreateSleeve(SleeveModel model)
        {
            List <SleeveModel> allSleeves = Sleeve_GetAll();

            if (allSleeves.Count > 0)
            {
                model.Id = allSleeves.OrderByDescending(x => x.Id).First().Id + 1;
            }

            else
            {
                model.Id = 1;
            }

            allSleeves.Add(model);

            allSleeves.SaveSleevesToFile();
        }
Esempio n. 2
0
        private void addNewSleeveButton_Click(object sender, EventArgs e)
        {
            if (!ValidateData())
            {
                return;
            }
            SleeveModel model = new SleeveModel()
            {
                Number              = sleeveNumberTextBox.Text,
                Length              = double.Parse(sleeveLengthTextBox.Text),
                LengthTolerance     = double.Parse(sleeveLenghtToleranceTextBox.Text),
                StepHeight          = double.Parse(sleeveStepHeightTextBox.Text),
                StepHeightTolerance = double.Parse(sleeveStepHeightToleranceTextBox.Text)
            };

            TextConnector.CreateSleeve(model);

            allSleeves.Add(model);

            UpdateData();

            callingForm.NewSleeveCreated(model);
        }
Esempio n. 3
0
        public static List <SleeveModel> ConvertTextToSleeve(this List <string> lines)
        {
            //Id|^|Number|^|Lenght|^|LenghtTolerance|^|StepHeight|^|StepHeightTolerance";

            List <SleeveModel> output = new List <SleeveModel>();
            SleeveModel        curr   = new SleeveModel();

            foreach (string line in lines)
            {
                string[] cols = line.Split(new string[] { "|^|" }, StringSplitOptions.None);
                curr.Id                  = int.Parse(cols[0]);
                curr.Number              = cols[1];
                curr.Length              = double.Parse(cols[2]);
                curr.LengthTolerance     = double.Parse(cols[3]);
                curr.StepHeight          = double.Parse(cols[4]);
                curr.StepHeightTolerance = double.Parse(cols[5]);

                output.Add(curr);
                curr = new SleeveModel();
            }

            return(output);
        }
Esempio n. 4
0
 private void allSleevsComboBox_SelectionChangeCommitted(object sender, EventArgs e)
 {
     selectedSleeve = (SleeveModel)allSleevsComboBox.SelectedItem;
     WireUpLists();
 }
 public void NewSleeveCreated(SleeveModel model)
 {
     allSleeves.Add(model);
     UpdateNewPartSetGroupBoxes();
 }