public bool insertData(mtype k) { bool stat = false; try { Connection ConnG = new Connection(); ConnG.Konek(); strQuery = new MySql.Data.MySqlClient.MySqlCommand(); strQuery.Connection = ConnG.Conn; strQuery.CommandType = CommandType.Text; strQuery.CommandText = "INSERT INTO tblmtype VALUES(@TypeID,@Description,@Active)"; strQuery.Parameters.AddWithValue("@TypeID", k.TypeID); strQuery.Parameters.AddWithValue("@Description", k.Description); strQuery.Parameters.AddWithValue("@Active", k.Active); strQuery.ExecuteNonQuery(); stat = true; ConnG.Putus(); } catch (Exception ex) { MessageBox.Show(ex.Message); } return(stat); }
void OnSetReq() { var e = ReceivedEvent as SetReq; this.State = e.Value; Unblock(); Send(e.Target, new SetResp()); }
private void UbahTSB_Click(object sender, EventArgs e) { mtype k = new mtype(); k.TypeID = txtTypeID.Text; k.Description = txtDescription.Text; k.Active = Convert.ToInt32(txtActive.Text); //string costID = k.CostID; if (new mtypeCRUD().updateData(k)) { MessageBox.Show("Update Sukses"); Binding(); } else { MessageBox.Show("Update tidak berhasil"); } }
private void SimpanTSB_Click(object sender, EventArgs e) { mtype K = new mtype(); K.TypeID = txtTypeID.Text; K.Description = txtDescription.Text; K.Active = Convert.ToInt32(txtActive.Text); //K.Type = null; if (new mtypeCRUD().insertData(K)) { MessageBox.Show("Data berhasil di tambahkan"); Binding(); } else { MessageBox.Show("Data gagal ditambahkan"); } }
public LuaContex(PfnLog pfnLog,ILuaState pLua) { _pfnLog = pfnLog; _lua = pLua; if (_lua == null) { //_lua = LuaAPI.NewState(IntPtr.Zero); _lua.L_OpenLibs(); } AddGlobalFunction("pcall", Lua_pcall); AddGlobalFunction("print", Lua_Print); AddGlobalFunction("warn", Lua_Warn); AddGlobalFunction("dofile", Lua_DoFile); AddGlobalFunction("_useutf8", Lua_UseUtf8); AddGlobalFunction("_ParseInteger", Lua_ParseInteger); AddGlobalFunction("_floatAccuracy", Lua_FloatAccuracy); AddGlobalFunction("GetTime", Lua_GetTime); AddGlobalFunction("GetTimeInfo", Lua_GetTimeInfo); AddGlobalFunction("loadstring", Lua_loadstring); for (int i = 0; i < _callparms.Length; ++i) { _callparms[i] = new mtype(); } //UniLua.Tools.ULDebug.Log = WriteInfo; //UniLua.Tools.ULDebug.LogError = WriteError; }
public bool updateData(mtype k) { bool stat = false; try { Connection ConnG = new Connection(); ConnG.Konek(); strQuery = new MySql.Data.MySqlClient.MySqlCommand(); strQuery.Connection = ConnG.Conn; strQuery.CommandType = CommandType.Text; strQuery.CommandText = "UPDATE tblmtype SET DESCRIPTION=@Description,ACTIVE=@Active WHERE TYPEID=@TypeID"; strQuery.Parameters.AddWithValue("@Description", k.Description); strQuery.Parameters.AddWithValue("@Active", k.Active); strQuery.Parameters.AddWithValue("@TypeID", k.TypeID); strQuery.ExecuteNonQuery(); ConnG.Putus(); stat = true; } catch { } return(stat); }
public Message(mtype MsgType, int nr) { this.MsgType = MsgType; this.nr = nr; }
public ColoredMessage(mtype coloredMsg) { this.ColoredMsg = coloredMsg; }
void OnInitialize() { this.State = mtype.Running; this.blockedMachines = new Dictionary <MachineId, mtype>(); }
public Waiting(MachineId target, mtype waitingOn) { this.Target = target; this.WaitingOn = waitingOn; }
public SetReq(MachineId target, mtype value) { this.Target = target; this.Value = value; }
public ValueResp(mtype value) { this.Value = value; }