/// <summary> /// Method that decodes a element /// </summary> /// <param name="p"></param> /// <returns></returns> public Elements DecodeElement(Proyects.Proyects p, Elements e) { e.Title = Security.CryptoUtils.DecodeElementString(p, e.Title); e.Type = Security.CryptoUtils.DecodeElementString(p, e.Type); e.State = Security.CryptoUtils.DecodeElementString(p, e.State); e.AssignedTo = Security.CryptoUtils.DecodeElementString(p, e.AssignedTo); e.Priority = Security.CryptoUtils.DecodeElementString(p, e.Priority); e.Summary = Security.CryptoUtils.DecodeElementString(p, e.Summary); e.DateCreation = e.DateCreation; e.DateStart = e.DateStart; e.DateFinish = e.DateFinish; e.IdProyect = e.IdProyect; return(e); }
/// <summary> /// Method that decodes an elements list from a proyect /// </summary> /// <param name="p">Proyect</param> /// <returns></returns> public List <Elements> GetAllElementsDecoded(Proyects.Proyects p) { List <Elements> LE = new List <Elements>(); // Its necessary to fill this LIST with elements from the P introduced // Do a linq query and get all elements from a certain idProyect // then add it to this LE list // Decode the entire list foreach (Elements e in LE) { e.DecodeElement(p, e); } return(LE); }
public Elements(string title, string type, string state, string priority, string assigendTo, string summary, DateTime dateStart, DateTime dateFinish, Proyects.Proyects p) { Id = Security.CryptoUtils.SHA1HashStringForUTF8String(lovis.Security.CryptoUtils.RandomKey()); Title = Security.CryptoUtils.EncodeElementString(p, title); Type = Security.CryptoUtils.EncodeElementString(p, type); State = Security.CryptoUtils.EncodeElementString(p, state); AssignedTo = Security.CryptoUtils.EncodeElementString(p, assigendTo); Priority = Security.CryptoUtils.EncodeElementString(p, priority); Summary = Security.CryptoUtils.EncodeElementString(p, summary); DateCreation = DateTime.Now; DateStart = dateStart; DateFinish = dateFinish; IdProyect = p.Id; lE.Add(this); }