Пример #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;
		}
Пример #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;
		}
Пример #3
0
		public bool HasRight(SecurityRight right)
		{
			return HasRight(right.Name);
		}