Ejemplo n.º 1
0
        public PCDController()
        {
            string ClassName = "ProcessXml", SetString = "SetPath", InitXmlDoc = "InitXml";
            MemoryCacherApi Cache = new MemoryCacherApi();

            //init setting
            if ((Info = (SettingInfo)Cache.GetValue(SetString)) == null)
            {
                Info = new SettingInfo();
                DateTimeOffset TimeOffset = DateTimeOffset.Now.AddMonths(1);
                Cache.AddCache(SetString, Info, TimeOffset);
            }

            //init xml
            if ((Xml = (InitXml)Cache.GetValue(InitXmlDoc)) == null)
            {
                Xml = new InitXml(Info);
                DateTimeOffset TimeOffset = DateTimeOffset.Now.AddHours(5);
                Cache.AddCache(InitXmlDoc, Xml, TimeOffset);
            }

            //init processxml
            if ((XmlOperation = (ProcessXml)Cache.GetValue(ClassName)) == null)
            {
                XmlOperation = new ProcessXml(Info, Xml);
                DateTimeOffset TimeOffset = DateTimeOffset.Now.AddHours(5);
                Cache.AddCache(ClassName, XmlOperation, TimeOffset);
            }
        }
 public SeriesNumberUpdateController()
 {
     string SetString = "Path2";
     //init setting
     if ((PathInfo = (SettingInfo)Cache.GetValue(SetString)) == null)
     {
         PathInfo = new SettingInfo();
        PathInfo.UpdatePath = @"D:\C sharp code\LongTermCare(Xml)\Update\";
         DateTimeOffset TimeOffset = DateTimeOffset.Now.AddMonths(1);
         Cache.AddCache(SetString, PathInfo, TimeOffset);
     }
     XmlOperation = new ProcessXml(PathInfo);
 }