Esempio n. 1
0
        public ActionResult Create()
        {
            string expect = Request.Form["expect"];
            int    lid    = int.Parse(Request.Form["lid"]);

            Tcp_Clscript tcp = new Tcp_Clscript();

            if (!tcp.SelectByPK(lid))
            {
                return(FailResult("获取策略脚本失败!"));
            }
            CPQaunt.Facade.BuilderScriptFacade builder = new CPQaunt.Facade.BuilderScriptFacade();

            MessageScriptModel message = builder.Builder(expect, tcp.Content);  //得到下注数字集合

            if (message.type == MessageType.Log)
            {
                return(FailResult(message.message));
            }

            StringBuilder stringBuilder = new StringBuilder();


            foreach (var item in message.numbers)
            {
                string str = item.N1.ToString() + item.N2.ToString() + item.N3.ToString() + item.N4.ToString() + item.N5.ToString() + ",";
                stringBuilder.AppendLine(str);
            }


            return(SuccessResult(stringBuilder.ToString()));
        }
Esempio n. 2
0
        public ActionResult Load()
        {
            int lid = int.Parse(Request.Form["lid"]);

            Tcp_Clscript tcp = new Tcp_Clscript();

            if (tcp.SelectByPK(lid))
            {
                var model = MapProvider.Map <DataScriptModel>(tcp.DataRow);
                return(JsonResult(model));
            }

            return(FailResult("查询失败!"));
        }
Esempio n. 3
0
        public ActionResult HuiCe()
        {
            string expect = Request.Form["expect"];

            int lid = int.Parse(Request.Form["lid"]);

            Tcp_Clscript tcp = new Tcp_Clscript();

            if (!tcp.SelectByPK(lid))
            {
                return(FailResult("获取策略脚本失败!"));
            }
            CPQaunt.Facade.BuilderScriptFacade builder = new CPQaunt.Facade.BuilderScriptFacade();

            MessageScriptModel message = builder.Builder(expect, tcp.Content);  //得到下注数字集合

            if (message.type == MessageType.Log)
            {
                return(FailResult(message.message));
            }

            Tcp_Hiscode tcphis = new Tcp_Hiscode();

            if (tcphis.SelectByExpect(expect))
            {
                string[]    sl     = tcphis.Opencode.Split(',');
                NumberModel number = new NumberModel();
                number.N1 = int.Parse(sl[0]);
                number.N2 = int.Parse(sl[1]);
                number.N3 = int.Parse(sl[2]);
                number.N4 = int.Parse(sl[3]);
                number.N5 = int.Parse(sl[4]);

                foreach (var item in message.numbers)
                {
                    if (item.N1 == number.N1 && item.N2 == number.N2 && item.N3 == number.N3 && item.N4 == number.N4 && item.N5 == number.N5)
                    {
                        return(SuccessResult(message.numbers.Count));
                    }
                }
                return(SuccessResult("0"));
            }
            return(FailResult("回测失败!"));
        }
Esempio n. 4
0
        public ActionResult Update()
        {
            int          lid = int.Parse(Request.Form["lid"]);
            Tcp_Clscript tcp = new Tcp_Clscript();

            if (!tcp.SelectByPK(lid))
            {
                return(FailResult());
            }

            tcp.Name    = Request.Form["name"];
            tcp.Content = Request.Form["content"];
            tcp.Remark  = Request.Form["remark"];


            if (tcp.Update())
            {
                return(SuccessResult());
            }

            return(FailResult("修改失败!"));
        }