private void ReportHandle(UpdateSystemParamSettingReport report) { if (report.StationID != WorkStationInfo.CurrentStation.StationID) { Type type = typeof(VehicleLedSetting); if (report.ParamTypeName == type.Name) { _VehicleLedSetting = (new SysParaSettingsBll(AppSettings.CurrentSetting.ParkConnect)).GetSetting <VehicleLedSetting>(); if (this.Visible) { Action action = delegate() { ShowSetting(); }; if (this.InvokeRequired) { this.BeginInvoke(action); } else { action(); } } } } }
private void btnGet_Click(object sender, EventArgs e) { try { _VehicleLedSetting = (new SysParaSettingsBll(AppSettings.CurrentSetting.ParkConnect)).GetSetting <VehicleLedSetting>(); ShowSetting(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { VehicleLedSetting setting = new VehicleLedSetting(); foreach (DataGridViewRow row in dataGridView1.Rows) { //VehicleLedItem item = new VehicleLedItem(); //item.Name = Convert.ToString(row.Cells["colName"].Value); //item.EntranceID = Convert.ToInt32(row.Cells["colEntrance"].Tag); //item.StationID = Convert.ToString(row.Cells["colStation"].Tag); //item.ComPort = Convert.ToByte(row.Cells["colComPort"].Value); //item.ShowTitle = Convert.ToBoolean(row.Cells["colShowTitle"].Value); //item.SubAddress1 = Convert.ToByte(row.Cells["colSubAddress1"].Value); //item.SubMessage1 = (VehicleLEDMessageType)Convert.ToInt32(row.Cells["colSubMessage1"].Tag); //item.SubAddress2 = Convert.ToByte(row.Cells["colSubAddress2"].Value); //item.SubMessage2 = (VehicleLEDMessageType)Convert.ToInt32(row.Cells["colSubMessage2"].Tag); //item.SubAddress3 = Convert.ToByte(row.Cells["colSubAddress3"].Value); //item.SubMessage3 = (VehicleLEDMessageType)Convert.ToInt32(row.Cells["colSubMessage3"].Tag); //item.Memo = Convert.ToString(row.Cells["colMemo"].Value); VehicleLedItem item = row.Tag as VehicleLedItem; if (item != null) { setting.Items.Add(item); } } CommandResult ret = (new SysParaSettingsBll(AppSettings.CurrentSetting.ParkConnect)).SaveSetting <VehicleLedSetting>(setting); if (ret.Result == ResultCode.Successful) { _VehicleLedSetting = setting; foreach (IParkingAdapter pad in ParkingAdapterManager.Instance.ParkAdapters) { UpdateSystemParamSettingNotity notity = new UpdateSystemParamSettingNotity(); notity.Operator = OperatorInfo.CurrentOperator; notity.StationID = WorkStationInfo.CurrentStation.StationID; notity.StationName = WorkStationInfo.CurrentStation.StationName; notity.ParamTypeName = typeof(VehicleLedSetting).Name; pad.UpdateSystemParamSetting(notity); } MessageBox.Show(Resources.Resource1.FrmReportBase_SaveSuccess); } else { MessageBox.Show(ret.Message); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 初始化 /// </summary> public void Init() { _VehicleLedSetting = (new SysParaSettingsBll(AppSettings.CurrentSetting.ParkConnect)).GetSetting <VehicleLedSetting>(); InitLedMessage(); }