コード例 #1
0
 public HttpResponseMessage SetRole([FromBody] CC_Role role)
 {
     try
     {
         var db  = new RedisOperation(_RedisDB);
         var key = RedisKeys.CCMenuRoleKey(role.CustomerID, role.RoleID);
         db.InsertString(key, role);
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Success,
             Message = "success"
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }
コード例 #2
0
ファイル: CCPrizeController.cs プロジェクト: radtek/crm
 public HttpResponseMessage SetPrize([FromBody] CC_Prize Prize)
 {
     try
     {
         var db  = new RedisOperation(_RedisDB);
         var key = RedisKeys.CCPrizeKey(Prize.CustomerId, Prize.EventId);
         db.InsertString(key, Prize);
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Success,
             Message = "success"
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }
コード例 #3
0
 public HttpResponseMessage SetBasicSetting([FromBody] CC_BasicSetting basicSetting)
 {
     try
     {
         var db  = new RedisOperation(_RedisDB);
         var key = RedisKeys.CCBasicSetting(basicSetting.CustomerId);
         db.InsertString(key, basicSetting);
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Success,
             Message = "success"
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }
コード例 #4
0
ファイル: CCConnectionController.cs プロジェクト: radtek/crm
 public HttpResponseMessage SetConnection([FromBody] CC_Connection Connection)//FromBody代表接收的是form提交过来的方式,默认不填写时是get的方式
 {
     try
     {
         var db  = new RedisOperation(_RedisDB);
         var key = RedisKeys.CCConnectionKey(Connection.CustomerID); //key的定义格式:Connection.CustomerID
         db.InsertString(key, Connection);                           //会把Connection转换成json字符串来存储
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Success,
             Message = "success"
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }