Example #1
0
 /// <summary>
 /// 获取命令
 /// </summary>
 /// <returns></returns>
 public static List <Model.AMS_IssureList> GetCommandState(Model.Enum.IsureCommandType command, int schoolID, Model.Enum.CommandHandleResult state)
 {
     AMS.IBllService.IAdvertManageBllService bllService = AMS.ServiceConnectChannel.AdvertManageBllServiceChannel.CreateServiceChannel();
     try
     {
         return(bllService.GetCommandState(command, schoolID, state));
     }
     catch (EndpointNotFoundException ex)
     {
         throw new AMS.Model.CustomerException("连接服务器失败");
     }
     catch (CommunicationException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         ICommunicationObject ICommObjectService = bllService as ICommunicationObject;
         try
         {
             if (ICommObjectService.State == CommunicationState.Faulted)
             {
                 ICommObjectService.Abort();
             }
             else
             {
                 ICommObjectService.Close();
             }
         }
         catch
         {
             ICommObjectService.Abort();
         }
     }
 }
Example #2
0
 /// <summary>
 /// 获取命令状态
 /// </summary>
 /// <param name="command"></param>
 /// <param name="schoolID"></param>
 /// <param name="state"></param>
 /// <returns></returns>
 public List <Model.AMS_IssureList> GetCommandState(Model.Enum.IsureCommandType command, int schoolID, Model.Enum.CommandHandleResult state)
 {
     try
     {
         List <Model.AMS_IssureList> modelList = new List <Model.AMS_IssureList>();
         StringBuilder strWhere = new StringBuilder();
         if (command != Model.Enum.IsureCommandType.None)
         {
             strWhere.Append(" CommandType=" + (int)command + " ");
         }
         if (schoolID > 0)
         {
             if (!string.IsNullOrEmpty(strWhere.ToString()))
             {
                 strWhere.Append(" and ");
             }
             strWhere.Append("SchoolID=" + schoolID + " ");
         }
         if (state != Model.Enum.CommandHandleResult.None)
         {
             if (!string.IsNullOrEmpty(strWhere.ToString()))
             {
                 strWhere.Append(" and ");
             }
             strWhere.Append(" Flag=" + (int)state + " ");
         }
         DataSet ds = dal_issureView.GetList(strWhere.ToString());
         for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
         {
             modelList.Add(DataRowToIssureList(ds.Tables[0].Rows[i]));
         }
         return(modelList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }