Example #1
0
        /// <summary>
        /// 签章表更新
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DangAnDaiRefeshMDB_Click(object sender, RoutedEventArgs e)
        {
            string selectDir = FileUtils.SelectDir();
            int    a         = 0;

            if (!MyUtils.Utils.IsStrNull(selectDir))
            {
                MyAction myAction = new MyAction(new Action(() =>
                {
                    DirClass dirClass = new DirClass(selectDir);
                    foreach (string dir in dirClass.Dirs)
                    {
                        DirClass dangAnDaiDir = new DirClass(dir);
                        string path           = dangAnDaiDir.FindFileAllSelectOne("权籍", FileSelectRelation.Contains);

                        if (MyUtils.Utils.CheckFileExists(path))
                        {
                            string[] array   = System.IO.Path.GetFileName(dir).Split('(');
                            string zdnum     = array[0];
                            IList <QZB> qzbs = QZBCustom.DocToDaAnDaiQZB(path, zdnum);
                            if (MyUtils.Utils.CheckListExists(qzbs))
                            {
                                //删除以前的签章表
                                MDBUtils.DeleteBySql(model.QZ_BSMDBPath, "Delete From " + QZBCustom.QZBTableName + "  Where BZDH ='" + zdnum + "'");
                                //保存现在的
                                MDBUtils.WriteData(model.QZ_BSMDBPath, QZBCustom.QZBTableName, qzbs);
                                a++;
                            }
                        }
                    }
                })
                                                 , "更新签章表");
                CommHelper.FastTask(myAction);
            }
        }
        private void Initialize()
        {
            this.lbCarNo.Text = recordInfo.INOUT_RECODE.VEHICLE_NO;
            var temp = GlobalEnvironment.ListOragnization.Where(x => x.IP == CommHelper.GetRealIP() && x.channelType == enumChannelType.wsn).FirstOrDefault();

            this.lbChannelName.Text = recordInfo.CHN_NAME;
        }
Example #3
0
        public void control_UserControlBtnClicked(object sender, string ID)
        {
            DataUploadRecord dataUploadRecord = new DataUploadRecord();
            CR_INOUT_RECODE  inOutRecord      = bllRecord.GetModel(ID);

            if (null != inOutRecord)
            {
                dataUploadRecord.plateNum       = inOutRecord.VEHICLE_NO;
                dataUploadRecord.REPORTIMG_TIME = inOutRecord.IN_TIME;
                dataUploadRecord.PARTITION_CODE = inOutRecord.IN_PARTITION_CODE;
                var partitionChildren = CommHelper.GetOrgInfos(dataUploadRecord.PARTITION_CODE);
                //查找中央缴费定点
                if (null != partitionChildren && partitionChildren.Count > 0)
                {
                    var centralPaymentChannel = partitionChildren.Where(x => x.channelType == enumChannelType.centerPayment).FirstOrDefault();
                    if (null != centralPaymentChannel)
                    {
                        dataUploadRecord.CHN_CODE = centralPaymentChannel.ORGANIZATION_CODE;
                    }
                }
                dataUploadRecord.CHANNEL_TYPE = enumChannelType.centerPayment;
                dataUploadRecord.INOUT_RECODE = inOutRecord;
                DataUploadEventArgs args = new DataUploadEventArgs()
                {
                    TempRecordInfo = dataUploadRecord
                };
                ThreadMessageTransact.Instance.AcceptFormalData(dataUploadRecord);
            }
        }
Example #4
0
        private void button_DY2_KaiGuan_Click(object sender, EventArgs e)
        {
            string vDianYuanID = textBox_DY2_ID.Text;

            if (CommHelper.IsMAC(vDianYuanID))
            {
                DataTable vSwitchTable = new DataTable();
                if (button_DY2_KaiGuan.Tag == null)
                {
                    vSwitchTable = m_WatchHouseConfig.GetSwitchTable(vDianYuanID);
                }
                else
                {
                    vSwitchTable = (DataTable)button_DY2_KaiGuan.Tag;
                }
                button_DY2_KaiGuan.Tag = vSwitchTable;
                SwitchConfigForm vSwitchConfigForm = new SwitchConfigForm();
                vSwitchConfigForm.SwitchTable = vSwitchTable;
                vSwitchConfigForm.DianYuanID  = vDianYuanID;
                vSwitchConfigForm.ShowDialog();
            }
            else
            {
                MessageBox.Show("请输入正确的电源ID", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void UnlicensedCarsEnter_Load(object sender, EventArgs e)
        {
            if (null == dataUploadRecord.REPORTIMG_TIME)
            {
                lbInOutTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                lbInOutTime.Text = dataUploadRecord.REPORTIMG_TIME.ToString("yyyy-MM-dd HH:mm:ss");
            }
            lbInOut.Text = dataUploadRecord.CHANNEL_TYPE == enumChannelType.chn_in ? "入场时间 :" : "出场时间 :";

            List <OragnizationBase> orgBase = new List <OragnizationBase>();
            string Ip = CommHelper.GetRealIP();

            GlobalEnvironment.ListOragnization.Where(x => x.channelType == enumChannelType.wsn).ToList().ForEach(delegate(Equipment o)
            {
                if (o.Attributes.ContainsKey("IP"))
                {
                    if (Ip == o.Attributes["IP"])
                    {
                        GetChannel(ref orgBase, o.ORGANIZATION_CODE);
                    }
                }
            });
            this.cbChannelCode.DataSource    = orgBase.Where(X => X.channelType == dataUploadRecord.CHANNEL_TYPE).ToList();
            this.cbChannelCode.DisplayMember = "ORGANIZATION_NAME";
            this.cbChannelCode.ValueMember   = "ORGANIZATION_CODE";
        }
Example #6
0
        /// <summary>
        /// 播放解析后的信号
        /// </summary>
        public void Play(MusicInfo mi)
        {
            if (isStart)
            {
                return;
            }

            if (CadenceSigns == null || CadenceSigns.Length <= 0)
            {
                Load(mi);
            }
            ///Res/Musics/xiaji.wma
            //meMusic.Stop();
            meMusic.AutoPlay = false;
            if (mi.IsDefault)
            {
                meMusic.Source = new Uri(CommHelper.MusicBasePath + mi.Key, UriKind.Relative);
            }
            else
            {
                meMusic.SetSource(CommHelper.GetMusicStream(mi.Key));
            }

            //主线程界面刷新器
            dtWindows.Interval = new TimeSpan(0, 0, 0, 0, 10);
            dtWindows.Tick    += new EventHandler(dtWindows_Tick);
            dtWindows.Start();
            //辅助线程
            logicThread = new Timer(dtWindows_Tick_BG, null, 0, 500);

            isStart = true;
        }
Example #7
0
        /// <summary>
        /// 设置配置信息
        /// </summary>
        /// <typeparam name="T">consul配置信息类型</typeparam>
        /// <param name="consulIP">consul服务IP</param>
        /// <param name="consulPort">consul服务端口</param>
        /// <param name="config">consul配置信息</param>
        /// <param name="prefixKey">key前缀,一般用来区分不同服务</param>
        /// <returns></returns>
        public static bool PutConfig <T>(string consulIP, int consulPort, T config, string prefixKey) where T : class
        {
            //配置信息字典
            var dicConfig = new Dictionary <string, object>();

            Type type = typeof(T);
            //获取对象属性
            var pros = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);

            //找出有配置特性的属性,并把属性对应放入字典
            foreach (var pro in pros)
            {
                //特性
                var attr = pro.GetCustomAttributes <ConsulConfigAttribute>().FirstOrDefault();
                if (attr == null)
                {
                    continue;
                }

                dicConfig[attr.Key] = CommHelper.EmitGet(config, pro.Name);
            }

            using (var kv = new ConsulKV(consulIP, consulPort, prefixKey))
            {
                //写入consul
                return(kv.PutAll(dicConfig));
            }
        }
Example #8
0
        /// <summary>
        /// 提交数据
        /// </summary>
        /// <param name="wFSteptId"></param>
        /// <returns></returns>
        private string checkResultSubmit(string FQCCheckId)
        {
            FQCCheckHelper ipqc      = new FQCCheckHelper();
            string         XMLData   = CommHelper.ConvertXmlToString(Convert.ToString(Request.Form["FQCData"])).ToString();
            string         Describe  = Convert.ToString(Request.Form["Describe"]);
            string         QCResult  = Convert.ToString(Request.Form["QCResult"]);
            Decimal        AcceptQty = Convert.ToDecimal(Request.Form["AcceptQty"]);
            Decimal        NGQty     = Convert.ToDecimal(Request.Form["NGQty"]);
            FQCCheckModel  model     = new FQCCheckModel();

            model.Describe   = Describe;
            model.QCResult   = int.Parse(QCResult);
            model.FQCCheckId = FQCCheckId;
            model.XMLData    = XMLData;
            model.AcceptQty  = AcceptQty;
            model.NGQty      = NGQty;
            string msg = "";

            if (ipqc.CheckResultSubmit(model, out msg))
            {
                return("{\"result\":0,\"msg\":\"" + msg + "\"}");
            }
            else
            {
                return("{\"result\":-1,\"msg\":\"数据提交失败:" + msg + "\"}");
            }
        }
        /// <summary>
        /// 加载相机信息
        /// </summary>
        /// <returns></returns>
        private Equipment InitCamerasInfo()
        {
            this.lbErrorCarNo.Text = string.Empty;
            this.lbCurrCarNo.Text  = string.Empty;
            string OrgCode   = this.cbCamera.SelectedValue.ToString();
            var    equDevice = GlobalEnvironment.ListOragnization.Where(x => x.ORGANIZATION_CODE == OrgCode).FirstOrDefault();

            if (null != equDevice)
            {
                if (null != equDevice.CurrRecognitioData)
                {
                    this.lbCurrCarNo.Text = equDevice.CurrRecognitioData.CarNo + " (" + equDevice.CurrRecognitioData.Count + ")";
                    if (equDevice.ListRecognitioResult.Count > 1)
                    {
                        var ErrorCamera = equDevice.ListRecognitioResult.Where(x => x.CarNo != equDevice.CurrRecognitioData.CarNo).OrderByDescending(x => x.Count).FirstOrDefault();
                        this.lbErrorCarNo.Text = ErrorCamera.CarNo + " (" + ErrorCamera.Count + ")";
                    }
                }
                this.lbIP.Text = equDevice.IP;
                var channel = CommHelper.GetOrgInfos(equDevice.ORGANIZATION_CODE, false).Where(x => x.channelType == enumChannelType.chn_in || x.channelType == enumChannelType.chn_out).LastOrDefault();
                if (null != channel)
                {
                    this.lbChannelName.Text = channel.ORGANIZATION_NAME;
                }
            }
            return(equDevice);
        }
Example #10
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void InitialData()
        {
            if (curntScreenRow != null)
            {
                selectedScreen               = new ScreenDictDT();
                selectedScreen.SCREEN_NO     = curntScreenRow["SCREEN_NO"].ToString();
                selectedScreen.SCREEN_TYPE   = curntScreenRow["SCREEN_TYPE"].ToString();
                selectedScreen.SCREEN_LABEL  = curntScreenRow["SCREEN_LABEL"].ToString();
                selectedScreen.FULL_SCREEN   = decimal.Parse(curntScreenRow["FULL_SCREEN"].ToString());
                selectedScreen.SCREEN_WIDTH  = decimal.Parse(curntScreenRow["SCREEN_WIDTH"].ToString());
                selectedScreen.SCREEN_HEIGHT = decimal.Parse(curntScreenRow["SCREEN_HEIGHT"].ToString());

                lblScreenNum.Text   = "编号:" + curntScreenRow["SCREEN_NO"].ToString();
                lblScreenLabel.Text = curntScreenRow["SCREEN_LABEL"].ToString();
                lblScreenType.Text  = curntScreenRow["SCREEN_TYPE"].ToString();
                bool isFullScreen = CommHelper.GetBoolean(curntScreenRow["FULL_SCREEN"].ToString());
                if (isFullScreen)
                {
                    lblSize.Text = "全屏";
                }
                else
                {
                    string width  = curntScreenRow["SCREEN_WIDTH"].ToString();
                    string height = curntScreenRow["SCREEN_HEIGHT"].ToString();
                    lblSize.Text = width + "×" + height;
                }
            }
        }
        /// <summary>
        /// 获取key
        /// </summary>
        /// <param name="invocation"></param>
        /// <returns></returns>
        private string GetKey(IInvocation invocation)
        {
            var sb       = new StringBuilder();
            var attrKeys = invocation.MethodInvocationTarget.GetCustomAttributes(typeof(TdbCacheKeyAttribute), true).Select(m => m as TdbCacheKeyAttribute);

            foreach (var attrKey in attrKeys)
            {
                //获取参数值
                var param = invocation.GetArgumentValue(attrKey.ParamIndex);

                //直接获取
                if (string.IsNullOrWhiteSpace(attrKey.FromPropertyName))
                {
                    sb.Append(this.ToStr(param));
                }
                //从属性获取
                else
                {
                    ///属性不存在
                    if (CommHelper.IsExistProperty(param, attrKey.FromPropertyName) == false)
                    {
                        throw new TdbException($"[缓存拦截器]找不到属性:{param.GetType().Name}.{attrKey.FromPropertyName}");
                    }

                    var paramValue = CommHelper.ReflectGet(param, attrKey.FromPropertyName);
                    sb.Append(this.ToStr(paramValue));
                }
            }

            return(sb.ToString());
        }
Example #12
0
        /// <summary>
        /// 自定义消息推送
        /// </summary>
        public static void  AddAlarmWindow(FireControl_AlarmWindow model)
        {
            //添加弹窗window
            FireControl_AlarmWindowBLL alarmWinBLL = new FireControl_AlarmWindowBLL();

            model.AWID = CommHelper.CreatePKID("aw");
            var stateResult = alarmWinBLL.AddObj(model);

            if (stateResult.ResultCode == ResultCode.Succ)
            {
                Dictionary <string, string> dic1 = new Dictionary <string, string>();
                dic1.Add("type", "9");
                dic1.Add("cucode", model.UserID);
                dic1.Add("content", "消息");
                dic1.Add("title", "消息");
                dic1.Add("msgid", model.RecordID);
                dic1.Add("application", "8");
                dic1.Add("platformType", "0");
                dic1.Add("isCustomMsg", "1");
                new Task(() =>
                {
                    HttpSend.GetByRequest(JGApi, dic1, null, true);
                }).Start();
            }
        }
Example #13
0
        /// <summary>
        /// 播语音
        /// </summary>
        private void Sound()
        {
            var           voiceTemp  = EngineContext.Current.Resolve <IPBA_VOICE_TEMPLATE>();
            var           voiceModel = voiceTemp.GetModelByType((int)enumTemplateType.MODEL_TYPE_VOICE, (int)enumSpeechType.PayOut);
            List <string> strArr     = new List <string>();

            recordInfo.INOUT_RECODE.IN_TIME  = DateTime.Parse(this.lbInTime.Text);
            recordInfo.INOUT_RECODE.OUT_TIME = DateTime.Parse(this.lbOutTime.Text);
            if (null != voiceModel)
            {
                if (recordInfo.CHANNEL_TYPE == enumChannelType.centerPayment)
                {
                    string soundStr = CommHelper.VoiceContent(voiceModel.CUSTOM_MODEL, recordInfo, true);
                    CommHelper.WindowsSound(soundStr);
                }
                else
                {
                    strArr.Add(CommHelper.VoiceContent(voiceModel.CUSTOM_MODEL, recordInfo));
                    Parking.Core.Common.CommHelper.Sound(recordInfo, strArr.ToArray());
                }
            }
            ///////////////////////////////////显示屏信息///////////////////////////////
            var checkPointBase = EngineContext.Current.Resolve <CheckPointBase>();

            checkPointBase.ShowLED(recordInfo);
        }
Example #14
0
 public WaitForm(MyAction action, bool autoStart = true)
 {
     //this.ShowInTaskbar = false;
     InitializeComponent();
     this.TaskName.Content = action.TaskName;
     CommHelper.FastTask(action);
 }
Example #15
0
        public string GenerateReportPdf(Guid rptId, Guid companyId)
        {
            var currentRptInfo = rptInformationService.GetCurrentRptInformation(rptId);
            var filePath       = Path.Combine(Report.AutoGenerate.Service.AppSettings.GetValue("xlsSaveDirectory"), currentRptInfo.RptPath);

            if (!System.IO.File.Exists(filePath))
            {
                throw new NullReferenceException("The report file does not exist");
            }
            var       startTime = GetStartTime((RptTypeEnum)currentRptInfo.RptType);
            IWorkbook workbook  = GetExportWorkBook(filePath, (int)currentRptInfo.RptType, "2", startTime, startTime, false, companyId);

            if (workbook == null)
            {
                throw new NullReferenceException("the workbook is null");
            }
            ReplaceSensitiveDataToEmpty(workbook);
            MemoryStream mStream = new MemoryStream();

            workbook.Write(mStream);
            mStream.Flush();
            workbook.Close();
            mStream.Close();
            return(CommHelper.ConvertXlsToPdf(mStream, companyId.ToString(), currentRptInfo.Name));
        }
Example #16
0
        private void button_Save_Click(object sender, EventArgs e)
        {
            if (CommHelper.IsIPAddress(textBox_IPAddress.Text))
            {
                Config vConfig = new Config();
                vConfig.DBSource   = textBox_IPAddress.Text;
                vConfig.DBName     = textBox_DB_Name.Text;
                vConfig.DBPassword = textBox_DB_Password.Text;
                vConfig.DBPort     = Convert.ToInt32(numericUpDown_DB_Port.Value);
                vConfig.DBUserName = textBox_DB_UserName.Text;

                vConfig.PowerPort      = Convert.ToInt32(numericUpDown_Power_Port.Value);
                vConfig.WatchHousePort = Convert.ToInt32(numericUpDown_WM_Port.Value);

                vConfig.EmployeeUrl = textBox_Emplyee_Address.Text; // string.Format("http://{0}/EmployeeInfo", textBox_Emplyee_Address.Text );
                vConfig.PicUrl      = textBox_Pic_Address.Text;     //string.Format("http://{0}/Photo", textBox_Pic_Address.Text);

                vConfig.Save();
                DialogResult = DialogResult.OK;
                MessageBox.Show("保存成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("请输入正确的IP地址", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #17
0
        //bool D_idDown = false;
        //bool F_idDown = false;
        //bool J_idDown = false;
        //bool K_idDown = false;

        /// <summary>
        /// 键盘按下事件处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LayoutRoot_KeyDown(object sender, KeyEventArgs e)
        {
            // MessageBox.Show("ad");
            if (!CommHelper.CheckKeyLicity(e.Key))
            {
                return;
            }
            ResponseSign(e);
            switch (e.Key)
            {
            case Key.D:
                drumHead.KnockPlay(DrumType.LeftSide);
                break;

            case Key.F:
                drumHead.KnockPlay(DrumType.LeftFace);
                break;

            case Key.J:
                drumHead.KnockPlay(DrumType.RightFace);
                break;

            case Key.K:
                drumHead.KnockPlay(DrumType.RightSide);
                break;

            case Key.L:
                drumHead.KnockPlay(DrumType.FaceAll);
                break;

            case Key.S:
                drumHead.KnockPlay(DrumType.SideAll);
                break;
            }
        }
Example #18
0
        /// <summary>
        /// 键盘抬起事件处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LayoutRoot_KeyUp(object sender, KeyEventArgs e)
        {
            if (!CommHelper.CheckKeyLicity(e.Key))
            {
                return;
            }

            switch (e.Key)
            {
            case Key.D:
                drumHead.RelaseKnockPlay(DrumType.LeftSide);
                break;

            case Key.F:
                drumHead.RelaseKnockPlay(DrumType.LeftFace);
                break;

            case Key.J:
                drumHead.RelaseKnockPlay(DrumType.RightFace);
                break;

            case Key.K:
                drumHead.RelaseKnockPlay(DrumType.RightSide);
                break;

            case Key.L:
                drumHead.RelaseKnockPlay(DrumType.FaceAll);
                break;

            case Key.S:
                drumHead.RelaseKnockPlay(DrumType.SideAll);
                break;
            }
        }
        void ucm_Closed(object sender, EventArgs e)
        {
            if (ucmSave.DialogResult.Value)
            {
                IsolatedStorageFile isf = CommHelper.currentISF;

                CommHelper.CheckDiskCapcity();

                if (!isf.DirectoryExists("Musics"))
                {
                    isf.CreateDirectory("Musics");
                }

                IsolatedStorageFileStream isfs     = new IsolatedStorageFileStream(string.Format("Musics/{0}_Sign.sgn", musicFile.Name), FileMode.Create, isf);
                IsolatedStorageFileStream realisfs = new IsolatedStorageFileStream(string.Format("Musics/{0}", musicFile.Name), FileMode.Create, isf);
                WriterMusicSignInfo(isfs, System.IO.Path.GetFileNameWithoutExtension(musicFile.Name));
                WriterRealMusic(realisfs);
                isfs.Close();
                realisfs.Close();
                ucmSave.Show("保存?", "保存成功!");
                listSigns.Clear();
                StopRelaPty(true);
                ucmSave.Closed -= new EventHandler(ucm_Closed);
                ReloadLocalMusicList();
                this.UpdateLayout();
            }
        }
Example #20
0
        /// <summary>
        /// 执行合并
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OK_Click(object sender, RoutedEventArgs e)
        {
            ///list<object> 转换成正确类型
            IList <FileNameCustom> currencies = model.FileNameCustoms;

            model.SetPaths(currencies);


            int count = model.FileNameCustoms.Count;

            for (int a = 0; a < count; a++)
            {
                FileNameCustom custom = model.FileNameCustoms[a];
                if (!Utils.CheckFileExists(custom.FilePath))
                {
                    model.FileNameCustoms.RemoveAt(a);
                    a--;
                    count--;
                }
            }
            MyAction myAction = new MyAction(new Action(() =>
            {
                ExcelWrite.MergeExcel(model);
            }), "合并表格", "完成");

            CommHelper.FastTask(myAction);
            SoftwareConfig.SaveRedis(ExcelMergeModel.RedisKey, model);
        }
        /// <summary>
        /// 发¤?é送¨a余?¨¤位?信?息?é
        /// </summary>
        public void ShowMoreThanInfo(ProcessRecord recordInfo)
        {
            LogHelper.Log.Info("发¤?é送¨a余?¨¤位?显?示o?屏¨¢命¨1令¢?:" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            var           TempLate     = EngineContext.Current.Resolve <IPBA_VOICE_TEMPLATE>();
            List <string> strArr       = new List <string>();
            var           childrenList = CommHelper.GetOrgInfos(recordInfo.CHN_CODE).Where(x => x.productLine == enumProductLine.DisplayScreen).ToList();

            childrenList = CommHelper.GetOrgInfos(recordInfo.INOUT_RECODE.IN_CHANNEL_CODE).Where(x => x.productLine == enumProductLine.DisplayScreen).ToList();
            foreach (var temp in childrenList)
            {
                foreach (var info in temp.LedInfos.OrderBy(x => x.serialNo))
                {
                    StringBuilder strSB          = new StringBuilder();
                    string[]      strArrSerialNo = info.displayContent.Split(',');
                    if (!string.IsNullOrEmpty(info.displayContent))
                    {
                        foreach (string s in strArrSerialNo)
                        {
                            int SeriNo = Convert.ToInt32(s);
                            if (SeriNo == 9)
                            {
                                var strTemp = TempLate.GetModelByType((int)enumTemplateType.MODEL_TYPE_DISPLAY, SeriNo);
                                if (null != strTemp)
                                {
                                    strSB.Append(CommHelper.LedContent(strTemp.CUSTOM_MODEL, recordInfo, SeriNo));
                                }
                            }
                        }
                        strArr.Add(strSB.ToString());
                        Parking.Core.Common.CommHelper.ShowLED(temp, strArr.ToArray(), info);
                        strArr.Clear();
                    }
                }
            }
        }
 /// <summary>
 /// 状态变化时显示状态动画
 /// </summary>
 private void temp_OnDeviceStateChanged(object sender, DeviceStateChangedEventArgs e)
 {
     //查找主控板
     var controlDevice = GlobalEnvironment.CurrWorkStationOragnization.Where(x => x.IP == e.IP);
     foreach (var board in controlDevice)
     {
         try
         {
             var channelDevice = CommHelper.GetOrgInfos(board.ORGANIZATION_CODE, false).Where(x => x.channelType == enumChannelType.chn_in || x.channelType == enumChannelType.chn_out).LastOrDefault();
             if (null != channelDevice)
             {
                 findPic = (RoadGate)this.Controls.Find(channelDevice.ORGANIZATION_NAME, true)[0];
                 if (null != findPic)
                 {
                     string filePath = e.State == 0 ? GlobalEnvironment.BasePath + "Image\\RoadNogate.png" : GlobalEnvironment.BasePath + "Image\\GateNormalClose.png";
                     if (File.Exists(filePath))
                         findPic.PicImage = filePath;
                 }
             }
         }
         catch (Exception ex)
         {
             LogHelper.Log.Error(ex.Message, ex.InnerException);
         }
     }
 }
Example #23
0
 /// <summary>
 /// 登录
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void picOK_Click(object sender, EventArgs e)
 {
     if (CommHelper.Login(this.tbUserName.Text.Trim(), this.tbPwd.Text.Trim()))
     {
         string strIP = CommHelper.GetRealIP();
         var    temp  = EngineContext.Current.Resolve <IFN_LAYOUT_MAIN>();
         Parking.Core.Model.FN_LAYOUT_MAIN workModel = temp.GetLayOutByIP(strIP);
         if (null == workModel)
         {
             workModel = temp.GetLayOutByWORKSTATION(strIP);
         }
         if (null != workModel)
         {
             GlobalEnvironment.WorkStationInfo = workModel;
             GlobalEnvironment.LocalUserInfo.WORKSTATION_NO = GlobalEnvironment.WorkStationInfo.WORKSTATION_ID;
         }
         ICR_PARK_EXCHANGE bllRecord = EngineContext.Current.Resolve <ICR_PARK_EXCHANGE>();
         var model = bllRecord.GetModelByAccount(this.tbUserName.Text.Trim(), GlobalEnvironment.LocalUserInfo.WORKSTATION_NO);
         if (null == model)
         {
             bllRecord.Add(GlobalEnvironment.LocalUserInfo);
         }
         this.DialogResult = DialogResult.OK; //返回一个登录成功的对话框状态
         this.Close();                        //关闭登录窗口
     }
     else
     {
         new G5MessageBox("用户名或密码错误").ShowDialog();
     }
 }
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HandReleaseForm_Load(object sender, EventArgs e)
        {
            tbCarNo.Text = dataUploadRecord.plateNum;
            if (null == dataUploadRecord.REPORTIMG_TIME)
            {
                lbInOutTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                lbInOutTime.Text = dataUploadRecord.REPORTIMG_TIME.ToString("yyyy-MM-dd HH:mm:ss");
            }
            lbInOut.Text = dataUploadRecord.CHANNEL_TYPE == enumChannelType.chn_in ? "入场时间 :" : "出场时间 :";

            List <Equipment> orgBase = new List <Equipment>();
            string           Ip      = CommHelper.GetRealIP();

            GlobalEnvironment.ListOragnization.Where(x => x.channelType == enumChannelType.wsn).ToList().ForEach(delegate(Equipment o)
            {
                if (o.Attributes.ContainsKey("IP"))
                {
                    if (Ip == o.Attributes["IP"])
                    {
                        GetChannel(ref orgBase, o.ORGANIZATION_CODE);
                    }
                }
            });
            this.cbChannelCode.DataSource    = orgBase.Where(X => X.channelType == dataUploadRecord.CHANNEL_TYPE).ToList();
            this.cbChannelCode.DisplayMember = "ORGANIZATION_NAME";
            this.cbChannelCode.ValueMember   = "ORGANIZATION_CODE";
            List <Parking.Core.Model.BAS_SYSTEM_DATA_DICT> dataList = bllDataDict.GetListByParentModelKey("VEHICLE_TYPE");

            this.cmbCarType.DataSource    = dataList;
            this.cmbCarType.DisplayMember = "MODEL_NAME";
            this.cmbCarType.ValueMember   = "MODEL_VALUE";
        }
 /// <summary>
 /// 放行出场
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         if (CommHelper.ValidateCarNum(this.tbCarNo.CarNO) || CommHelper.ValidateUnlicensedCar(this.tbCarNo.CarNO))
         {
             dataUploadRecord.plateNum       = this.tbCarNo.CarNO;
             dataUploadRecord.CHN_CODE       = this.cbChannelCode.SelectedValue.ToString();
             dataUploadRecord.CHN_NAME       = this.cbChannelCode.Text;
             dataUploadRecord.REPORTIMG_TIME = Convert.ToDateTime(this.lbInOutTime.Text);
             dataUploadRecord.carType        = Convert.ToInt32(this.cmbCarType.SelectedValue.ToString());
             dataUploadRecord.CarType        = (enumCarType)System.Enum.Parse(typeof(enumCarType), this.cmbCarType.SelectedValue.ToString());
             var converter            = EngineContext.Current.Resolve <IRecordConvert>(enumReleaseType.HandRelease.ToString());
             DataUploadEventArgs args = new DataUploadEventArgs()
             {
                 TempRecordInfo = dataUploadRecord
             };
             var recordInfo = converter.ConvertRecord(args);
             ThreadMessageTransact.Instance.AcceptFormalData(recordInfo);
             this.Close();
         }
         else
         {
             new G5MessageBox("请输入正确的车牌号码!").ShowDialog();
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log.Error(ex.Message);
     }
 }
Example #26
0
        private void button_BianJi1_Click(object sender, RoutedEventArgs e)
        {
            Button vButton = (Button)sender;
            int    vZhuHao = Convert.ToInt32(vButton.Tag);

            m_EditZhuHao = vZhuHao;

            label_DS_Title.Content = string.Format("定时参数(第{0}组)", vZhuHao + 1);

            Label      vLabel_DS_CZ = (Label)FindName(string.Format("label_DS_CZ{0}", m_EditZhuHao));
            TimingInfo vTimingInfo  = m_TimingInfoList.Where(m => m.LuHao == m_LuHao && m.ZhuHao == m_EditZhuHao).FirstOrDefault();

            if (vTimingInfo != null && vTimingInfo.DianYuanID != null && vTimingInfo.DianYuanID != "")
            {
                //vWeek = (byte)(timingInfo.TimeData >> 16);
                //vHour = (byte)(timingInfo.TimeData >> 8);
                //vMinute = (byte)(timingInfo.TimeData >> 0);
                //vLabel_DS_SJ.Content = string.Format("周{0} {1}:{2}", vWeek, vHour, vMinute);
                byte vWeek, vHour, vMinute, vDay;
                switch (vTimingInfo.ZhouQi)
                {
                case 0:
                    comboBox_ZQ.Text = "单次";
                    DateTime vDateTime = CommHelper.TimestampToDateTime(vTimingInfo.TimeData);
                    m_DatePicker.SelectedDate = vDateTime;
                    timePicker_Time.Value     = vDateTime;
                    break;

                case 1:
                    comboBox_ZQ.Text      = "每天";
                    vHour                 = (byte)(vTimingInfo.TimeData >> 8);
                    vMinute               = (byte)(vTimingInfo.TimeData >> 0);
                    timePicker_Time.Value = new DateTime(1970, 1, 1, vHour, vMinute, 0);
                    break;

                case 2:
                    vWeek   = (byte)(vTimingInfo.TimeData >> 16);
                    vHour   = (byte)(vTimingInfo.TimeData >> 8);
                    vMinute = (byte)(vTimingInfo.TimeData >> 0);
                    //byte vWeek = (byte)(vTimingInfo.TimeData >> 16);
                    m_ComboBox.Text       = string.Format("周{0}", convertWeekStr(vWeek));
                    comboBox_ZQ.Text      = "每周";
                    timePicker_Time.Value = new DateTime(1970, 1, 1, vHour, vMinute, 0);
                    break;

                case 3:
                    vDay    = (byte)(vTimingInfo.TimeData >> 16);
                    vHour   = (byte)(vTimingInfo.TimeData >> 8);
                    vMinute = (byte)(vTimingInfo.TimeData >> 0);
                    m_IntegerUpDown.Value = vDay;
                    comboBox_ZQ.Text      = "每月";
                    timePicker_Time.Value = new DateTime(1970, 1, 1, vHour, vMinute, 0);
                    break;
                }
                //timePicker_Time.Value = vDateTime;
                CheckBox_ChaoZhuo.IsChecked = vTimingInfo.RenWuLX == 0 ? false : true;
                CheckBox_YunXuKZ.IsChecked  = vTimingInfo.YunXuKZ == 0 ? false : true;
            }
        }
Example #27
0
        public string EmitSetGetGenericType(string name)
        {
            var model = new Model();

            CommHelper.EmitSet(model, "Name", name);

            return(CommHelper.EmitGet <Model, string>(model, "Name"));
        }
Example #28
0
        public string EmitSetGetObject(string name)
        {
            var model = new Model();

            CommHelper.EmitSet(model, "Name", name);

            return(CommHelper.EmitGet(model, "Name") as string);
        }
Example #29
0
        public string ReflectGetSet(string name)
        {
            var model = new Model();

            CommHelper.ReflectSet(model, "Name", name);

            return(CommHelper.ReflectGet(model, "Name") as string);
        }
Example #30
0
 void umsg_Closed1(object sender, EventArgs e)
 {
     if (umsg.DialogResult.Value == true)
     {
         CommHelper.BaseNavigate(this, PanelType.StartPanel);
         umsg.Closed -= new EventHandler(umsg_Closed1);
         this.UpdateLayout();
     }
 }