Exemplo n.º 1
0
		public static SecurityRight Save(SecurityRight right)
		{
			Connection c = conn;
			SecurityRight ret = (SecurityRight)c.Save((Org.Reddragonit.Dbpro.Structure.Table)right);
			c.Commit();
			c.CloseConnection();
			return ret;
		}
Exemplo n.º 2
0
		public static SecurityRight CreateSecurityRight(string Name)
		{
			SecurityRight sr = new SecurityRight();
			sr.Name=Name;
			List<SelectParameter> pars = new List<SelectParameter>();
			pars.Add(new EqualParameter("Name",Name));
			Connection c = conn;
			List<Org.Reddragonit.Dbpro.Structure.Table> rights = c.Select(sr.GetType(),pars);
			if (rights.Count>0)
				sr=(SecurityRight)rights[0];
			else{
				sr=Save(sr);
			}
			c.CloseConnection();
			return sr;
		}
Exemplo n.º 3
0
		public bool HasRight(SecurityRight right)
		{
			return HasRight(right.Name);
		}