//readCmd: read a cmd which bleongs to a button, or combobox private Cmd readCmd(string cmdID) { Cmd cmd = new Cmd(); List<object> values = new List<object>(); values = dbReader(Cmdstring.cmd(cmdID), Cmdstring.cmd_fieldlist); cmd.cmdID = Convert.ToInt32(values[0]); cmd.cmdName = values[1].ToString(); cmd.cmdByte = Convert.ToInt32(values[2]); cmd.cmdComment = values[3].ToString(); return cmd; }
public Cmd Cmd(int _cmdid) { Cmd cmd = new Cmd(); DataRow drcmd = DSDatabase.Cmd.Select("CmdID=" + _cmdid)[0]; cmd.ID = Convert.ToInt32(drcmd["CmdID"]); cmd.Byte = MyConvert.ToByte(drcmd["CmdByte"].ToString()); cmd.Name = drcmd["CmdName"].ToString(); cmd.Comment=drcmd["CmdComment"].ToString(); return cmd; }