Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        public bool UpdateSystemParamSetting(UpdateSystemParamSettingNotity notify)
        {
            UpdateSystemParamSettingReport report = new UpdateSystemParamSettingReport();

            report.EventDateTime = DateTime.Now;
            report.OperatorID    = notify.Operator.OperatorName;
            report.StationID     = notify.StationID;
            report.SourceName    = notify.StationName;
            report.ParamTypeName = notify.ParamTypeName;

            ReportEnqueue(report);

            return(true);
        }
Ejemplo n.º 3
0
 public bool UpdateSystemParamSetting(UpdateSystemParamSettingNotity notify)
 {
     try
     {
         if (_Channel != null)
         {
             return(_Channel.UpdateSystemParamSetting(notify));
         }
     }
     catch (CommunicationException)
     {
         if (ParkAdapterConnectFail != null)
         {
             ParkAdapterConnectFail(this, EventArgs.Empty);
         }
     }
     catch (Exception ex)
     {
         Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex);
     }
     return(false);
 }