コード例 #1
0
        public JsonResult getFiliale(int page, int rows)
        {
            var list   = new JiaJiBLL.FilialeBll().FilialeShow();
            var result = new { total = list.Count, rows = list.OrderBy(e => e.FilialeId).Skip((page - 1) * rows).Take(rows) };

            return(Json(result));
        }
コード例 #2
0
        /// <summary>
        /// 删除资讯
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int deleteFilialeadd(string ids)
        {
            bool isOK = new JiaJiBLL.FilialeBll().DelFilialeText(ids);

            if (isOK)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
コード例 #3
0
        public JsonResult getFilialeadd(int page, int rows, int?FilialeId = null)
        {
            var list   = new JiaJiBLL.FilialeBll().ShowFenGongsi();
            var result = new
            {
                total = list.
                        Where(e =>
                              (FilialeId == null ? true : e.FilialeId == FilialeId)

                              ).Count(),
                rows = list.
                       Where(e =>
                             (FilialeId == null ? true : e.FilialeId == FilialeId)

                             ).Skip((page - 1) * rows).Take(rows)
            };

            return(Json(result));
        }
コード例 #4
0
 public JsonResult addFiliale(JiaJiModels.filialetext infor)
 {
     try
     {
         var i = new JiaJiBLL.FilialeBll().addFiliale(infor);
         if (i > 0)
         {
             return(Json(new { Success = true, Message = "添加成功" }));
         }
         else
         {
             return(Json(new { Success = false, Message = "添加失败" }));
         }
     }
     catch
     {
         return(Json(new { Success = false, Message = "添加失败" }));
     }
 }
コード例 #5
0
        public JsonResult editFilialeadd(JiaJiModels.filialetext model)
        {
            try
            {
                int id = model.FilialeTextId;

                var i = new JiaJiBLL.FilialeBll().UpdateFilialeText(model);
                if (i > 0)
                {
                    return(Json(new { Success = true, Message = "修改成功" }));
                }
                else
                {
                    return(Json(new { Success = false, Message = "修改失败" }));
                }
            }
            catch
            {
                return(Json(new { Success = false, Message = "修改失败" }));
            }
        }