Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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));
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        /// <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);
        }
Beispiel #5
0
        /// <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));
        }
Beispiel #6
0
        /// <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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
        /// <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);
        }