tijian_tieying/web/dccdc/Controllers/jingfeiController.cs

262 lines
9.1 KiB
C#
Raw Permalink Normal View History

2025-02-20 12:14:39 +08:00
using dccdc.BLL;
using dccdc.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using static dccdc.Controllers.DictionariesController;
namespace dccdc.Controllers
{
public class jingfeiController : Controller
{
// GET: jingfei
public ActionResult Index()
{
return View();
}
#region
public ActionResult jflbView()
{
return View();
}
public ActionResult jflbMessage(string id)
{
var list = new List<Droplist>() { new Droplist { Value = "1", Title = "正常" }, new Droplist { Value = "2", Title = "禁用" } };
ViewData["ztlist"] = new SelectList(list, "value", "title");
if (!string.IsNullOrEmpty(id))
{
var bll = new BLL.jingfeilbBll();
var model = bll.GetAllList(id).First();
return View(model);
}
else
{
return View();
}
}
public JsonResult getjflbPage(int page, int pagesize, string key)
{
var bll = new BLL.jingfeilbBll();
int count = bll.getCount(key);
var models = bll.getPage(page, pagesize, key);
return Json(new { Total = count, Rows = models });
}
public JsonResult savejflb(jingfeilbModel model)
{
var user = Session["loginUser"] as Models.ERPUser;
model.tjr = user.TrueName;
model.tjsj = DateTime.Now;
var bll = new BLL.jingfeilbBll();
return Json(bll.save(model));
}
#endregion
#region
public ActionResult xmjfView()
{
ViewData["jflblist"] = new SelectList(new BLL.jingfeilbBll().GetAllList("", ""), "id", "jflbmc");
return View();
}
public ActionResult xmjfMessage(string id)
{
var list = new List<Droplist>() { new Droplist { Value = "1", Title = "正常" }, new Droplist { Value = "2", Title = "禁用" } };
ViewData["ztlist"] = new SelectList(list, "value", "title");
ViewData["jflblist"] = new SelectList(new BLL.jingfeilbBll().GetAllList("", "1"), "id", "jflbmc");
if (!string.IsNullOrEmpty(id))
{
var bll = new BLL.xmjingfeiBll();
var model = bll.GetAllList(id).First();
return View(model);
}
else
{
return View();
}
}
public JsonResult getxmjfPage(int page, int pagesize, string key)
{
var bll = new BLL.xmjingfeiBll();
int count = bll.getCount(key);
var models = bll.getPage(page, pagesize, key);
return Json(new { Total = count, Rows = models });
}
public JsonResult savexmjf(xmjingfeiModel model)
{
var user = Session["loginUser"] as Models.ERPUser;
model.tjr = user.TrueName;
model.tjsj = DateTime.Now;
var bll = new BLL.xmjingfeiBll();
return Json(bll.save(model));
}
#endregion
#region
public ActionResult xmjfsrView()
{
ViewData["xmjflist"] = new SelectList(new BLL.xmjingfeiBll().GetAllList("", ""), "id", "xmmc");
return View();
}
public ActionResult xmjfsrMessage(string id)
{
var list = new List<Droplist>() { new Droplist { Value = "1", Title = "正常" }, new Droplist { Value = "2", Title = "禁用" } };
ViewData["ztlist"] = new SelectList(list, "value", "title");
ViewData["xmjflist"] = new SelectList(new BLL.xmjingfeiBll().GetAllList("", "1"), "id", "xmmc");
if (!string.IsNullOrEmpty(id))
{
var bll = new BLL.xmjfsrBll();
var model = bll.GetAllList(id).First();
return View(model);
}
else
{
return View();
}
}
public ActionResult xmjfsrMessageNew(string id)
{
var list = new List<Droplist>() { new Droplist { Value = "1", Title = "正常" }, new Droplist { Value = "2", Title = "禁用" } };
ViewData["ztlist"] = new SelectList(list, "value", "title");
ViewData["xmjflist"] = new SelectList(new BLL.xmjingfeiBll().GetAllList("", "1"), "id", "xmmc");
//附件个数
ViewBag.filecount = "0";
if (!string.IsNullOrEmpty(id))
{
ViewBag.filecount = new BLL.sqfileBll().GetListByKey("经费收入", id, "").Count.ToString();
var bll = new BLL.xmjfsrBll();
var model = bll.GetAllList(id).First();
//ligerui时间控件bug 不续与format一致的字符串前台才能显示
model.dzsj2 = model.dzsj.ToString("yyyy-MM-dd");
return View(model);
}
else
{
xmjfsrModel model = new xmjfsrModel();
return View(model);
}
}
public JsonResult getxmjfsrPage(int page, int pagesize, string key)
{
var bll = new BLL.xmjfsrBll();
int count = bll.getCount(key);
var models = bll.getPage(page, pagesize, key);
return Json(new { Total = count, Rows = models });
}
public JsonResult savexmjfsr(xmjfsrModel model)
{
var user = Session["loginUser"] as Models.ERPUser;
model.tjr = user.TrueName;
model.tjsj = DateTime.Now;
var bll = new BLL.xmjfsrBll();
return Json(bll.save(model, user.ID));
}
#endregion
#region
/// <summary>
/// 加班申请表单页面
/// </summary>
/// <returns></returns>
public ActionResult JiaBanYongCanShenQing()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
ViewBag.jbbz = new BLL.Common().getParm_Value("jbsqbxjz", "30", "加班报销标准");
return View();
}
/// <summary>
/// 项目经费使用申请
/// </summary>
/// <returns></returns>
public ActionResult XingMuJingFeiShenQing()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
//ViewBag.jbbz = new BLL.Common().getParm_Value("jbsqbxjz", "30", "加班报销标准");
return View();
}
/// <summary>
/// 三重一大申请
/// </summary>
/// <returns></returns>
public ActionResult sanzhongyida()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
//ViewBag.jbbz = new BLL.Common().getParm_Value("jbsqbxjz", "30", "加班报销标准");
return View();
}
/// <summary>
/// 维修
/// </summary>
/// <returns></returns>
public ActionResult weixiu()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
//ViewBag.jbbz = new BLL.Common().getParm_Value("jbsqbxjz", "30", "加班报销标准");
return View();
}
/// <summary>
/// 公务接待
/// </summary>
/// <returns></returns>
public ActionResult gongwujiedai()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
//ViewBag.jbbz = new BLL.Common().getParm_Value("jbsqbxjz", "30", "加班报销标准");
return View();
}
/// <summary>
/// 出差
/// </summary>
/// <returns></returns>
public ActionResult chuchai()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
//ViewBag.jbbz = new BLL.Common().getParm_Value("jbsqbxjz", "30", "加班报销标准");
return View();
}
/// <summary>
/// 其他采购支出申请
/// </summary>
/// <returns></returns>
public ActionResult QiTaCaiGouZhiChu()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
return View();
}
/// <summary>
/// 物资采购申请
/// </summary>
/// <returns></returns>
public ActionResult wuzicaigou()
{
var user = Session["loginUser"] as Models.ERPUser;
ViewBag.sqr = user.TrueName;
ViewBag.sqks = user.Department;
return View();
}
#endregion
}
}