Exemplo n.º 1
0
        public static NamingData FromCsv(string csvLine)
        {
            string[]   values = csvLine.Split(',');
            NamingData data   = new NamingData();

            data.Level       = Convert.ToInt32(values[0]);
            data.Code        = values[1];
            data.Description = values[2];

            return(data);
        }
Exemplo n.º 2
0
        private void btnCreate_Click(object sender, RoutedEventArgs e)
        {
            DocumentsManager doc   = new DocumentsManager();
            NamingData       data1 = cboLevel1.SelectedItem as NamingData;
            NamingData       data2 = cboLevel2.SelectedItem as NamingData;
            NamingData       data3 = cboLevel3.SelectedItem as NamingData;
            NamingData       data4 = cboLevel4.SelectedItem as NamingData;
            NamingData       data5 = cboLevel5.SelectedItem as NamingData;

            _docInfo.Name = txtFileTitle.Text;
            doc.Add(data1.Code, data2.Code, data3.Code, data4.Code, data5.Code, _docInfo);
            Close();
        }
Exemplo n.º 3
0
        public NamingHelper()
        {
            if (File.Exists(_filePath))
            {
                _codes = File.ReadAllLines(_filePath).Skip(1).Select(v => NamingData.FromCsv(v)).ToList();
            }

            if (_codes.Count > 0)
            {
                Level1.AddRange(_codes.Where(x => x.Level == 1).ToList());
                Level2.AddRange(_codes.Where(x => x.Level == 2).ToList());
                Level3.AddRange(_codes.Where(x => x.Level == 3).ToList());
                Level4.AddRange(_codes.Where(x => x.Level == 4).ToList());
                Level5.AddRange(_codes.Where(x => x.Level == 5).ToList());
            }
        }