Ejemplo n.º 1
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="us">User short profile</param>
 public User(UserBrief us)
 {
     ID = new Guid(us.ID.ToByteArray());
     DisplayName = (string)us.DisplayName.Clone();
     Title = (string)us.Title.Clone();
     AvatarSmallURL = (string)us.AvatarSmallURL.Clone();
 }
Ejemplo n.º 2
0
 public void Clear()
 {
     CanEdit = false;
     ID = 0;
     Title = "";
     Description = "";
     Deadline = null;
     Priority = ProjectTaskPriority.Normal;
     MilestoneID = 0;
     ProjectOwner = null;
     Status = ProjectTaskStatus.Unclassified;
     IsExpired = false;
     Responsible = null;
     Created = null;
     CreatedBy = null;
     Updated = null;
     UpdatedBy = null;
 }
Ejemplo n.º 3
0
        public void Deserialize(XmlNode node)
        {
            Clear();

            XmlNodeList children = node.ChildNodes;
            foreach (XmlNode nodeItem in children)
            {
                string name = nodeItem.Name.ToLower().Trim();

                if (name == "canedit")
                    CanEdit = HelperXML.GetBool(nodeItem);
                else if (name == "id")
                    ID = HelperXML.GetInt32(nodeItem);
                else if (name == "title")
                    Title = nodeItem.InnerText;
                else if (name == "description")
                    Description = nodeItem.InnerText;
                else if (name == "deadline")
                    Deadline = HelperXML.GetDateTime(nodeItem);
                else if (name == "priority")
                    Priority = (ProjectTaskPriority)HelperXML.GetInt32(nodeItem);
                else if (name == "milestoneid")
                    MilestoneID = HelperXML.GetInt32(nodeItem);
                else if (name == "projectowner")
                {
                    ProjectOwner = new ProjectBrief();
                    ProjectOwner.Connection = Connection;
                    ProjectOwner.Deserialize(nodeItem);
                }
                else if (name == "status")
                    Status = (ProjectTaskStatus)HelperXML.GetInt32(nodeItem);
                if (name == "isexpired")
                    IsExpired = HelperXML.GetBool(nodeItem);
                else if (name == "responsible")
                {
                    Responsible = new UserBrief();
                    Responsible.Connection = Connection;
                    Responsible.Deserialize(nodeItem);
                }
                else if (name == "created")
                    Created = HelperXML.GetDateTime(nodeItem);
                else if (name == "createdby")
                {
                    CreatedBy = new UserBrief();
                    CreatedBy.Connection = Connection;
                    CreatedBy.Deserialize(nodeItem);
                }
                else if (name == "updated")
                    Updated = HelperXML.GetDateTime(nodeItem);
                else if (name == "updatedby")
                {
                    UpdatedBy = new UserBrief();
                    UpdatedBy.Connection = Connection;
                    UpdatedBy.Deserialize(nodeItem);
                }
            }
        }
Ejemplo n.º 4
0
        public override void Deserialize(XmlNode node)
        {
            base.Deserialize(node);

            XmlNodeList children = node.ChildNodes;
            foreach (XmlNode nodeItem in children)
            {
                string name = nodeItem.Name.ToLower().Trim();

                if (name == "description")
                    Description = nodeItem.InnerText;
                else if (name == "canedit")
                    CanEdit = HelperXML.GetBool(nodeItem);
                else if (name == "responsible")
                {
                    Responsible = new UserBrief();
                    Responsible.Connection = Connection;
                    Responsible.Deserialize(nodeItem);
                }
                else if (name == "isprivate")
                    IsPrivate = HelperXML.GetBool(nodeItem);
                else if (name == "taskcount")
                    TaskCount = HelperXML.GetInt32(nodeItem);
                else if (name == "milestonecount")
                    MilestoneCount = HelperXML.GetInt32(nodeItem);
                else if (name == "participantcount")
                    ParticipantCount = HelperXML.GetInt32(nodeItem);
            }
        }
Ejemplo n.º 5
0
        public override void Deserialize(XmlNode node)
        {
            base.Deserialize(node);

            XmlNodeList children = node.ChildNodes;
            foreach (XmlNode nodeItem in children)
            {
                string name = nodeItem.Name.ToLower().Trim();

                if (name == "canedit")
                    CanEdit = HelperXML.GetBool(nodeItem);
                else if (name == "security")
                    ParseSecurity(nodeItem);
                else if (name == "projectfolder")
                    ProjectFolder = HelperXML.GetInt32(nodeItem);
                else if (name == "responsible")
                {
                    Responsible = new UserBrief();
                    Responsible.Connection = Connection;
                    Responsible.Deserialize(nodeItem);
                }
                else if (name == "isprivate")
                    IsPrivate = HelperXML.GetBool(nodeItem);
                else if (name == "createdby")
                {
                    CreatedBy = new UserBrief();
                    CreatedBy.Connection = Connection;
                    CreatedBy.Deserialize(nodeItem);
                }
                else if (name == "created")
                    Created = HelperXML.GetDateTime(nodeItem);
                else if (name == "updated")
                    Updated = HelperXML.GetDateTime(nodeItem);
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Returns user file with specified ID
 /// </summary>
 /// <param name="user">User profile which contains ID to search</param>
 /// <returns>User profile or null if user was not found</returns>
 public User GetUser(UserBrief user)
 {
     return GetUser(user.ID);
 }
Ejemplo n.º 7
0
 public void Clear()
 {
     CanEdit = false;
     ID = 0;
     Title = "";
     Description = "";
     IsNotify = false;
     IsKey = false;
     Deadline = null;
     ProjectOwner = null;
     Status = ProjectMilestoneStatus.Open;
     Responsible = null;
     Created = null;
     CreatedBy = null;
     Updated = null;
     UpdatedBy = null;
 }
Ejemplo n.º 8
0
        public void Deserialize(XmlNode node)
        {
            Clear();

            XmlNodeList children = node.ChildNodes;
            foreach (XmlNode nodeItem in children)
            {
                string name = nodeItem.Name.ToLower().Trim();

                if (name == "id")
                    ID = HelperXML.GetInt32(nodeItem);
                else if (name == "date")
                    Date = HelperXML.GetDateTime(nodeItem);
                else if (name == "hours")
                    Hours = HelperXML.GetFloat(nodeItem, "en-US");
                else if (name == "note")
                    Notes = nodeItem.InnerText;
                else if (name == "relatedproject")
                    RelatedProjectID = HelperXML.GetInt32(nodeItem);
                else if (name == "relatedtask")
                    RelatedTaskID = HelperXML.GetInt32(nodeItem);
                else if (name == "createdby")
                {
                    CreatedBy = new UserBrief();
                    CreatedBy.Connection = Connection;
                    CreatedBy.Deserialize(nodeItem);
                }
            }
        }