Пример #1
0
        /// <summary>
        ///  Создать новый файл
        /// </summary>
        /// <param name="projectname"></param>
        /// <param name="path"></param>
        public static void CreateNewProjectXML(string projectname, string path)
        {
            List <OfferColumnMapping> columns = new List <OfferColumnMapping>();

            foreach (string name in Project.ColumnsNames.Values)
            {
                columns.Add(
                    new OfferColumnMapping()
                {
                    Name         = name,
                    ColumnSymbol = ""
                });
            }

            OfferSettings offerMapping = new OfferSettings
            {
                Name      = projectname,
                FileName  = path,
                RowStart  = 14,
                SheetName = "Рсч-П",
                Columns   = columns
            };

            offerMapping.Save();
        }
Пример #2
0
 private void GetOfferMappings()
 {
     _offersMapping = _manager.Mappings;
     if ((_offersMapping?.Count ?? 0) > 0)
     {
         _CurrentMapping = _offersMapping.First();
     }
 }
Пример #3
0
 private void ListKP_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ListKP.SelectedItems.Count > 0)
     {
         string nameSettings = ListKP.SelectedItems[0].Text;
         _CurrentMapping = _manager.Mappings.Find(x => x.Name == nameSettings);
         SetTableMapping();
     }
 }
Пример #4
0
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            string name = textBox1.Text;

            OfferSettings.Create(name);
            _manager.UpdateMappings();
            _offersMapping  = _manager.Mappings;
            _CurrentMapping = _offersMapping.Find(m => m.Name == name);
            LoadTableOffers();
            SetTableMapping();
        }
Пример #5
0
        internal static void Copy(OfferSettings currentMapping, string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return;
            }
            string path     = GetNamesSettingsKP();
            string filename = Path.Combine(path, name + ".xml");

            currentMapping.Name     = name;
            currentMapping.FileName = filename;
            currentMapping.Save();
        }
Пример #6
0
        private void BtnCopoySettings_Click(object sender, EventArgs e)
        {
            string name = textBox1.Text;

            if (string.IsNullOrWhiteSpace(name))
            {
                return;
            }
            OfferSettings.Copy(_CurrentMapping, name);
            _manager.UpdateMappings();
            _offersMapping  = _manager.Mappings;
            _CurrentMapping = _offersMapping.Find(m => m.Name == name);
            LoadTableOffers();
            SetTableMapping();
        }
Пример #7
0
 /// <summary>
 ///  Показать активные настройки КП в заголовке формы.
 /// </summary>
 /// <param name="project"></param>
 private void VewActiveOfferSettings(OfferSettings offerSettings)
 {
     this.Text = $"Диспетчер КП [{offerSettings.Name}]";
 }