Beispiel #1
0
        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);
        }
Beispiel #2
0
        void OnSetReq()
        {
            var e = ReceivedEvent as SetReq;

            this.State = e.Value;
            Unblock();
            Send(e.Target, new SetResp());
        }
Beispiel #3
0
        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");
            }
        }
Beispiel #4
0
        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");
            }
        }
Beispiel #5
0
    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;
	}
Beispiel #6
0
        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);
        }
Beispiel #7
0
 public Message(mtype MsgType, int nr)
 {
     this.MsgType = MsgType;
     this.nr      = nr;
 }
Beispiel #8
0
 public ColoredMessage(mtype coloredMsg)
 {
     this.ColoredMsg = coloredMsg;
 }
Beispiel #9
0
 void OnInitialize()
 {
     this.State           = mtype.Running;
     this.blockedMachines = new Dictionary <MachineId, mtype>();
 }
Beispiel #10
0
 public Waiting(MachineId target, mtype waitingOn)
 {
     this.Target    = target;
     this.WaitingOn = waitingOn;
 }
Beispiel #11
0
 public SetReq(MachineId target, mtype value)
 {
     this.Target = target;
     this.Value  = value;
 }
Beispiel #12
0
 public ValueResp(mtype value)
 {
     this.Value = value;
 }