• MVC


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;

    namespace LC.UI.Controllers
    {
    using BLL;
    using Entity;
    using Newtonsoft.Json;
    public class UsersController : Controller
    {
    VIPUsersBLL bll = new VIPUsersBLL();
    // GET: Users
    public ActionResult Index()
    {
    return View();
    }
    public ActionResult Add()
    {
    return View();
    }
    [HttpPost]
    public int Add(VIPUsers t)
    {
    var result = bll.Add(t);
    return result;
    }
    [HttpPost]
    public int Delete(int Id)
    {
    var result = bll.Delete(Id);
    return result;
    }
    [HttpPost]
    public string Query(DateTime? startDate,DateTime? endDate, int pageIndex=1,string Name="")
    {
    var list = bll.Query();
    if (!string.IsNullOrWhiteSpace(startDate.ToString()))
    list = list.Where(m => m.CreateDate >= startDate).ToList();
    if (!string.IsNullOrWhiteSpace(endDate.ToString()))
    list = list.Where(m => m.CreateDate <= endDate).ToList();
    if (!string.IsNullOrWhiteSpace(Name))
    list = list.Where(m => m.Name.Contains(Name)).ToList();
    PageBox page = new PageBox();
    page.PageIndex = pageIndex;
    page.PageCount = list.Count / 3 + (list.Count% 3>0?1:0);
    page.Data = list.Skip((pageIndex - 1) * 3).Take(3);
    return JsonConvert.SerializeObject(page);
    }
    [HttpPost]
    public string QueryById(int Id)
    {
    var result = bll.QueryById(Id);
    return JsonConvert.SerializeObject(result);
    }
    [HttpPost]
    public int Update(VIPUsers t)
    {
    var result = bll.Update(t);
    return result;
    }
    [HttpPost]
    public int Execl()
    {
    HttpPostedFileBase file = Request.Files[0];
    var result = Excel.ExcelAdd(file);
    return result;
    }
    }
    }

  • 相关阅读:
    Vault插件示例--Vault Explorer与Thin Client的集成。
    什么是REST?
    Android Tips: 打电话和发短信
    使用Autodesk Vault插件向导轻松创建Vault插件
    智者当借力而行, 借助Autodesk应用程序商店实现名利双收
    MapGuide Maestro 5.1发布了
    ArcGIS ElementLayer上放置Windows控件
    ArcGIS图层和要素的过滤显示
    ArcGIS中的三种查询
    ArcGIS图层介绍
  • 原文地址:https://www.cnblogs.com/mamingyuan/p/10002878.html
Copyright © 2020-2023  润新知