Ejemplo n.º 1
0
 private void Write(POSSetting posSetting)
 {
     string posSyncJson = JsonConvert.SerializeObject(posSetting);
     using (StreamWriter sw = new StreamWriter(POSSettingConfiguration.Filename))
     {
         sw.Write(posSyncJson.EncryptToString());
         sw.Flush();
         sw.Close();
     }
 }
Ejemplo n.º 2
0
        public POSSetting Get()
        {
            if (!File.Exists(POSSettingConfiguration.Filename))
            {
                POSSetting posSync = new POSSetting();
                Write(posSync);

                return posSync;
            }
            else
            {
                POSSetting result = new POSSetting();
                using (StreamReader sr = new StreamReader(POSSettingConfiguration.Filename))
                {
                    string posSyncJson = sr.ReadToEnd().DecryptString();
                    result = JsonConvert.DeserializeObject<POSSetting>(posSyncJson);
                }
                return result;
            }
        }
Ejemplo n.º 3
0
        public void SetPOSSetting(POSSetting setting)
        {
            if (!setting.PrinterName.Equals(string.Empty))
            {
                this.comboPrinter.SelectedIndex = comboPrinter.Items.IndexOf(setting.PrinterName);
            }

            this.checkBoxCashdrawer.Checked = setting.IsUseCashdrawer;
            this.checkBoxFullScreen.Checked = setting.IsFullScreen;
        }
Ejemplo n.º 4
0
 public void Save(POSSetting setting)
 {
     Write(setting);
 }