示例#1
0
        public static POSRestrict ToObject(XmlNode node)
        {
            POSRestrict set = new POSRestrict();

            if (node != null)
            {
                set.Minutes = int.Parse(node.Attributes["Minutes"].Value);
                set.Times   = int.Parse(node.Attributes["Times"].Value);
                if (node.Attributes["IsUsed"] != null)
                {
                    set.IsUsed = ConfigConvert.ConvertToBool(node.Attributes["IsUsed"].Value);
                }
            }
            return(set);
        }
示例#2
0
        public static XmlElement ToXmlNode(POSRestrict set, XmlDocument doc)
        {
            XmlElement secNode = doc.CreateElement("POSRestrict");

            if (set == null)
            {
                set = new POSRestrict()
                {
                    Minutes = 10, Times = 3, IsUsed = true
                };
            }
            secNode.SetAttribute("IsUsed", ConfigConvert.ConvertToString(set.IsUsed));
            secNode.SetAttribute("Minutes", set.Minutes.ToString());
            secNode.SetAttribute("Times", set.Times.ToString());
            return(secNode);
        }