Beispiel #1
0
        /// <summary>
        /// Return Serialized String version of [data] Object
        /// </summary>
        /// <param name="data">as Resource</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private static string XMLSerializeToString(Resource data)
        {
            try
            {
                XmlSerializer xmlSer = new XmlSerializer(typeof(Resource));
                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;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Set MyBase to values of [data]
        /// </summary>
        /// <param name="data">as resource</param>
        /// <returns></returns>
        internal bool SetBase(Resource data)
        {
            try
            {
                RSID = data.RSID;
                PID = data.PID;
                Name = data.Name;
                Email = data.Email;
                Phone = data.Phone;
                RoleID = data.RoleID;

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