public bool InsertDispatch(InputDispatch model) { using (IDbConnection conn = SqlConn.OpenConnectionPS()) { var sModel = conn.Query <OrdDispatch>("select * from OrdDispatch where state=0 and ConstId=@ConstId and RoleId=@RoleId", new { ConstId = model.ConstId, RoleId = model.RoleId }, commandType: CommandType.Text).ToList(); int result = 0; //抢单成功 if (sModel.Any()) { StringBuilder strSql = new StringBuilder(); strSql.Append(@"InsertOrdByUser"); result = conn.Query <int>(strSql.ToString(), new { ConstId = model.ConstId, UserId = model.UserId, RoleId = model.RoleId }, commandType: CommandType.StoredProcedure).FirstOrDefault(); } //else //{ // StringBuilder strSql = new StringBuilder(); // strSql.Append(@"update OrdMembers set state=3,createTime=Getdate() where ConstId=@ConstId and UId=@UserId"); // result = conn.Execute(strSql.ToString() // , new { ConstId = model.ConstId, UserId = model.UserId }); //} return(result > 0 ? true : false); } }
// Start is called before the first frame update void Start() { Application.targetFrameRate = 60; // Semi-presistent Main-owned objects // TODO: Should be in Awake()? frontend = (BeamFrontend)utils.findObjectComponent("BeamFrontend", "BeamFrontend"); uiController = (GameUiController)utils.findObjectComponent("GameUiController", "GameUiController"); gameCamera = (GameCamera)utils.findObjectComponent("GameCamera", "GameCamera"); gameNet = new BeamGameNet(); beamApp = new BeamApplication(gameNet, frontend); beamApp.Start(BeamModeFactory.kSplash); inputDispatch = new InputDispatch(this); // TODO: get rid of this Eth stuff (goes in GameNet) //eth = new EthereumProxy(); //eth.ConnectAsync(EthereumProxy.InfuraRinkebyUrl); // consumers should check eth.web3 before using }
public InputDispatch() { dispatch_["Websites QA"] = new InputDispatchQA(); dispatch_["Default"] = new InputDispatch(); }