/// <summary> /// 得到提醒信息 /// </summary> /// <param name="dto"></param> /// <returns></returns> public static ResultData <List <WarningDTO> > GetWarningInfo(WarningSearchDTO dto) { ResultData <List <WarningDTO> > result = new ResultData <List <WarningDTO> >(); result = GetAPI <ResultData <List <WarningDTO> > >(WebConfiger.MasterDataServicesUrl + "Warning?WarningSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto)); return(result); }
/// <summary> /// 得到提醒信息所有 /// </summary> /// <returns></returns> public ActionResult GetWarningAllInfo(WarningSearchDTO dto) { ResultData <List <WarningDTO> > result = new ResultData <List <WarningDTO> >(); UserLoginDTO user = (UserLoginDTO)Session["UserLoginInfo"]; dto.UserID = user.UserID; result = HomeProvider.GetWarningInfo(dto); return(Json(new { total = result.Count, rows = result.Object }, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage DeleteWarningInfo(string WarningSearchDTO) { WarningSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <WarningSearchDTO>(WarningSearchDTO); var actionresult = _ICommonServices.DeleteWarningInfo(dto); HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(JsonConvert.SerializeObject(actionresult), System.Text.Encoding.GetEncoding("UTF-8"), "application/json") }; return(result); }
/// <summary> /// 查询提醒管理 /// </summary> /// <returns></returns> public List <WarningDTO> GetWarningInfo(WarningSearchDTO dto) { List <WarningDTO> result = null; var tcdmse = SingleQueryObject.GetObj(); var pp = tcdmse.common_WarningInfo.AsNoTracking().Where(p => p.WarningID != null); pp = pp.Where(t => t.UserID == dto.UserID); dto.Count = pp.Count(); pp = pp.OrderBy(m => m.WarningID).Skip((dto.page - 1) * dto.rows).Take(dto.rows); result = Mapper.Map <List <common_WarningInfo>, List <WarningDTO> >(pp.ToList()); return(result); }
/// <summary> /// 删除一条提醒信息 /// </summary> /// <param name="dto"></param> /// <returns></returns> public ActionResult DeleteWarningInfo(WarningSearchDTO dto) { ResultData <object> result = new ResultData <object>(); try { result.SubmitResult = HomeProvider.DeleteWarningInfo(dto); } catch (Exception ex) { result.SubmitResult = false; result.Message = ex.Message; } return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 删除一条提醒信息 /// </summary> /// <returns></returns> public bool DeleteWarningInfo(WarningSearchDTO dto) { bool result = false; using (var tcdmse = new Entities.TCDMS_MasterDataEntities()) { var pp = tcdmse.common_WarningInfo.Where(p => p.WarningID == dto.WarningID).FirstOrDefault(); if (pp == null) { throw new Exception("此条信息不存在!"); } tcdmse.common_WarningInfo.Remove(pp); result = tcdmse.SaveChanges() > 0; } return(result); }
public HttpResponseMessage GetWarningInfo(string WarningSearchDTO) { WarningSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <WarningSearchDTO>(WarningSearchDTO); ResultDTO <List <WarningDTO> > actionresult = new ResultDTO <List <WarningDTO> >(); actionresult.Object = _ICommonServices.GetWarningInfo(dto); actionresult.SubmitResult = true; actionresult.rows = dto.rows; actionresult.page = dto.page; actionresult.Count = dto.Count; HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(JsonConvert.SerializeObject(actionresult), System.Text.Encoding.GetEncoding("UTF-8"), "application/json") }; return(result); }
/// <summary> /// 删除一条提醒信息 /// </summary> /// <param name="dto"></param> /// <returns></returns> public static bool DeleteWarningInfo(WarningSearchDTO dto) { bool blResult = DeleteAPI <bool>(WebConfiger.MasterDataServicesUrl + "Warning?WarningSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto)); return(blResult); }