Files
SGGL_SHJ/SGGL/FineUIPro.Web/Controls/QRCodePrint.aspx.cs
T
lpf dc19b6d6b6 refactor(cqms): 整理检查模块并迁移 WBS 服务
清理旧检查页面、服务和接口,补充 WBS 检查服务及数据库脚本,同步工程引用与菜单配置,收敛 CQMS 检查功能的代码组织。
2026-09-20 15:49:27 +08:00

104 lines
4.7 KiB
C#

using System;
using System.Linq;
namespace FineUIPro.Web.Controls
{
public partial class QRCodePrint : PageBase
{
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.getQRUrl();
}
}
private void getQRUrl()
{
if (!string.IsNullOrEmpty(Request.Params["PersonId"]))
{
////人员
var getp = BLL.Person_PersonsService.GetPerson_PersonsByProjectPersonId(Request.Params["PersonId"]);
if (getp != null && !string.IsNullOrEmpty(getp.QRCodeAttachUrl))
{
this.imgPhoto.Src = "../" + getp.QRCodeAttachUrl;
var siteperson = BLL.SitePerson_PersonService.GetSitePersonByProjectIdPersonId(this.CurrUser.LoginProjectId, getp.PersonId);
if (siteperson != null)
{
this.lbWedCode.Text = "人员卡号:" + siteperson.CardNo;
}
this.lbWedName.Text = "人员姓名:" + getp.PersonName;
Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(getp.UnitId);
string unitName = string.Empty;
if (unit != null)
{
unitName = unit.UnitName;
}
this.lbUnitName.Text = "人员单位:" + unitName;
}
}
else if (!string.IsNullOrEmpty(Request.Params["TrainingPlanId"]))
{
///培训计划
var trainingPlan = BLL.Funs.DB.Training_Plan.FirstOrDefault(x => x.PlanId == Request.Params["TrainingPlanId"]);
if (trainingPlan != null && !string.IsNullOrEmpty(trainingPlan.QRCodeUrl))
{
this.imgPhoto.Src = "../" + trainingPlan.QRCodeUrl;
string code = string.Empty;
if (!string.IsNullOrEmpty(trainingPlan.PlanCode))
{
code = trainingPlan.PlanCode;
}
else
{
code = BLL.CodeRecordsService.ReturnCodeByDataId(trainingPlan.PlanId);
}
this.lbWedCode.Text = "编号:" + code;
this.lbWedName.Text = "名称:" + trainingPlan.PlanName;
this.lbUnitName.Text = "培训时间:" + string.Format("{0:yyyy-MM-dd}", trainingPlan.TrainStartDate) + ";培训地点:" + trainingPlan.TeachAddress;
}
}
else if (!string.IsNullOrEmpty(Request.Params["TestPlanId"]))
{
///培训计划
var testPlan = BLL.Funs.DB.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == Request.Params["TestPlanId"]);
if (testPlan != null && !string.IsNullOrEmpty(testPlan.QRCodeUrl))
{
this.imgPhoto.Src = "../" + testPlan.QRCodeUrl;
string code = string.Empty;
if (!string.IsNullOrEmpty(testPlan.PlanCode))
{
code = testPlan.PlanCode;
}
else
{
code = BLL.CodeRecordsService.ReturnCodeByDataId(testPlan.PlanId);
}
this.lbWedCode.Text = "编号:" + code;
this.lbWedName.Text = "名称:" + testPlan.PlanName;
this.lbUnitName.Text = "考试扫码时间:" + string.Format("{0:yyyy-MM-dd}", testPlan.TestStartTime) + ";考试地点:" + testPlan.TestPalce;
}
}
else if (!string.IsNullOrEmpty(Request.Params["ServerTestPlanId"]))
{
///知识竞赛
var testPlan = BLL.ServerTestPlanService.GetTestPlanById(Request.Params["ServerTestPlanId"]);
if (testPlan != null && !string.IsNullOrEmpty(testPlan.QRCodeUrl))
{
this.imgPhoto.Src = "../" + testPlan.QRCodeUrl;
this.lbWedCode.Text = "编号:" + testPlan.PlanCode;
this.lbWedName.Text = "名称:" + testPlan.PlanName;
this.lbUnitName.Text = "扫码考试时间:" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", testPlan.TestStartTime) + ";至:" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", testPlan.TestEndTime);
}
}
}
}
}