Exemple #1
0
        /// <summary>
        /// 发送供应能力数据
        /// </summary>
        ///
        /// <returns></returns>
        public JsonResult TimerSupplyCapacitySend()
        {
            string Stage = Request["Stage"].ToString();

            if (Stage == "0")
            {
                HanaHelper Hana       = new HanaHelper();
                DataTable  dtPart     = Hana.GetTable("ZpartDatas", "matiCode,partType,weekName,quantity,area");
                var        jsonReturn = new { a = 0, b = dtPart };
                return(Json(jsonReturn));
            }
            else
            {
                string JsonString = Timer.TimerSupplyCapacitySend();
                var    jsonReturn = new { a = 1, b = JsonString };
                return(Json(jsonReturn));
            }
        }
Exemple #2
0
        public void Timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            return;

            TimerTools Timer = new TimerTools();
            // 得到 hour minute second  如果等于某个值就开始执行某个程序。
            int intHour   = e.SignalTime.Hour;
            int intMinute = e.SignalTime.Minute;
            int intSecond = e.SignalTime.Second;

            //定制时间; 比如 在10:30 :00 的时候执行某个函数
            //int iHour = 10;
            //int iMinute = 30;
            //int iSecond = 00;

            //设置 每秒钟的开始执行一次
            //if (intSecond == iSecond)
            //{

            //}
            //设置 每个小时的偶数分钟开始执行

            if (intMinute % 2 == 0)
            {
                Timer.TimerRequest();
                string WeekDay = DateTime.Now.DayOfWeek.ToString();
                //每周一调用一次
                if (WeekDay == "Monday" && intHour == 1 && intMinute == 0)
                {
                    Timer.TimerSupplyCapacitySend();
                    Timer.TimerDemandForecastRequest();//获取需求预测
                }
            }
            //设置 每天的2点发送部件详细数据
            if ((intHour == 2 && intMinute == 00))
            {
                Timer.TimerPartDatailsSend();
            }
            if ((intHour == 3 && intMinute == 00))
            {
                Timer.TimerTotalInventorySend();
            }
        }