Beispiel #1
0
        private void InitTimer()
        {
            string      xmlPath = AppDomain.CurrentDomain.BaseDirectory + "WatchConfig.xml";
            XmlDocument xmlDoc  = new XmlDocument();

            xmlDoc.Load(xmlPath);

            XmlNode xmlNode = xmlDoc.SelectSingleNode("//LineTypeConfig[@ConfigName='TimerConfig']");

            if (xmlNode != null)
            {
                XmlNodeList xmlNodeList = xmlNode.ChildNodes;

                foreach (XmlNode xn in xmlNodeList)
                {
                    XmlElement xe = (XmlElement)xn;
                    if (xe.Name == "timerExceptionInterval")
                    {
                        this.timerException.Interval = int.Parse(xe.InnerText);
                    }

                    if (xe.Name == "timerThreeAreaInterval")
                    {
                        this.timerThreeArea.Interval = int.Parse(xe.InnerText);
                    }

                    if (xe.Name == "CuerrtDay")
                    {
                        if (string.IsNullOrEmpty(xe.InnerText))
                        {
                            _NowDBDate = FormatHelper.GetNowDBDateTime(this.DataProvider).DBDate;
                        }
                        else
                        {
                            this.NowDBDate = int.Parse(xe.InnerText);
                        }
                    }
                }
            }

            WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider);
            string           shiftTypeCode    = string.Empty;
            TimePeriod       timePeriod       = (TimePeriod)watchPanelFacade.GettimePeriod(this.BigLine);

            if (timePeriod != null)
            {
                shiftTypeCode = timePeriod.ShiftTypeCode;
            }

            _NowDBDate = watchPanelFacade.GetShiftDay(shiftTypeCode, _NowDBDate, FormatHelper.GetNowDBDateTime(this.DataProvider).DBTime);

            this.timerException.Enabled = true;
            this.timerException.Enabled = true;
        }
Beispiel #2
0
        //当前日
        private int GetShiftDay(string bigSSCode)
        {
            WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider);
            string           shiftTypeCode    = string.Empty;
            TimePeriod       timePeriod       = (TimePeriod)watchPanelFacade.GettimePeriod(bigSSCode);

            if (timePeriod != null)
            {
                shiftTypeCode = timePeriod.ShiftTypeCode;
            }

            int shiftDay = watchPanelFacade.GetShiftDay(shiftTypeCode, _CuerrtDay, FormatHelper.GetNowDBDateTime(this.DataProvider).DBTime);

            return(shiftDay);
        }