コード例 #1
0
        public static Dictionary <string, string> MechineSign(string mechineNo)
        {
            Dictionary <String, String> signResult = new Dictionary <String, String>();

            try
            {
                Dictionary <String, String> parameters = new Dictionary <String, String>();
                parameters.Add("tId", mechineNo);
                string url      = SysConfigHelper.readerNode("mechineSign");
                string jsonText = HttpHelper.getHttp(url, parameters, null);
                log.Write("设备签到返回:" + jsonText);
                JObject jsonObj = (JObject)JsonConvert.DeserializeObject(jsonText);
                if ("1".Equals(jsonObj["status"].ToString()))
                {
                    string clientPayNos = jsonObj["clientPayNo"].ToString();
                    signResult.Add("wtClientPayNo", clientPayNos.Split('|')[0]);
                    signResult.Add("lklClientPayNo", clientPayNos.Split('|')[1]);
                    signResult.Add("status", "1");

                    SysConfigHelper helper = new SysConfigHelper();

                    SysConfigHelper.writerNode("LklClientNo", signResult["lklClientPayNo"]); //设置拉卡拉终端号
                    SysConfigHelper.writerNode("ClientNo", signResult["wtClientPayNo"]);     //设置万通卡终端号
                                                                                             //SetAppConfig("LklClientNo", signResult["lklClientPayNo"]);
                                                                                             //SetAppConfig("ClientNo", signResult["wtClientPayNo"]);
                                                                                             //设置加载
                    SysFormLoad.loadBar("设备签到成功");
                }
                else
                {
                    signResult.Add("status", "0");
                }
            }
            catch (Exception e)
            {
                log.Write("设备签到异常:" + e.Message);
            }
            return(signResult);
        }
コード例 #2
0
        public static bool executeOrder(SystemOrder order)
        {
            try {
                switch (order.data.cmd_no)
                {
                case
                    "1011":    //重启电脑
                    log.Write("重启电脑");
                    Restart();
                    break;

                case
                    "2011":    //缴费系统停用
                    SysBLL.isDisableApp = true;
                    break;

                case
                    "2021":    //吞卡
                    break;

                case
                    "2022":    //退卡
                    break;

                case
                    "2031":    //检查所有设备硬件
                    break;

                case
                    "2041":    //关闭广告程序
                    KillApplication("GCMp4");
                    break;

                case
                    "2042":    //关闭监控程序
                    KillApplication("1413241343241234123");
                    break;

                case
                    "2043":    //关闭更新程序
                    KillApplication("1324123413241324132");
                    break;

                case
                    "2051":    //重启缴费程序
                    ShutDown();
                    break;

                case
                    "2052":    //重启广告播放程序
                    KillApplication("GCMp4");
                    StartApp(System.AppDomain.CurrentDomain.BaseDirectory + "GCMp4.exe");
                    break;

                case
                    "2053":    //重启更新程序
                    StartApp("");
                    break;

                case
                    "2061":    //上传日志
                    if (order.data.cmd_additional != null)
                    {
                        SysConfigHelper.writerNode("Gcmp4PlayIntervalName", (Convert.ToInt32(order.data.cmd_additional) * (1000 * 60)).ToString());
                    }
                    break;

                case
                    "2071":    //静音
                    Mute();
                    break;

                case
                    "2072":    //音量
                    GcManage.WriteYinliangValue(Convert.ToInt32(order.data.cmd_additional).ToString());
                    KillApplication("GCMp4");
                    StartApp(System.AppDomain.CurrentDomain.BaseDirectory + "GCMp4.exe");
                    break;

                case
                    "2081":    //删除指定文件
                    System.IO.File.Delete(order.data.cmd_additional);
                    break;

                case
                    "2091":    //暂停视频广告
                    SysConfigHelper.writerNode("isStopGCMp4", "1");
                    break;

                case
                    "2092":    //播放视频广告
                    SysConfigHelper.writerNode("isStopGCMp4", "2");
                    break;
                }
                return(true);
            }catch (Exception ex)
            {
                log.Write("error:命令执行异常:" + ex.Message + ",命令编号:" + order.data.cmd_no);
                return(false);
            }
        }