示例#1
0
        public CommonResponse Process(CommandResponse pRequest)
        {
            CommonResponse response = new CommonResponse();

            try
            {
                response.ResultCode = 0;
                DefaultSQLHelper       _sqlHelper = new DefaultSQLHelper(ConfigurationManager.AppSettings["MobileLogConn"]);
                MobileCommandRecordDAO DAO        = new MobileCommandRecordDAO(new Base.MobileDeviceManagementUserInfo(), _sqlHelper);
                var entity = DAO.GetByID(pRequest.CommandID);
                if (entity != null)
                {
                    entity.CommandResponseCount++;
                    entity.ResponseJson = pRequest.ToJSON();
                    if (pRequest.ResponseCode < 100)
                    {
                        entity.Status       = 100;
                        entity.ResponseCode = 0;
                    }
                    else
                    {
                        entity.Status       = 2;
                        entity.ResponseCode = 1;
                        if (entity.CommandResponseCount >= 3)
                        {
                            entity.Status = 3;
                        }
                    }
                    if (pRequest.NeedRepeat)
                    {
                        entity.LastUpdateTime = DateTime.Now;
                    }
                    DAO.Update(entity);
                }
                else
                {
                    throw new Exception("未找到命令");
                }
            }
            catch (Exception ex)
            {
                Loggers.Exception(new ExceptionLogInfo(ex));
                response.Message    = ex.Message;
                response.ResultCode = 200;
            }
            return(response);
        }
示例#2
0
 public string[] Process(CommandRequest pRequest)
 {
     try
     {
         DefaultSQLHelper       _sqlHelper = new DefaultSQLHelper(ConfigurationManager.AppSettings["MobileLogConn"]);
         MobileCommandRecordDAO DAO        = new MobileCommandRecordDAO(new Base.MobileDeviceManagementUserInfo(), _sqlHelper);
         var entitys = DAO.GetCommand(pRequest.ClientID, pRequest.UserID);
         if (entitys.Length > 0)
         {
             if (DAO.UpdateIsDelete(_sqlHelper.CreateTransaction(), entitys) > 0)
             {
                 return(entitys.Aggregate(new List <string>()
                 {
                 }, (i, j) =>
                 {
                     i.Add(j.RecordID + " " + j.CommandText);
                     return i;
                 }).ToArray());
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         Loggers.Exception(new ExceptionLogInfo(ex));
         return(new List <string>()
         {
             ex.Message
         }.ToArray());
     }
 }
示例#3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public MobileCommandRecordBLL(MobileDeviceManagementUserInfo pUserInfo, ISQLHelper pSQLHelper)
 {
     this._currentDAO = new MobileCommandRecordDAO(pUserInfo, pSQLHelper);
 }