Пример #1
0
        public void Save(ConfigFirma configFirma)
        {
            XmlSerializer xml          = new XmlSerializer(typeof(ConfigFirma));
            StreamWriter  streamWriter = new StreamWriter(fisierSetari);

            xml.Serialize(streamWriter, configFirma);
            streamWriter.Close();
        }
Пример #2
0
        public ConfigFirma Load(ConfigFirma configFirma)
        {
            if (File.Exists(fisierSetari))
            {
                XmlSerializer xmlSerializer = new XmlSerializer(typeof(ConfigFirma));
                StreamReader  streamReader  = new StreamReader(fisierSetari);
                configFirma = (ConfigFirma)xmlSerializer.Deserialize(streamReader);
                streamReader.Close();
            }
            else
            {
                configFirma.NumeFirma = "Firma";
                configFirma.CostOra   = 25;
            }

            return(configFirma);
        }
Пример #3
0
 public Config()
 {
     _config = new ConfigFirma();
     InitializeComponent();
 }
Пример #4
0
 private void Config_Load(object sender, EventArgs e)
 {
     _config = _config.Load(_config);
     numeFirmaTextBox.Text      = _config.NumeFirma;
     costOreNumericUpDown.Value = _config.CostOra;
 }