Esempio n. 1
0
 public object GetEveryEntity([FromBody] JObject json)
 {
     try
     {
         string  res = json.Value <string>("json");
         dynamic dy  = JsonConvert.DeserializeObject <ExpandoObject>(res);
         //获取用户Id
         string userId = dy.userid;
         OperatorProvider.AppUserId = userId;  //设置当前用户
         Operator curUser = OperatorProvider.Provider.Current();
         if (null == curUser)
         {
             return(new { code = -1, count = 0, info = "请求失败,请登录!" });
         }
         string            id   = dy.data.Id;//ID
         var               data = everydaypatrolbll.GetEntity(id);
         EverydayPatrolApp everydayPatrolApp = new EverydayPatrolApp();
         everydayPatrolApp.Jurisdiction               = "1,1,1";
         everydayPatrolApp.EverydayPatrolEntity       = data;
         everydayPatrolApp.EverydayPatrolDetailEntity = GetEverydayPatrolDetailGrid(id);
         return(new { Code = 0, Count = 1, Info = "获取数据成功", data = everydayPatrolApp });
     }
     catch (Exception ex)
     {
         return(new { Code = -1, Count = 0, Info = ex.Message });
     }
 }
Esempio n. 2
0
 public object GetEveryEntity([FromBody] JObject json)
 {
     try
     {
         string  res = json.Value <string>("json");
         dynamic dy  = JsonConvert.DeserializeObject <ExpandoObject>(res);
         //获取用户Id
         string userId = dy.userid;
         OperatorProvider.AppUserId = userId;  //设置当前用户
         Operator curUser = OperatorProvider.Provider.Current();
         if (null == curUser)
         {
             return(new { code = -1, count = 0, info = "请求失败,请登录!" });
         }
         string id     = dy.data.Id;//ID
         var    data   = everydaypatrolbll.GetEntity(id);
         string webUrl = new DataItemDetailBLL().GetItemValue("imgUrl");
         if (data.Signature.IndexOf("http") > -1)
         {
             data.Signature = data.Signature;
         }
         else
         {
             data.Signature = webUrl + data.Signature;
         }
         EverydayPatrolApp everydayPatrolApp = new EverydayPatrolApp();
         everydayPatrolApp.Jurisdiction               = "1,1,1";
         everydayPatrolApp.EverydayPatrolEntity       = data;
         everydayPatrolApp.EverydayPatrolDetailEntity = GetEverydayPatrolDetailGrid(id);
         everydayPatrolApp.AffirmRecordEntity         = GetAffirmRecordGrid(id);
         return(new { Code = 0, Count = 1, Info = "获取数据成功", data = everydayPatrolApp });
     }
     catch (Exception ex)
     {
         return(new { Code = -1, Count = 0, Info = ex.Message });
     }
 }