public Permission(int id, FormName formName, ActionName actionName, Group group) { ID = id; FormName = formName; ActionName = actionName; Group = group; }
public UserInfo(int id, String nick, String password, Group group) { ID = id; Nick = nick; Password = password; Group = group; }
public void Add(String Nick, String Password, Group Group) { if (Password != "") Password = Authorization.HashCode(Password); String queryString = String.Format("INSERT INTO `{0}` VALUES(default,'{1}','{2}',{3});", _table, Nick.Replace("'", "''"), Password, Group.ID); _SQL.RunQuery(queryString); }
public void Change(int id, String Nick, String Password, Group Group) { String PasswordTerm = ""; if (Password != "") { Password = Authorization.HashCode(Password); PasswordTerm = String.Format(", `PASSWORD`='{0}'", Password); } String queryString = String.Format("UPDATE `{0}` SET `NICK`='{1}'{2}, `ID_GROUP`={3} WHERE `ID`={4}", _table, Nick.Replace("'", "''"), PasswordTerm, Group.ID, id); //MessageBox.Show(queryString); _SQL.RunQuery(queryString); }
public List<Permission> GetGroupPermissions(Group group) { String queryString = String.Format("SELECT * FROM `{0}` WHERE ID_GROUP={1}", _table, group.ID); String netString = _SQL.RunQuery(queryString); String[] lines = netString.Split('\n'); List<Permission> rv = new List<Permission>(); for (int i = 0; i < lines.Length; i++) { if (lines[i] == "") continue; rv.Add(parseLine(lines[i])); } return rv; }
public void Change(int id, FormName formName, ActionName actionName, Group group) { String queryString = String.Format("UPDATE `{0}` SET ID_FORM={1}, ID_ACTION={2}, ID_GROUP={3} WHERE ID={4}", _table, formName.ID, actionName.ID, group.ID, id); _SQL.RunQuery(queryString); }
public void Add(FormName formName, ActionName actionName, Group group) { String queryString = String.Format("INSERT INTO `{0}` VALUES(default,{1},{2},{3});", _table, formName.ID, actionName.ID, group.ID); _SQL.RunQuery(queryString); }
public void Change(Group item) { Change(item.ID, item.Name); }