Exemplo n.º 1
0
        /// <summary>
        /// Return Serialized String version of [data] Object
        /// </summary>
        /// <param name="data">as Project</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private static string XMLSerializeToString(Project data)
        {
            try
            {
                XmlSerializer xmlSer = new XmlSerializer(typeof(Project));
                MemoryStream ms = new MemoryStream();
                StreamReader strReader = default(StreamReader);
                string output = null;

                xmlSer.Serialize(ms, data);
                ms.Position = 0;
                strReader = new StreamReader(ms);
                output = strReader.ReadToEnd();
                return output;
            }
            catch (Exception ex)
            {
                GetLastError = ex;
                return null;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Set MyBase to values of [data]
        /// </summary>
        /// <param name="data">as project</param>
        /// <returns></returns>
        internal Boolean SetBase(Project data)
        {
            try
            {
                PID = data.PID;
                Icon = data.Icon;
                Code = data.Code;
                Name = data.Name;
                Description = data.Description;
                EstimatedStartDate = data.EstimatedStartDate;
                EstimatedEndDate = data.EstimatedEndDate;
                ActualStartDate = data.ActualStartDate;
                ActualEndDate = data.ActualEndDate;
                Folder = data.Folder;
                Caption = data.Caption;
                URL = data.URL;
                Organization = data.Organization;

                Tasks = data.Tasks;

                return true;
            }
            catch (Exception ex)
            {
                GetLastError = ex;
                throw ex;
            }
        }