Пример #1
0
        public BaseResultDto <string> DeleteAll(RQIdModel <int> model)
        {
            BaseResultDto <string> result = new BaseResultDto <string>();

            try
            {
                if (model.IdList.Count > 0 &&
                    helper.Delete <SystemNotice>(string.Format(" Id in({0}) ", string.Join(",", model.IdList.ToArray()))))
                {
                    result.ErrorMsg  = "成功";
                    result.ErrorCode = 1;
                }
                else
                {
                    result.ErrorMsg  = "失败";
                    result.ErrorCode = 0;
                }
            }
            catch (Exception ex)
            {
                result.ErrorMsg  = ex.Message;
                result.ErrorCode = -1;
            }
            return(result);
        }
Пример #2
0
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <returns></returns>
        public JsonResult PatchDelNotice()
        {
            JsonResult result = null;

            try
            {
                RQIdModel <int> model = new RQIdModel <int>();
                //......
                BaseResultDto <string> resultDto = HttpHelper.CreatHelper().DoPostObject <BaseResultDto <string> >(string.Format("{0}Notice/DeleteAll", this.WebApiUrl), model);
                result = Json(new { status = resultDto.ErrorCode, message = resultDto.ErrorMsg }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                result = Json(new { status = -1, message = ex.Message }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }