using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EMIS.CommonLogic.CerificateManage;
using EMIS.ViewModel;
using EMIS.Web.Controls;
using Bowin.Web.Controls.Mvc;
using EMIS.Utility;
using EMIS.ViewModel.CerificateManage;
namespace EMIS.Web.ServiceControllers.CertisfierManage
{
public class CertisfierServicesController : Controller
{
public ICertisfierDistributeServices ICertisfierDistributeService { get; set; }
///
/// 证书列表查询
///
///
///
public ActionResult CertisfierListView(Guid userID, int? pageIndex, int? pageSize)
{
return base.Json(ICertisfierDistributeService.GetCertificateMobileViewGrid(pageIndex, pageSize, userID));
}
///
/// 领取方式列表
///
///
public ActionResult DictionaryDropDown()
{
List list = DictionaryHelper.GetDictionaryValue(EMIS.ViewModel.DictionaryItem.ER_CertisfierDistributeType)
.Where(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE)
.Select(x => new DropdownListItem { Text = x.Name, Value = x.Value.ToString() }).ToList();
return base.Json(list);
}
///
/// 修改领取方式
///
///
///
public ActionResult StuEdit(CertificateMobileView view)
{
try
{
CerificateView certificateView = new CerificateView();
certificateView.CertisfierDistributeID = view.CertisfierDistributeID;
certificateView.DistributeTypeID = view.DistributeTypeID;
certificateView.EntrustDistributer = view.ContactPerson;
certificateView.ContactPerson = view.ContactPerson;
certificateView.ContactNo = view.ContactNo;
certificateView.MailContactNo = view.ContactNo;
certificateView.ContactIDNo = view.ContactIDNo;
certificateView.Address = view.Address;
ICertisfierDistributeService.UpdateCertisfierDistributeType(certificateView);
return Json(new
{
isSuccess = true,
message = "保存成功。"
});
}
catch (Exception ex)
{
return Json(new
{
isSuccess = false,
message = "保存失败,原因:" + ex.Message
});
}
}
///
/// 获取字典
///
///
///
public ActionResult GetView(Guid ID)
{
var view = ICertisfierDistributeService.GetView(ID);
return Json(view);
}
}
}