示例#1
0
        public HttpResponseMessage GetUser()
        {
            string key = "user";
            //读库存缓存
            var db = RedisHelper.GetRedisDB();

            if (!db.KeyExists(key))
            {
                string json = JsonConvert.SerializeObject(GetBll <UserInfo> .createDal().Get());
                RedisHelper.SetString(key, json);
            }
            string    result    = RedisHelper.GetString(key);
            ResultMsg resultMsg = null;

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = result;
            HttpResponseMessage obj = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(JsonConvert.SerializeObject(resultMsg), Encoding.UTF8, "text/json")
            };

            return(obj);
        }
示例#2
0
 public int UpdAdmin(AdminInfo admin)
 {
     return(GetBll <AdminInfo> .createDal().Upd(admin));
 }
示例#3
0
 public int AddUser(UserInfo user)
 {
     return(GetBll <UserInfo> .createDal().Add(user));
 }
示例#4
0
 //修改交易信息
 public int UpdDeal(DealRecord deal)
 {
     return(GetBll <DealRecord> .createDal().Upd(deal));
 }
示例#5
0
 public int DelAdmin(int id)
 {
     return(GetBll <AdminInfo> .createDal().Del(id));
 }
示例#6
0
 //修改用户
 public int UpdUser(OrderInfo order)
 {
     return(GetBll <OrderInfo> .createDal().Upd(order));
 }
示例#7
0
 //删除交易信息
 public int DelDeal(int id)
 {
     return(GetBll <DealRecord> .createDal().Del(id));
 }
示例#8
0
 //添加用户
 public int AddOrder(OrderInfo order)
 {
     return(GetBll <OrderInfo> .createDal().Add(order));
 }
示例#9
0
 //删除用户
 public int DelOrder(int id)
 {
     return(GetBll <OrderInfo> .createDal().Del(id));
 }
示例#10
0
 //删除物品
 public int DelRec(int id)
 {
     return(GetBll <Recycles> .createDal().Del(id));
 }
示例#11
0
 //修改物品
 public int UpdUser(Recycles recycles)
 {
     return(GetBll <Recycles> .createDal().Upd(recycles));
 }
示例#12
0
 //添加物品
 public int AddRec(Recycles recycles)
 {
     return(GetBll <Recycles> .createDal().Add(recycles));
 }
示例#13
0
 //修改类别
 public int UpdCategory(Category category)
 {
     return(GetBll <Category> .createDal().Upd(category));
 }
示例#14
0
 //删除类别
 public int DelCategory(int id)
 {
     return(GetBll <Category> .createDal().Del(id));
 }
示例#15
0
 //修改回收员
 public int UpdCollector(CollectorInfo collector)
 {
     return(GetBll <CollectorInfo> .createDal().Upd(collector));
 }
示例#16
0
 //删除回收员
 public int DelCollector(int id)
 {
     return(GetBll <CollectorInfo> .createDal().Del(id));
 }