//保存表单数据 public ActionResult SaveData(OtherInput OtherInput) { //参数对象可以对应接受数据 OtherInput.MakePerson = Session["UserName"].ToString(); //保存制单人 string result = OtherInputService.SaveData(OtherInput); //保存数据 return(Content(result.ToString())); }
protected void DeviceTypeDDL_SelectedIndexChanged(object sender, EventArgs e) { OtherInput.Visible = DeviceTypeDDL.SelectedValue.Equals("Other"); OtherLabel.Visible = OtherInput.Visible; if (OtherInput.Visible) { OtherInput.Focus(); } }
//获取表单数据 public ActionResult GetData() { string str = Request.Params["OtherInputId"];//单号 //如果新单据 没有数据 if (string.IsNullOrEmpty(str)) { return(Json(new OtherInput()));//返回一个新建的空对象 } //如果有数据 Guid OtherInputId = new Guid(Request["OtherInputId"]); //单据编号 OtherInput bill = OtherInputService.LoadEntities(t => t.Id == OtherInputId).FirstOrDefault(); //获取表单 return(Json(bill)); }
void ServerReceive(NetIncomingMessage msg) { ClientHeaders header = (ClientHeaders)msg.ReadByte(); switch (header) { case ClientHeaders.SET_TILE: int sX = msg.ReadInt32(); int sY = msg.ReadInt32(); int sSet = msg.ReadInt32(); world.SetTile(new Tile(sSet), sX, sY, false, true); break; case ClientHeaders.INPUT: int hor = msg.ReadInt32(); bool jump = msg.ReadBoolean(); OtherInput.hor = hor; OtherInput.PushJump(jump); break; case ClientHeaders.CHUNK_REQUEST: int cX = msg.ReadInt32(); int cY = msg.ReadInt32(); var newMsg = Networking.CreateMessage(); newMsg.Write((byte)ServerHeaders.SEND_CHUNK); newMsg.Write(cX); newMsg.Write(cY); newMsg.Write(world.chunks[cX, cY].ToBytes()); Networking.SendMessage(newMsg, NetDeliveryMethod.ReliableOrdered, 2); break; } }
private OtherInputState GetOtherState(OtherInput pOtherInput, OtherState pOtherState) { OtherInputState state = OtherInputState.Released; switch (pOtherInput) { case OtherInput.LeftStickFlickDown: state = pOtherState.LeftStickFlickDown; break; case OtherInput.LeftStickFlickLeft: state = pOtherState.LeftStickFlickLeft; break; case OtherInput.LeftStickFlickRight: state = pOtherState.LeftStickFlickRight; break; case OtherInput.LeftStickFlickUp: state = pOtherState.LeftStickFlickUp; break; case OtherInput.RightStickFlickDown: state = pOtherState.RightStickFlickDown; break; case OtherInput.RightStickFlickLeft: state = pOtherState.RightStickFlickLeft; break; case OtherInput.RightStickFlickRight: state = pOtherState.RightStickFlickRight; break; case OtherInput.RightStickFlickUp: state = pOtherState.RightStickFlickUp; break; } return state; }
private static InputState GetOtherState(OtherInput pOtherInput) { InputState state = new InputState(); state.Down = false; state.Pressed = false; state.Released = false; if (sOtherInputState.ContainsKey(pOtherInput)) { state.Down |= sOtherInputState[pOtherInput].Down; state.Pressed |= sOtherInputState[pOtherInput].Pressed; state.Released |= sOtherInputState[pOtherInput].Released; } return state; }
public void Listen(OtherInput pOtherInput) { if (!sOtherInputState.ContainsKey(pOtherInput)) { InputState state = new InputState(); OtherInputState otherState = GetOtherState(pOtherInput, sOtherState); state.Down = (otherState == OtherInputState.Pressed); state.Pressed = false; state.Released = false; sOtherInputState.Add(pOtherInput, state); } }
public void Alias(string pIndex, OtherInput pOtherInput) { if (!sOtherAlias.ContainsKey(pIndex)) sOtherAlias.Add(pIndex, new List<OtherInput>()); sOtherAlias[pIndex].Add(pOtherInput); if (!sOtherInputState.ContainsKey(pOtherInput)) { InputState state = new InputState(); OtherInputState otherState = GetOtherState(pOtherInput, sOtherState); state.Down = (otherState == OtherInputState.Pressed); state.Pressed = false; state.Released = false; sOtherInputState.Add(pOtherInput, state); } }
public static bool Up(OtherInput pOtherInput) { bool ret; if (GetOtherState(pOtherInput).Down) ret = false; else ret = true; return ret; }
public static bool Released(OtherInput pOtherInput) { bool ret; if (GetOtherState(pOtherInput).Released) ret = true; else ret = false; return ret; }