130925199203217215
public List<UserInfoViewModel> QueryAllUser()
{
List<T_UserInfo> userList = this.CurrentDal.LoadItems().ToList();
//创建一个转换关系规则
Mapper.CreateMap<T_UserInfo, UserInfoViewModel>();
//进行转换
List<UserInfoViewModel> userInfoList = Mapper.Map<List<T_UserInfo>, List<UserInfoViewModel>>(userList);
return userInfoList;
}
//创建映射规则
Mapper.CreateMap<BidTRecorderViewModel, T_BidTRecord>();
//进行转换
T_BidTRecord enBidTRecord = Mapper.Map<T_BidTRecord>(enBidTRecordVM);
<#@ CleanupBehavior Processor="T4VSHost" CleanupAfterProcessingTemplate="true" #>
<#@ CleanupBehavior Processor="T4VSHost" CleanupAfterProcessingTemplate="true" #>
//通过切割的方式来获得ID
string[] specialistID = tempSpecialistID.Split(',');
//将试卷值存放到cookie中
HttpCookie cookie = new HttpCookie("PaperInfo");
cookie.Values.Add("PaperName", strName);
cookie.Values.Add("PaperQuestion",QuestionIds);
cookie.Values.Add("CourseID", strCourseID);
cookie.Values.Add("PaperId", PaperID.ToString());
Session.Add("PaperName", strPaperName);
Response.AppendCookie(cookie);
//取出cookie中的值
HttpCookie newCookie = Request.Cookies["PaperInfo"];
string strName = newCookie.Values["PaperName"];