Ejemplo n.º 1
0
        /// <summary>
        /// 授权查询
        /// </summary>
        /// <returns></returns>
        public CardQueryExt GetPackList()
        {
            var          act = ActTypeBll.GetInstance().GetActTypeList();
            CardQueryExt ext = new CardQueryExt();

            ext.ActType = act;
            ext.VPack   = new List <XHB.Card.Entity.VPack>();
            return(ext);
        }
Ejemplo n.º 2
0
        public ActionResult Desktop()
        {
            var          act = ActTypeBll.GetInstance().GetActTypeList();
            CardQueryExt ext = new CardQueryExt();

            ext.ActType = act;
            ext.VPack   = new List <XHB.Card.Entity.VPack>();
            return(View(ext));
        }
Ejemplo n.º 3
0
        public ActionResult Query(FormCollection form)
        {
            if (form.Count == 0)
            {
                return(Redirect("/Card/Desktop"));
            }

            //string[] flag = { "cx", "kt", "cs", "xf" };

            //int flag = int.Parse(form["radio"]);

            //switch (flag)
            //{
            //    case 0:
            //        break;
            //    case 1:
            //        break;
            //    case 2:
            //        break;
            //    case 3:
            //        break;
            //    default:
            //        break;
            //}


            APIClient    client   = new APIClient();
            CardQueryExt queryExt = new CardQueryExt();

            string  ret  = client.Query(form["machine"].Trim());
            JObject o    = JObject.Parse(ret);
            string  json = ((JValue)o.SelectToken("Result")).Value.ToString();


            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List <VPack>));
            MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(json));
            object       ob     = serializer.ReadObject(stream);
            List <VPack> pack   = (List <VPack>)ob;

            var act = ActTypeBll.GetInstance().GetActTypeList();

            queryExt.VPack   = pack;
            queryExt.ActType = act;

            return(View("~/Views/Home/Desktop.cshtml", queryExt));
        }