123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.SchedulingManage.ScheduleApproval;
- using EMIS.ViewModel;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.CalendarManage;
- namespace EMIS.Web.Controllers.SchedulingManage.ScheduleApproval
- {
- [Authorization]
- public class CollegeScheduleApprovalController : Controller
- {
- public ICollegeScheduleApprovalServices collegeScheduleApprovalServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- //
- // GET: /CollegeScheduleApproval/
- public ActionResult List()
- {
- var schoolYearView = SchoolYearServices.GetSchoolYearIsCurrent(true);
- var schoolyear = SchoolYearServices.GetSchoolYearViewListAfterCurrent().OrderBy(x => x.Code).Where(x => x.Value > schoolYearView.Value).FirstOrDefault();
- ViewBag.SchoolYearID = schoolyear.SchoolYearID;
- ViewBag.StartStatus = collegeScheduleApprovalServices.GetStartStatus();
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- //ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var SchoolyearID = pararms.getExtraGuid("SchoolyearDropdownList");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var approvalStatus = pararms.getExtraInt("DictionaryApprovalStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryApprovalStatus");
- return base.Json(collegeScheduleApprovalServices.GetCollegeScheduleApprovalViewGrid(SchoolyearID, collegeID, approvalStatus, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult Submit(string collegeScheduleStatusIDs, string collegeIDs, Guid schoolYearID)
- {
- try
- {
- List<Guid?> list = new List<Guid?>();
- for (int i = 0; i < collegeScheduleStatusIDs.Split(',').Length; i++)
- {
- string id = collegeScheduleStatusIDs.Split(',')[i];
- if (!string.IsNullOrEmpty(id))
- {
- list.Add(new Guid(id));
- }
- }
- List<Guid?> collegelist = new List<Guid?>();
- for (int i = 0; i < collegeIDs.Split(',').Length; i++)
- {
- string id = collegeIDs.Split(',')[i];
- if (!string.IsNullOrEmpty(id))
- {
- collegelist.Add(new Guid(id));
- }
- }
- collegeScheduleApprovalServices.Submit(list, collegelist, schoolYearID);
- return base.Json("提交成功");
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- return base.Json("提交失败,原因:" + mge);
- }
- }
- [HttpPost]
- public ActionResult Approve(string collegeScheduleStatusIDs)
- {
- try
- {
- List<Guid> list = new List<Guid>();
- for (int i = 0; i < collegeScheduleStatusIDs.Split(',').Length; i++)
- {
- string id = collegeScheduleStatusIDs.Split(',')[i];
- if (!string.IsNullOrEmpty(id))
- {
- list.Add(new Guid(id));
- }
- }
- collegeScheduleApprovalServices.Approve(list);
- return base.Json("审核成功");
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- return base.Json("审核失败,原因:" + mge);
- }
- }
- [HttpPost]
- public ActionResult ReturnBack(string collegeScheduleStatusIDs)
- {
- try
- {
- List<Guid> list = new List<Guid>();
- for (int i = 0; i < collegeScheduleStatusIDs.Split(',').Length; i++)
- {
- string id = collegeScheduleStatusIDs.Split(',')[i];
- if (!string.IsNullOrEmpty(id))
- {
- list.Add(new Guid(id));
- }
- }
- collegeScheduleApprovalServices.ReturnBack(list);
- return base.Json("撤回成功");
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- return base.Json("撤回失败,原因:" + mge);
- }
- }
- //
- // GET: /CollegeScheduleApproval/Details/5
- public ActionResult Details(int id)
- {
- return View();
- }
- //
- // GET: /CollegeScheduleApproval/Create
- public ActionResult Create()
- {
- return View();
- }
- //
- // POST: /CollegeScheduleApproval/Create
- [HttpPost]
- public ActionResult Create(FormCollection collection)
- {
- try
- {
- // TODO: Add insert logic here
- return RedirectToAction("Index");
- }
- catch
- {
- return View();
- }
- }
- //
- // GET: /CollegeScheduleApproval/Edit/5
- public ActionResult Edit(int id)
- {
- return View();
- }
- //
- // POST: /CollegeScheduleApproval/Edit/5
- [HttpPost]
- public ActionResult Edit(int id, FormCollection collection)
- {
- try
- {
- // TODO: Add update logic here
- return RedirectToAction("Index");
- }
- catch
- {
- return View();
- }
- }
- //
- // GET: /CollegeScheduleApproval/Delete/5
- public ActionResult Delete(int id)
- {
- return View();
- }
- //
- // POST: /CollegeScheduleApproval/Delete/5
- [HttpPost]
- public ActionResult Delete(int id, FormCollection collection)
- {
- try
- {
- // TODO: Add delete logic here
- return RedirectToAction("Index");
- }
- catch
- {
- return View();
- }
- }
- [HttpPost]
- public ActionResult GetStatusList(DropdownListBindType? bindType)
- {
- List<DropdownListItem> list = this.collegeScheduleApprovalServices.GetStatusViewList()
- .Select(x => new DropdownListItem { Text = x.Name, Value = x.ID }).ToList();
- DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
- DropdownList.FormatDropdownItemList(dbt, list);
- return base.Json(list);
- }
- }
- }
|