public List <Proyects> GetAllDecodedProyects(UserLicense.UserLicense UL) { List <Proyects> LP = new List <Proyects>(); // Its necessary to fill this LIST with Proyects from the license // which is coming from the UserLicense table, do a query where the // UL.idUser is the same as the current USER foreach (Proyects p in LP) { //p.DecodeProyect(p); } return(LP); }
/// <summary> /// Constructor that creates a proyect, creates a license for it and then creates a UserLicense linking the new License and the user that created /// this proyect. /// </summary> /// <param name="title"></param> /// <param name="summary"></param> /// <param name="idTemplate"></param> /// <param name="idLicense"></param> /// <param name="u"></param> public Proyects(string title, string summary, string creator, string website, string repository, string support, Users.Users u) { Id = Security.CryptoUtils.SHA256HashStringForUTF8String(lovis.Security.CryptoUtils.RandomKey()); // Create a new License for this PROYECT License.License L = new License.License(u); // Set IdLicense for this Proyect IDLICENSE IdLicense = L.IdLicense; // Create a UserLicens with this new IdLicense and IdUser UserLicense.UserLicense UL = new UserLicense.UserLicense(u.Id, IdLicense, 0, false); Title = Security.CryptoUtils.EncodeElementString(this, title); Summary = Security.CryptoUtils.EncodeElementString(this, summary); Owner = Security.CryptoUtils.EncodeElementString(this, creator); Repository = Security.CryptoUtils.EncodeElementString(this, repository); Website = Security.CryptoUtils.EncodeElementString(this, website); Support = Security.CryptoUtils.EncodeElementString(this, support); // Add to list lP.Add(this); }