Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            _ETC.ReadSameCardInterval = txtReadSameCardInterval.IntergerValue;
            CommandResult ret = (new SysParaSettingsBll(AppSettings.CurrentSetting.MasterParkConnect)).SaveSetting <ETCSetting>(_ETC);

            if (CustomCardTypeSetting.Current.GetCardType(ETCSetting.CardTyte) == null) //增加自定义卡片类型
            {
                CustomCardTypeSetting.Current.AddCardType(ETCSetting.CardTyte, (byte)Ralid.Park.BusinessModel.Enum.CardType.MonthRentCard);
                ret = new SysParaSettingsBll(AppSettings.CurrentSetting.MasterParkConnect).SaveSetting <CustomCardTypeSetting>(CustomCardTypeSetting.Current);
            }
            if (ret.Result == ResultCode.Successful)
            {
                AppSettings.CurrentSetting.SaveConfig("EnableETC", chkEnable.Checked.ToString());
                OpenCardMessageHandler handler = GlobalSettings.Current.Get <OpenCardMessageHandler>();
                if (chkEnable.Checked)
                {
                    handler.InitService(_ETC);
                }
                else
                {
                    handler.CloseService <ETCSetting>();
                }
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show(ret.Message);
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            YiTingShanFuSetting yt = new YiTingShanFuSetting();

            yt.IP   = txtIP.IP;
            yt.Port = txtPort.IntergerValue;
            AppSettings.CurrentSetting.SaveYiTingConfig(yt);
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (!string.IsNullOrEmpty(row.Cells["colEntrance"].Value.ToString()))
                {
                    YiTingPOS item = new YiTingPOS()
                    {
                        ID         = (string)row.Cells["colReaderIP"].Value,
                        EntranceID = (int)row.Cells["colEntrance"].Tag,
                        Memo       = (string)row.Cells["colMemo"].Value
                    };
                    yt.Items.Add(item);
                }
                else
                {
                    YiTingPOS item = new YiTingPOS()
                    {
                        ID         = (string)row.Cells["colReaderIP"].Value,
                        EntranceID = 0,
                        Memo       = (string)row.Cells["colMemo"].Value
                    };
                    yt.Items.Add(item);
                }
            }
            CommandResult ret = (new SysParaSettingsBll(AppSettings.CurrentSetting.MasterParkConnect)).SaveSetting <YiTingShanFuSetting>(yt);

            if (CustomCardTypeSetting.Current.GetCardType(YiTingShanFuSetting.CardType) == null) //增加自定义卡片类型
            {
                CustomCardTypeSetting.Current.AddCardType(YiTingShanFuSetting.CardType, (byte)Ralid.Park.BusinessModel.Enum.CardType.MonthRentCard);
                new SysParaSettingsBll(AppSettings.CurrentSetting.MasterParkConnect).SaveSetting <CustomCardTypeSetting>(CustomCardTypeSetting.Current);
            }
            if (ret.Result == ResultCode.Successful)
            {
                AppSettings.CurrentSetting.SaveConfig("EnableYiTingShanFu", chkEnable.Checked.ToString());
                OpenCardMessageHandler handler = GlobalSettings.Current.Get <OpenCardMessageHandler>();
                if (chkEnable.Checked)
                {
                    handler.InitService(yt);
                }
                else
                {
                    handler.CloseService <YiTingShanFuSetting>();
                }
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show(ret.Message);
            }
        }
Esempio n. 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!CheckInput())
            {
                return;
            }
            YCTSetting yct = (new SysParaSettingsBll(AppSettings.CurrentSetting.ParkConnect)).GetOrCreateSetting <YCTSetting>();

            yct.Items.Clear();
            yct.ServiceCode     = txtServiceCode.IntergerValue;
            yct.ReaderCode      = txtReaderCode.IntergerValue;
            yct.MaxOfflineMonth = txtMaxofflineMonth.IntergerValue;
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                yct.Items.Add(row.Tag as YCTItem);
            }
            CommandResult ret = (new SysParaSettingsBll(AppSettings.CurrentSetting.MasterParkConnect)).SaveSetting <YCTSetting>(yct);

            if (CustomCardTypeSetting.Current.GetCardType(YCTSetting.CardTyte) == null) //增加自定义卡片类型
            {
                CustomCardTypeSetting.Current.AddCardType(YCTSetting.CardTyte, (byte)Ralid.Park.BusinessModel.Enum.CardType.MonthRentCard);
                new SysParaSettingsBll(AppSettings.CurrentSetting.MasterParkConnect).SaveSetting <CustomCardTypeSetting>(CustomCardTypeSetting.Current);
            }
            if (ret.Result == ResultCode.Successful)
            {
                AppSettings.CurrentSetting.SaveConfig("EnableYCT", chkEnable.Checked.ToString());
                OpenCardMessageHandler handler = GlobalSettings.Current.Get <OpenCardMessageHandler>();
                if (chkEnable.Checked)
                {
                    handler.InitService(yct);
                }
                else
                {
                    handler.CloseService <YCTSetting>();
                }
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show(ret.Message);
            }
        }