Ejemplo n.º 1
0
        public JsonResult getProject(int page, int rows, string ProjectTitle = "")
        {
            var list   = new JiaJiBLL.ProjectBLL().ShowProject();
            var result = new { total = list.Count, rows = list.Where(e => e.ProjectTitle.Contains(ProjectTitle)).Skip((page - 1) * rows).Take(rows) };

            return(Json(result));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除移民项目
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int deleteProject(string ids)
        {
            bool isOK = new JiaJiBLL.ProjectBLL().DelProject(ids);

            if (isOK)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Ejemplo n.º 3
0
 public ActionResult addProject(JiaJiModels.ProjectModel model)
 {
     try
     {
         model.Image = "/image/" + model.Image;
         var i = new JiaJiBLL.ProjectBLL().AddPro(model);
         if (i > 0)
         {
             return(Json(new { Success = true, Message = "添加成功" }));
         }
         else
         {
             return(Json(new { Success = false, Message = "添加失败" }));
         }
     }
     catch
     {
         return(Json(new { Success = false, Message = "添加失败" }));
     }
 }
Ejemplo n.º 4
0
        public JsonResult editProject(JiaJiModels.ProjectModel model)
        {
            try
            {
                int id = model.ProjectID;

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