public string Add() { var stuID = Request["StuID"]; var stuName = Request["StuName"]; var trainOffice = Request["TrainOffice"]; var iDCardNO = Request["IDCardNO"]; var trainPosition = Request["TrainPosition"]; var trainClassName = Request["TrainClassName"]; var trainStartDate = ConvertUtil.ConvertStringToNullableDateTime(Request["TrainStartDate"]); var trainEndDate = ConvertUtil.ConvertStringToNullableDateTime(Request["TrainEndDate"]); var examineProjectID = Request["ExamineProjectID"]; var examineProjectName = Request["ExamineProjectName"]; var assessor = Request["Assessor"]; var assessorAssistant = Request["AssessorAssistant"]; var examineDate = ConvertUtil.ConvertStringToNullableDateTime(Request["ExamineDate"]); var examinTimeOffset = Request["ExaminTimeOffset"]; var score = ConvertUtil.ConvertStringToNullableDecimal(Request["Score"]); var remark = Request["Remark"]; var model = new ImpExamineReport(); model.ID = Guid.NewGuid(); model.StuID = stuID; model.StuName = stuName; model.TrainOffice = trainOffice; model.IDCardNO = iDCardNO; model.TrainPosition = trainPosition; model.TrainClassName = trainClassName; model.TrainStartDate = trainStartDate; model.TrainEndDate = trainEndDate; model.ExamineProjectID = examineProjectID; model.ExamineProjectName = examineProjectName; model.Assessor = assessor; model.AssessorAssistant = assessorAssistant; model.ExamineDate = examineDate; model.ExaminTimeOffset = examinTimeOffset; model.Score = score; model.Remark = remark; model.CreateTime = System.DateTime.Now; model.CreateID = CurrentUser.UserId; model.CreateName = CurrentUser.UserName; model.IsValid = true; try { unitOfWork.ImpExamineReportBLL.InsertEntity(model); unitOfWork.Save(); return ""; } catch (Exception ex) { Log.Error("保存实作考核成绩单信息异常:" + ex.Message, ex); return "系统异常,请联系管理员!"; } }
private string ImpExamineReportImport(DataTable dt) { if (dt != null) { foreach (DataRow row in dt.Rows) { //学员编号 姓名 培训单位 身份证号 考试岗位 培训班名称 //培训开始时间 培训结束时间 考核项目编号 考核项目名称 考评员 考评助理 //考评日期 考核用时 项目成绩 备注 var model = new ImpExamineReport(); model.ID = Guid.NewGuid(); model.StuID = row["学员编号"].ToString(); model.StuName = row["姓名"].ToString(); model.TrainOffice = row["培训单位"].ToString(); model.IDCardNO = row["身份证号"].ToString(); model.TrainPosition = row["考试岗位"].ToString(); model.TrainClassName = row["培训班名称"].ToString(); model.TrainStartDate = ConvertUtil.ConvertObjToNullableDateTime(row["培训开始时间"]); model.TrainEndDate = ConvertUtil.ConvertObjToNullableDateTime(row["培训结束时间"]); model.ExamineProjectID = row["考核项目编号"].ToString(); model.ExamineProjectName = row["考核项目名称"].ToString(); model.Assessor = row["考评员"].ToString(); model.AssessorAssistant = row["考评助理"].ToString(); model.ExamineDate = ConvertUtil.ConvertObjToNullableDateTime(row["考评日期"]); model.ExaminTimeOffset = row["考核用时"].ToString(); model.Score = ConvertUtil.ConvertObjToNullableDecimal(row["项目成绩"]); model.Remark = row["备注"].ToString(); model.CreateTime = System.DateTime.Now; model.CreateID = CurrentUser.UserId; model.CreateName = CurrentUser.UserName; model.IsValid = true; unitOfWork.ImpExamineReportBLL.InsertEntity(model); } unitOfWork.Save(); } return ""; }