Ejemplo n.º 1
0
        /// <summary>
        /// 发送取票信息
        /// </summary>
        public void sendTicketInfo2Tax()
        {
            status = 2;

            //0:uuid, 1:busiNo, 2:ticketNo, 3:timestamp, 4:IDCard, 5:IDName, 6:sfzjlxDm
            String[] detail = sendinfo.Split(new string[] { "|" }, StringSplitOptions.None);

            String strUrl    = string.Format("http://{0}/services/pdjhjWebService_updateQhhm?wsdl", SessionInfo.strUrl);
            String method    = "updateQhhmNew";
            String uuid      = detail[0];
            String busiNo    = detail[1];
            String ticketNo  = detail[2];
            long   timestamp = GetTimeStamp();
            String IDCard    = detail[4];
            String IDName    = detail[5];
            String sfzjlxDm  = IDCard.Length > 0 ? "201" : "";

            FConst.WriteLog(String.Format("传入参数:大厅id=[{0}] 业务编码=[{1}] 取号号码=[{2}] 时戳=[{3}] 身份证=[{4}] 姓名=[{5}] 身份证类型=[{6}]",
                                          uuid, busiNo, ticketNo, timestamp, IDCard, IDName, sfzjlxDm));

            try
            {
                FConst.WriteLog(String.Format("开始调用接口[{0}]{1}", method, strUrl));
                if (SessionInfo.nSystemType == 1)
                {
                    WebServiceProxy wsdl = new WebServiceProxy(strUrl, "pdjh");
                    FConst.WriteLog(String.Format("开始调用接口[{0}]{1},初始化完成", method, strUrl));
                    String result = wsdl.ExecuteQuery(method, new object[] { uuid, busiNo, ticketNo, timestamp, IDCard, IDName, sfzjlxDm }).ToString();

                    FConst.WriteLog(String.Format("调用方法{0}返回值:[{1}]", method, result));
                    String resultValue = JObject.Parse(result)["result"].ToString();
                    if (resultValue.Equals("1"))
                    {
                        status = 1;
                    }
                    FConst.WriteLog(String.Format("调用方法{0}结果状态:[{1}]", method, resultValue.Equals("1") ? "调用成功" : "调用失败"));
                }
                else
                {
                    FConst.WriteLog(String.Format("系统处于脱机方式,无法调用接口[SystemType={0}]", SessionInfo.nSystemType));
                }
            }
            catch (Exception ex)
            {
                FConst.WriteLog(String.Format("调用方法{0}时发生异常:{1}", method, ex.ToString()));
            }
        }
Ejemplo n.º 2
0
        public string getHallBusiInfo()
        {
            string hallBusiInfo = "";

            //string strSql = string.Format("Select BusiNo,BusiName,WaitNum,checkUser,BusiType,MenuType,IsHouseBusi,MetaBusiNo,AMGetNum,PMGetNum From tblBusi Where MenuType in (0,1) and Status=1 order by MenuType,SortID");
            //DBUtils dbUtils = new DBUtils();
            //DataTable dt = dbUtils.SelectSqlDB(strSql);
            //if (dt != null && dt.Rows.Count > 0)
            //{
            //    string uuid = dt.Rows[0]["QueueID"].ToString().Trim();
            //}

            JObject jsonBusiData = new JObject();
            JArray  jsonBusi     = new JArray();
            int     busiCount    = 0;

            DataTable     dt  = new DataTable();
            SqlConnection con = null;

            try
            {
                con = new SqlConnection(SessionInfo.strConn);
                con.Open();
                SqlCommand cmd = new SqlCommand("procGetBusiInfoEx", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter sqlda = new SqlDataAdapter(cmd);
                sqlda.Fill(dt);
                if (dt != null && dt.Rows.Count > 0)
                {
                    busiCount = dt.Rows.Count;
                    for (int idx = 0; idx < busiCount; idx++)
                    {
                        JObject jsonItem = new JObject();
                        jsonItem.Add("busino", dt.Rows[idx]["BusiNo"].ToString().Trim());
                        jsonItem.Add("businame", dt.Rows[idx]["BusiName"].ToString().Trim());

                        jsonBusi.Add(jsonItem);
                    }
                }
            }
            catch (Exception se)
            {
                FConst.WriteLog("获取业务列表信息procGetBusiInfoEx:" + se.Message);
                busiCount = 0;
                jsonBusi.Clear();
            }
            finally
            {
                try
                {
                    if (con != null)
                    {
                        con.Close();
                    }
                }
                catch {; }
                try
                {
                    if (dt != null)
                    {
                        dt.Clear();
                        dt.Dispose();
                    }
                }
                catch {; }
            }
            jsonBusiData.Add("rows", busiCount);
            jsonBusiData.Add("busi", jsonBusi);
            hallBusiInfo = JsonConvert.SerializeObject(jsonBusiData);

            return(hallBusiInfo);
        }