예제 #1
0
        /// <summary>
        ///  执行中 的短信
        /// </summary>
        /// <param name="tel"></param>
        /// <param name="dics"></param>
        /// <returns></returns>
        public bool Doing(string no)
        {
            try
            {
                var order = DalContext.Repository <Order>().TableNoTracking.Where(o => o.BillNo == no).FirstOrDefault();
                if (order.OrderState < OrderStateEnum.执行中 || order.OrderState >= OrderStateEnum.务结束)
                {
                    return(false);
                }

                var orderAddr   = DalContext.Repository <OrderAddr>().TableNoTracking.Where(o => o.BillNo == no).FirstOrDefault();
                var orderWaiter = DalContext.Repository <OrderWaiter>().TableNoTracking.Where(o => o.BillNo == no).OrderByDescending(o => o.IsLeader).FirstOrDefault();


                if (IsTel(orderAddr.Tel))
                {
                    Dictionary <string, string> dics = new Dictionary <string, string>();
                    dics.Add("StartTime", no);
                    dics.Add("ProductName", order.ProductName);
                    dics.Add("ServiceNo", orderWaiter.ServiceName);
                    return(MessageInterface.SmsSend(orderAddr.Tel, "执行中", dics));
                }
            }
            catch (Exception exc)
            {
                NLogger.Error($"订单{no}'执行中'短信发送失败, {exc.Message}");
            }
            return(false);
        }
예제 #2
0
 /// <summary>
 /// 开始服务
 /// </summary>
 /// <param name="tel"></param>
 /// <param name="dics"></param>
 /// <returns></returns>
 public bool StartServic(string no)
 {
     try
     {
         var order     = DalContext.Repository <Order>().TableNoTracking.Where(o => o.BillNo == no).FirstOrDefault();
         var orderAddr = DalContext.Repository <OrderAddr>().TableNoTracking.Where(o => o.BillNo == no).FirstOrDefault();
         if (IsTel(orderAddr.Tel))
         {
             Dictionary <string, string> dics = new Dictionary <string, string>();
             dics.Add("ServerItemCode", no);
             dics.Add("RealStarTime", order.RealStartTime.ToString());
             return(MessageInterface.SmsSend(orderAddr.Tel, "开始服务", dics));
         }
     }
     catch (Exception exc)
     {
         NLogger.Error($"订单{no}'开始服务'短信发送失败, {exc.Message}");
     }
     return(false);
 }