/// <summary>
        /// 命令执行
        /// </summary>
        /// <param name="context"></param>
        public override void Execute(DataContext context)
        {
            UserCacheInfo userCache = UserBiz.ReadUserCacheInfo(context.UserId);

            if (userCache.UserSite > 0)
            {
                var scUserIds = SchoolBiz.GetSchoolUserIds(userCache.UserSite, (int)UserRole.CustomerService);
                CustomerServiceList csList = new CustomerServiceList {
                    DataList = scUserIds.Select(id => UserBiz.ReadUserCacheInfo(id).ToUserBase()).ToList()
                };
                context.Flush <CustomerServiceList>(csList);
                return;
            }
            context.Flush(RespondCode.DataInvalid);
        }
Exemplo n.º 2
0
 private IEnumerable <CustomerService> GetByCustomerId(long CustomerId)
 {
     try {
         List <CustomerService> CustomerServiceList = null;
         using (DbCommand dbcmdCustomerService = _Database.GetStoredProcCommand(PROC_CUSTOMERSERVICE_GETBYCUSTOMERID)) {
             _Database.AddInParameter(dbcmdCustomerService, CUSTOMERID, DbType.Int64, CustomerId);
             using (IDataReader reader = _Database.ExecuteReader(dbcmdCustomerService)) {
                 if (CustomerServiceList == null)
                 {
                     CustomerServiceList = new List <CustomerService>();
                 }
                 CustomerServiceList.Add(Mapper(reader));
             }
         }
         return(CustomerServiceList);
     }
     catch (Exception ex) {
         throw ex;
     }
 }