一、点击
$(“.selectzmzc”).css({ “cursor”: “pointer” });
$(document).on(“click”, “.selectzmzc”, function () {
$(this).blur();
var company = $(“#CompanyCode”).val();
var text = $(this).attr(“id”);
if (company == “” || company == null) {
alert(“请先输入在职人员得立讯工号”);
$(“#Recruitcode”).val(“”);
return null;
}
else {
layer.open({
type: 2,
title: “选取招募政策”,
area: [“550px”, “550px”],
content: “/OpDailyCostCalc/OpDcostinterecommpolicemainset/Selectpolicy?company=” + company + “&text=” + (text || “”)
});
}
return false;
});
二、后台
[AllowAnonymous]
public ActionResult Selectpolicy(string company,string text)
{
ViewBag.Company = company;
ViewBag.Text = text;
return View();
}
三、页面
@{
ViewBag.Title = “选取政策信息”;
string company = ViewBag.Company;
string text = ViewBag.Text;
var info = Enumerable.Empty<dynamic>();
if (text == "Interecommcodeself" || text == "Interecommcodecomm")
{
info = (from t in new Op_DcostinterecommpolicemainsetSet().AsQueryable()
where !t.IsDisabled && t.Companycode == company
select new { t.Interecommcode, t.Interecommname });
}
if (text == "Recruitcode")
{
info = (from t in new Op_DcostrecruitpolicemainsetSet().AsQueryable()
where !t.IsDisabled && t.Companycode == company
select new { t.Recruitcode, t.Recruitname });
}
}
政策编号 | 政策名称 |
---|---|
@if (text == "Interecommcodeself" || text == "Interecommcodecomm") { @item.Interecommcode } else if (text == "Recruitcode") { @item.Recruitcode } | @if (text == "Interecommcodeself" || text == "Interecommcodecomm") { @item.Interecommname } else if (text == "Recruitcode") { @item.Recruitname } |