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