|
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using Learun.Util;
- using System;
- using System.Data;
- using System.IO;
- using System.Web.Mvc;
-
- namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
- /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- /// 创 建:超级管理员
- /// 日 期:2022-11-07 11:54
- /// 描 述:工资条
- /// </summary>
- public class WageScheduleController : MvcControllerBase
- {
- private WageScheduleIBLL wageScheduleIBLL = new WageScheduleBLL();
-
- #region 视图功能
-
- /// <summary>
- /// 主页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 主页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexPrint()
- {
- return View();
- }
- /// <summary>
- /// 我的工资条
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexMy()
- {
- return View();
- }
- /// <summary>
- /// 表单页
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- /// <summary>
- /// 导入页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ImportForm()
- {
- return View();
- }
-
- #endregion
-
- #region 获取数据
- /// <summary>
- /// 人员类别
- /// </summary>
- /// <returns></returns>
- public ActionResult PeopleType()
- {
- var data = wageScheduleIBLL.GetPeopleType();
- return Success(data);
- }
- /// <summary>
- /// 岗位类别
- /// </summary>
- /// <returns></returns>
- public ActionResult PostType()
- {
- var data = wageScheduleIBLL.GetPostType();
- return Success(data);
- }
- /// <summary>
- /// 薪级
- /// </summary>
- /// <returns></returns>
- public ActionResult PayGrade()
- {
- var data = wageScheduleIBLL.GetPayGrade();
- return Success(data);
- }
-
- /// <summary>
- /// 获取列表数据
- /// </summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetList(string queryJson)
- {
- var data = wageScheduleIBLL.GetList(queryJson);
- return Success(data);
- }
- /// <summary>
- /// 获取列表分页数据
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = wageScheduleIBLL.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
- /// <summary>
- /// 获取表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var WageScheduleData = wageScheduleIBLL.GetEntity(keyValue);
- var jsonData = new
- {
- WageSchedule = WageScheduleData,
- };
- return Success(jsonData);
- }
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- wageScheduleIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="entity">实体</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, WageScheduleEntity entity)
- {
- wageScheduleIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
- #endregion
-
- #region 扩展代码
- [HttpPost]
- [AjaxOnly]
- public ActionResult CheckForm(string keyValue,string Status)
- {
- wageScheduleIBLL.CheckEntity(keyValue, Status);
- return Success("审核成功!");
- }
-
- /// <summary>
- /// 下载文件
- /// </summary>
- /// <returns></returns>
- public ActionResult DownTemplate()
- {
- FileStreamResult result = null;
- try
- {
- var path = Server.MapPath("~/Content/excel/");
- var pathoffull = path + "SalarySheetImport.xls";
- FileStream fsread = fsread = new FileStream(pathoffull, FileMode.OpenOrCreate, FileAccess.ReadWrite);
- result = File(fsread, "application/ms-excel", "工资条导入.xls");
-
- return result;
- }
- catch (Exception ex)
- {
- return null;
- }
- }
- #endregion
- }
- }
|