using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;
using System.Text;
using System.IO;
using System.Drawing.Imaging;
using System.Reflection;
using Autofac;
using Bowin.Common.Utility;
using Bowin.Common.Data;
using Bowin.Common.Linq.Entity;
using Bowin.Common.JSON;
using Bowin.Web.Controls.Mvc;
using EMIS.Web.Controls;
using EMIS.Utility;
using EMIS.Entities;
using EMIS.ViewModel;
using EMIS.ViewModel.EducationManagement;
using EMIS.ViewModel.SystemView;
using EMIS.CommonLogic.UniversityManage.SpecialtyClassManage;
using EMIS.CommonLogic.EducationManagement;
using EMIS.CommonLogic.SystemServices;
namespace EMIS.Web.Controllers
{
[Authorization]
public class CommonController : Controller
{
public IConfiguretermsInfoServices ConfiguretermsInfoServices { get; set; }
public IBatchModifyServices BatchModifyServices { get; set; }
public IMailVerifyServices MailVerifyServices { get; set; }
public IUserServices UserServices { get; set; }
public IWorkflowServices WorkflowServices { get; set; }
public IContextMenuServices ContextMenuServices { get; set; }
public IClassmajorServices ClassmajorServices { get; set; }
public IControlItemServices ControlItemServices { get; set; }
public EducationMissionClassView educationMissionClassView { get; set; }
public IEducationMissionClassServices EducationMissionClassServices { get; set; }
///
///
///
///
///
///
[HttpPost]
public ActionResult DictionaryDropDown(DropdownListBindType? bindType, string dictionaryCode)
{
List list = DictionaryHelper.GetDictionaryValue(dictionaryCode).Where(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE)
.Select(x => new DropdownListItem { Text = x.Name, Value = x.Value.ToString() }).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, list);
return base.Json(list);
}
///
///
///
///
///
[HttpPost]
public ActionResult SchoolYearDropDown(DropdownListBindType? bindType)
{
List list = DictionaryHelper.GetDictionaryValue(typeof(EMIS.ViewModel.CF_Year).Name)
.Select(x => new DropdownListItem { Text = x.Name, Value = x.Value.ToString() })
.OrderByDescending(x => x.Value).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, list);
return base.Json(list);
}
///
///
///
///
///
///
///
[HttpPost]
public ActionResult DynamicConditionDropDown(DropdownListBindType? bindType, string menuNo, string formClass)
{
if (menuNo == "")
{
menuNo = null;
}
var listAttribute = ConfiguretermsInfoServices.GetConfiguretermsInfo(menuNo, formClass);
List listdl = new List();
foreach (var item in listAttribute)
{
if (item.ControlType == "DictionaryDropDownList")
{
item.PostUrl = Url.Action("DictionaryDropDown") + "?dictionaryCode=" + item.DictionaryCode + "&bindType=" + (int)DropdownListBindType.SelectAll;
item.ControlTextFiled = "Text";
item.ControlValueFiled = "Value";
}
else if (!string.IsNullOrEmpty(item.PostUrl))
{
var temp = item.PostUrl.Split('?');
if (temp.Length > 1)
{
item.PostUrl = item.PostUrl + "&bindType=" + (int)DropdownListBindType.SelectAll;
}
else
{
item.PostUrl = item.PostUrl + "?bindType=" + (int)DropdownListBindType.SelectAll;
}
item.PostUrl = Url.Content(item.PostUrl);
}
DropdownListItem ddl = new DropdownListItem { Text = item.Name, Value = item.ToJson() };
listdl.Add(ddl);
}
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, listdl);
return base.Json(listdl);
}
///
///
///
///
///
///
[HttpPost]
public JsonResult GetPositionConditionData(string menuClass, string mnu)
{
if (mnu == "")
{
mnu = null;
}
var configuretermsInfos = ConfiguretermsInfoServices.GetConfiguretermsInfo(mnu, menuClass);
if (configuretermsInfos != null && configuretermsInfos.Count() > 0)
{
var result = new
{
Url = Url.Action("DynamicConditionDropDown") + "?menuNo=" + mnu + "&formClass=" + menuClass + "&bindType=" + (int)DropdownListBindType.None,
TextField = "Text",
ValueField = "Value",
Condition = configuretermsInfos[0].listControl
};
return Json(result, JsonRequestBehavior.AllowGet);
}
else
{
var result = new
{
Url = Url.Action("DynamicConditionDropDown") + "?menuNo=" + mnu + "&formClass=" + menuClass + "&bindType=" + (int)DropdownListBindType.None,
TextField = "Text",
ValueField = "Value"
};
return Json(result, JsonRequestBehavior.AllowGet);
}
}
///
///
///
///
///
///
///
///
///
///
[HttpPost]
public ActionResult GetPositionConditionComboGrid(string controlName, string dataCondition, string textField, string valueFiled,
string url, string configuretermsExpandJson)
{
var configuretermsExpandList = configuretermsExpandJson.JsonToObject>();
List columList = new List();
foreach (var configuretermsExpand in configuretermsExpandList)
{
BoundFieldColumn bfc = new BoundFieldColumn { FieldName = configuretermsExpand.ColumnValue, HeaderText = configuretermsExpand.ColumnName, Width = 0.1, Align = AlignStyle.Center };
columList.Add(bfc);
}
ComboGridOptions comboGridOptions = new ComboGridOptions
{
TextField = textField,
ValueField = valueFiled,
ID = controlName,
Name = controlName,
EmptyText = "全部",
GridOptions = new DataGridOptions
{
Columns = columList,
IsCheckOnSelect = true,
DataSourceUrl = Url.Content(url),
IsPagination = true,
IsShowRowNumbers = true,
IsSingleSelect = false
}
};
IDictionary htmlAttributes = new Dictionary() { { "data-condition", dataCondition } };
return Json(MvcHtmlString.Create(Bowin.Web.Controls.Mvc.ComboGrid.CreateControl(comboGridOptions, htmlAttributes).Render()).ToHtmlString());
}
///
///
///
///
///
///
[HttpPost]
public ActionResult BatchUpdateDropDown(DropdownListBindType? bindType, string menuNo)
{
List listdl = new List();
string columnName = string.Empty;
var listAttribute = BatchModifyServices.GetBatchModifyList(menuNo);
foreach (var item in listAttribute)
{
DropdownListItem ddl = new DropdownListItem { Text = item.Name, Value = item.ToJson() };
listdl.Add(ddl);
}
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, listdl);
return base.Json(listdl);
}
///
///
///
///
///
///
///
public ActionResult MsgShow(string msg, string url, string windowId = "")
{
ViewBag.msg = msg;
ViewBag.url = url;
ViewBag.WindowID = string.IsNullOrEmpty(windowId) ? Request["WindowID"] : windowId;
return View();
}
///
///
///
///
///
public ActionResult Messager(string msg)
{
ViewBag.msg = msg;
return View();
}
///
/// 弹出提示并关闭上级弹窗
///
///
///
///
public ActionResult MsgShowAndClose(string msg, string WindowID)
{
ViewBag.msg = msg;
ViewBag.WindowID = string.IsNullOrEmpty(WindowID) ? Request["WindowID"] : WindowID;
return View();
}
///
/// 弹出提示并打开原先弹窗
///
///
///
///
public ActionResult MsgShowAndOpen(string msg, string WindowID)
{
ViewBag.msg = msg;
ViewBag.WindowID = string.IsNullOrEmpty(WindowID) ? Request["WindowID"] : WindowID;
return View();
}
///
/// 弹出提示并打开原先弹窗
///
///
///
///
///
public ActionResult MsgShowAndOpenAddUrl(string msg, string url, string WindowID)
{
ViewBag.msg = msg;
ViewBag.WindowID = string.IsNullOrEmpty(WindowID) ? Request["WindowID"] : WindowID;
ViewBag.url = url;
return View();
}
///
/// 批量修改
///
///
[HttpPost]
public ActionResult BatchModify()
{
string batchModifyName = Request["DropdownBatchModify"];
var BatchModify = batchModifyName.JsonToObject();
string batchModifyValue = string.Empty;
string hidBatchModify = Request["PL_hiddenBatchModify"];
try
{
if (BatchModify.ControlType == "TextBox")
batchModifyValue = Request[BatchModify.Value + "_TextBox"];
else if (BatchModify.ControlType == "DropdownList")
batchModifyValue = Request[BatchModify.Value + "_DropdownList"];
else if (BatchModify.ControlType == "DictionaryDropDownList")
batchModifyValue = Request[BatchModify.Value + "_DictionaryDropDownList"];
else if (BatchModify.ControlType == "CheckBox")
batchModifyValue = Request[BatchModify.Value + "_CheckBox"].Split(',').Length > 1 ? Request[BatchModify.Value + "_CheckBox"].Split(',')[0] : Request[BatchModify.Value + "_CheckBox"];
else if (BatchModify.ControlType == "ComboGrid")
batchModifyValue = Request[BatchModify.Value + "_ComboGrid"];
else if (BatchModify.ControlType == "TextBoxDate")
batchModifyValue = Request[BatchModify.Value + "_TextBoxDate"];
else if (BatchModify.ControlType == "TextBoxDateTime")
batchModifyValue = Request[BatchModify.Value + "_TextBoxDateTime"];
else if (BatchModify.ControlType == "NumberBox")
batchModifyValue = Request[BatchModify.Value + "_NumberBox"];
if (BatchModify.ControlType != "TextBox")
{
if (batchModifyValue == "")
{
batchModifyValue = null;
}
else if (BatchModify.ControlType == "DropdownList" || BatchModify.ControlType == "DictionaryDropDownList")
{
if (batchModifyValue == DropdownList.PLEASE_SELECT.ToString())
{
batchModifyValue = null;
}
}
}
//获取修改的ID 转换成数组
List listID = new List();
for (int i = 0; i < hidBatchModify.Split(',').Length; i++)
{
string batchmodify = hidBatchModify.Split(',')[i];
if (!string.IsNullOrEmpty(batchmodify))
{
listID.Add(new Guid(batchmodify));
}
}
//List funcationstringlist = BatchModifyServices.GetBatchModifyEvents(BatchModify.MNUID, BatchModify.MUNClass, BatchModify.Value);
BatchModifyServices.BatchUpdate(BatchModify.MNUID, BatchModify.MUNClass, BatchModify.Value, (object)batchModifyValue, listID);
return Json(new ReturnMessage { IsSuccess = true, Message = "批量修改成功。" });
//return RedirectToAction("MsgShow", "Common", new
//{
// WindowID = "none",
// msg = "批量修改成功。",
// url = Url.Content(BatchModify.ReturnUrl).AddMenuParameter()
//});
}
catch (Exception ex)
{
return Json(new ReturnMessage { IsSuccess = false, Message = "批量修改失败,原因:" + ex.Message });
//return RedirectToAction("MsgShow", "Common", new
//{
// WindowID = "none",
// msg = "批量修改失败,原因:" + ex.Message,
// url = Url.Content(BatchModify.ReturnUrl).AddMenuParameter()
//});
}
}
public ActionResult UserRole(Guid userID)
{
return View();
}
public ActionResult RoleSelector()
{
return View();
}
public ActionResult CollegeSelector()
{
return View();
}
public ActionResult DepartmentSelector()
{
return View();
}
public ActionResult Uploader(string n, Guid? v, int? t, int? m)
{
string sessionCookieName = Const.LOCAL_SETTING_LOGIN_COOKIENAME;
if (Request.Cookies[sessionCookieName] != null)
ViewBag.hfcookieName = Request.Cookies[sessionCookieName].Value;
if (v.HasValue)
{
ViewBag.name = n;
ViewBag.value = v;
ViewBag.type = t;
ViewBag.maxSize = m;
}
return View();
}
public ActionResult UploaderInit(Guid? id, string n)
{
Response.Cache.SetNoStore();
List result = new List();
string sessionName = FileUploadHelper.GetFileUploadSessionName(id.Value);
if (Session[sessionName] == null)
{
Session[sessionName] = new List();
}
using (var scope = AutofacHelper.RequestLifetimeScope.BeginLifetimeScope())
{
IFileUploadServices uploadService = scope.ResolveNamed(n);
result = uploadService.GetFileList(id);
Session[sessionName] = result;
}
return Json(result, JsonRequestBehavior.AllowGet);
}
public ActionResult UploaderSave(FormCollection form)
{
Response.Cache.SetNoStore();
try
{
FileUploadView upfile = new FileUploadView();
var files = Request.Files;
var formID = (!string.IsNullOrEmpty(Request["v"])) ? new Guid(Request["v"]) : (Guid?)null;
string sessionName = FileUploadHelper.GetFileUploadSessionName(formID.Value);
//检查文件扩展名字
var postedFile = files["Filedata"]; //得到要上传文件
if (postedFile.FileName == null)
{
return Json(new FileUploadView(), JsonRequestBehavior.AllowGet);
}
var accepts = new List { ".rar", ".doc", ".docx", ".xls", ".xlsx", ".zip", ".pdf", ".txt", ".swf", ".wmv", ".jpg", ".jpeg", ".png", ".bmp" };
if (!string.IsNullOrEmpty(postedFile.FileName) && !accepts.Contains(Path.GetExtension(postedFile.FileName).ToLower()))
{
throw new Exception("不允许的文件类型。");
}
upfile.FileID = Function.NewPKGuid();
string fileUrl = FileUploadHelper.UploadFile(postedFile);
upfile.FileUrl = fileUrl;
upfile.FileName = postedFile.FileName;
upfile.FormID = formID;
if (Session[sessionName] == null)
{
Session[sessionName] = new List();
}
((List)Session[sessionName]).Add(upfile);
return Json(upfile, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
//throw ex;
return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
}
//return Json(new FileUploadView(), JsonRequestBehavior.AllowGet);
}
public ActionResult UploaderDel(Guid? id, Guid? fileid)
{
string result = "";
if (id.HasValue)
{
List fileList = new List();
string sessionName = FileUploadHelper.GetFileUploadSessionName(id.Value);
if (Session[sessionName] == null)
{
Session[sessionName] = new List();
}
fileList = (List)Session[sessionName];
var file = fileList.Where(x => x.FileID == fileid).FirstOrDefault();
if (file != null)
{
fileList.Remove(file);
FileUploadHelper.DeleteFile(file.FileUrl);
}
else
{
result = "删除文件失败!";
}
}
else
{
result = "文件ID为空,删除文件失败!";
}
return Content(result);
}
///
///
///
///
///
///
public ActionResult UserVerify(Guid UserID, string Code)
{
if (MailVerifyServices.Verify(UserID, Code))
{
return View();
}
else
{
return RedirectToAction("MsgShow", "Common", new
{
msg = "邮件连接已失效或不正确,请重新申请。",
url = Url.Content("~/Account/Login")
});
}
}
///
///
///
///
///
[HttpPost]
public ActionResult UserVerify(ChangePasswordView changeView)
{
var userID = new Guid(Request["UserID"]);
UserServices.ChangePassword(changeView, userID);
return RedirectToAction("MsgShow", "Common", new
{
msg = "密码已经修改,请重新登录验证修改结果。",
url = Url.Content("~/Account/Login")
});
}
///
/// 添加教师
///
///
public ActionResult TeacherSelect()
{
return View();
}
///
/// 添加专业
///
///
public ActionResult SpecialtySelect()
{
return View();
}
///
/// 添加班级
///
///
public ActionResult ClassmajorSelect()
{
ViewBag.GrademajorID = Request.Params["GrademajorID"];
return View();
}
///
/// 添加班级
///
///
public ActionResult ClassmajorViewSelect()
{
ViewBag.CollegeID = Request.Params["CollegeID"];
ViewBag.GradeYearID = Request.Params["GradeYearID"];
ViewBag.StandardID = Request.Params["StandardID"];
return View();
}
///
/// 添加学生(学生发放专用)
///
///
public ActionResult StudentSelect()
{
ViewBag.studentDistributeID = Request.Params["studentDistributeID"];
ViewBag.GrademajorID = Request.Params["GrademajorID"];
return View();
}
///
///
///
///
///
///
public ActionResult StudentViewSelect(Guid? classmajorID, Guid? educationMissionClassID)
{
educationMissionClassID = Request["educationMissionClassID"].ParseStrTo();
if (classmajorID.HasValue)
{
var classmajor = ClassmajorServices.GetClassmajorView(classmajorID);
ViewBag.ClassmajorID = classmajor.ClassmajorID;
ViewBag.GrademajorID = classmajor.GrademajorID;
ViewBag.CollegeID = classmajor.CollegeID;
}
else if (educationMissionClassID.HasValue)
{
var classmajor = EducationMissionClassServices.GetClassmajorByEducationClassID(educationMissionClassID);
ViewBag.InSchool = 1;
ViewBag.ClassmajorID = classmajor.ClassmajorID;
ViewBag.GrademajorID = classmajor.GrademajorID;
ViewBag.CollegeID = classmajor.CollegeID;
}
else
{
ViewBag.ClassmajorID = "-1";
ViewBag.GrademajorID = "-1";
ViewBag.CollegeID = "-1";
}
return View();
}
///
///
///
///
public ActionResult ClassroomSelect()
{
return View();
}
///
///
///
///
public ActionResult CoursematerialSelect()
{
return View();
}
///
///
///
///
public ActionResult StudentBatchSelect()
{
return View();
}
///
///
///
///
///
///
[HttpPost]
public JsonResult GetContextMenuList(string formClass, string mnu)
{
var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
//以后好好想想怎么控制按钮
//var controlContextMenuList = ControlItemServices.GetNeedControlContextMenuNo().Where(x => x.MenuNo == mnu).ToList();
var contextMenuList = ContextMenuServices.GetContextMenuListByUserAndRoleID((mnu == "" ? null : mnu), formClass, user.UserID, user.RoleID);
var result = contextMenuList.OrderBy(x => x.SeqNo).Select(x => new
{
Name = x.ContextMnuNo,
Text = x.Title,
Icon = x.IconName,
OnClick = x.Scripts
})
.ToList();
return Json(result, JsonRequestBehavior.AllowGet);
}
///
/// 审核历史页面
///
///
public ActionResult ApproveStatus()
{
return View();
}
///
/// 审核历史页面
///
///
///
[HttpPost]
public ActionResult ApproveStatus(QueryParamsModel pararms)
{
string tableName = pararms.getExtraString("tableName");
Guid formID = pararms.getExtraGuid("formID").Value;
var approveHistoryList = WorkflowServices.GetApproveHistoryViewList(tableName, formID)
.OrderBy(x => x.ApproveTime).ToList();
return Json(new GridResultSet { rows = approveHistoryList.ToList(), total = approveHistoryList.Count });
}
///
/// 获取工作流程环节所有状态(根据对应的bindType、tableName)
///
///
///
///
[HttpPost]
public ActionResult ApproveStatusDropDown(DropdownListBindType? bindType, string tableName)
{
var statusList = WorkflowServices.GetStatusViewList(tableName).OrderBy(x => x.ID)
.Select(x => new DropdownListItem()
{
Text = x.Name,
Value = x.ID.HasValue ? x.ID.Value.ToString() : ""
}).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, statusList);
return base.Json(statusList);
}
///
/// 查询对应的工作流程表中审核流程环节状态(WorkflowStatusView,不包含开始、结束、非正常[BP]结束环节)
///
///
///
///
[HttpPost]
public ActionResult ApproveStatusNotStartEndDropDown(DropdownListBindType? bindType, string tableName)
{
var statusList = WorkflowServices.GetApproveStatusViewList(tableName).OrderBy(x => x.ID)
.Select(x => new DropdownListItem()
{
Text = x.Name,
Value = x.ID.HasValue ? x.ID.Value.ToString() : ""
}).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, statusList);
return base.Json(statusList);
}
///
/// 查询对应的工作流程表中全部非开始流程环节状态(WorkflowStatusView,不包含开始环节)
///
///
///
///
[HttpPost]
public ActionResult ApproveStatusNotStartDropDown(DropdownListBindType? bindType, string tableName)
{
var statusList = WorkflowServices.GetNoStartStatusViewList(tableName).OrderBy(x => x.ID)
.Select(x => new DropdownListItem()
{
Text = x.Name,
Value = x.ID.HasValue ? x.ID.Value.ToString() : ""
}).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, statusList);
return base.Json(statusList);
}
///
/// 查询对应的工作流程表中全部非结束流程环节状态(WorkflowStatusView,不包含结束状态)
///
///
///
///
[HttpPost]
public ActionResult ApproveStatusNoEndDropDown(DropdownListBindType? bindType, string tableName)
{
//结束流程环节ID
var endStatusID = WorkflowServices.GetCorrectEndStatus(tableName);
var statusList = WorkflowServices.GetStatusViewList(tableName).Where(x => x.ID != endStatusID).OrderBy(x => x.ID)
.Select(x => new DropdownListItem()
{
Text = x.Name,
Value = x.ID.HasValue ? x.ID.Value.ToString() : ""
}).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, statusList);
return base.Json(statusList);
}
///
/// 查询对应的工作流程表中全部可提交流程环节状态(WorkflowStatusView,不包含审批、结束、非正常[BP]结束状态)
/// 如:未提交(开始环节)、已退回[BP]状态
///
///
///
///
[HttpPost]
public ActionResult ApproveStatusApplyDropDown(DropdownListBindType? bindType, string tableName)
{
//结束流程环节ID
var endStatusID = WorkflowServices.GetCorrectEndStatus(tableName);
//审核流程状态IDList
var approveStatusIDList = WorkflowServices.GetApproveStatusViewList(tableName).Select(x => x.ID).ToList();
var statusList = WorkflowServices.GetStatusViewList(tableName).Where(x => x.ID != endStatusID && !approveStatusIDList.Contains(x.ID)).OrderBy(x => x.ID)
.Select(x => new DropdownListItem()
{
Text = x.Name,
Value = x.ID.HasValue ? x.ID.Value.ToString() : ""
}).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, statusList);
return base.Json(statusList);
}
///
/// 查询对应的工作流程表中全部结束流程环节状态
///
///
///
///
[HttpPost]
public ActionResult ApproveStatusEndDropDown(DropdownListBindType? bindType, string tableName)
{
var statusList = WorkflowServices.GetEndStatusViewList(tableName).OrderBy(x => x.ID)
.Select(x => new DropdownListItem()
{
Text = x.Name,
Value = x.ID.HasValue ? x.ID.Value.ToString() : ""
}).ToList();
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, statusList);
return base.Json(statusList);
}
///
/// 审批页面
///
///
public ActionResult ApproveHandler()
{
return View();
}
///
/// 流程环节动作
///
///
///
///
///
[HttpPost]
public ActionResult ApproveActionDropDown(DropdownListBindType? bindType, string tableName, Guid formID)
{
var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
List actionList;
try
{
actionList = WorkflowServices.GetActionView(tableName, formID, user.UserID)
.Select(x => new DropdownListItem { Text = x.ActionName, Value = x.ActionID.ToString() }).ToList();
}
catch (Exception)
{
actionList = new List();
}
DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
DropdownList.FormatDropdownItemList(dbt, actionList);
return base.Json(actionList);
}
///
///
///
///
[AllowAnonymous]
public ActionResult ReportViewer()
{
return View();
}
///
///
///
///
///
[AllowAnonymous]
public ActionResult ResImage(string key)
{
var context = this.HttpContext;
var image = RSI.Get(key);
context.Response.Buffer = true;
context.Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
context.Response.Expires = 0;
context.Response.CacheControl = "no-cache";
context.Response.AppendHeader("Pragma", "No-Cache");
image.Save(context.Response.OutputStream, image.RawFormat);
Type imageFormatType = typeof(ImageFormat);
System.Reflection.PropertyInfo[] _ImageFormatList = imageFormatType.GetProperties(BindingFlags.Static | BindingFlags.Public);
for (int i = 0; i != _ImageFormatList.Length; i++)
{
ImageFormat _FormatClass = (ImageFormat)_ImageFormatList[i].GetValue(null, null);
if (_FormatClass.Guid.Equals(image.RawFormat.Guid))
{
context.Response.ContentType = "image/" + _ImageFormatList[i].Name.ToLower();
}
}
context.Response.End();
return new EmptyResult();
}
}
}