public void ExtendValid(string sessionkey, View_Sys_UserInfo UserInfo) { var model = UserAuthSessionsBLL.Get(p => p.SessionKey == sessionkey); if (model != null) { //延长一年 model.InvalidTime = DateTime.Now.AddYears(1); UserAuthSessionsBLL.Update(model); //设置缓存 CacheContext.Set(model.SessionKey, new SessionCacheItem { AppKey = model.AppKey, InvalidTime = model.InvalidTime, UserName = model.UserName, UserID = UserInfo.UserInfoID, LoginUserName = UserInfo.UserInfo_LoginUserName, DepartmentName = UserInfo.Department_Name, DepartmentCode = UserInfo.UserInfo_DepCode, PostID = UserInfo.UserInfo_Post, PostName = UserInfo.UserInfo_PostName, RoleID = UserInfo.UserInfo_RoleID, RoleName = UserInfo.UserInfo_RoleName, UserType = UserInfo.UserInfo_Type, DepType = UserInfo.Department_Type }); } }
/// <summary> /// 信息初始化绑定 /// </summary> protected void InitBind() { //modelViewUser = bllUser.FindViewUser(CurrUserInfo().UserID); View_Sys_UserInfoBLL bllUser = new View_Sys_UserInfoBLL(); string userid = CurrUserInfo().UserID; modelViewUser = new View_Sys_UserInfo(); //modelViewUser = bllUser.Find(p => p.UserInfoID == userid); modelViewUser = bllUser.Get(p => p.UserInfoID == userid); if (modelViewUser != null) { FormModel.SetForm <View_Sys_UserInfo>(this, modelViewUser, "t_"); t_UserInfo_LoginUserPwd.Attributes.Add("value", DESEncrypt.Decrypt(modelViewUser.UserInfo_LoginUserPwd)); t_UserInfo_DateBirth.Text = modelViewUser.UserInfo_DateBirth != null?Convert.ToDateTime(modelViewUser.UserInfo_DateBirth).ToString("yyyy年MM月dd日") : ""; txt_Yhxx_DTcsrq.Value = modelViewUser.UserInfo_DateBirth != null?Convert.ToDateTime(modelViewUser.UserInfo_DateBirth).ToString("yyyy年MM月dd日") : ""; t_UserInfo_Age.Text = modelViewUser.UserInfo_Age != null?modelViewUser.UserInfo_Age.ToString() : ""; txt_Yhxx_Iage.Value = modelViewUser.UserInfo_Age != null?modelViewUser.UserInfo_Age.ToString() : ""; } }
public void Create(SSO_UserAuthSessions model, View_Sys_UserInfo UserInfo) { //添加Session UserAuthSessionsBLL.Add(model); //设置缓存 CacheContext.Set(model.SessionKey, new SessionCacheItem { AppKey = model.AppKey, InvalidTime = model.InvalidTime, UserName = model.UserName, UserID = UserInfo.UserInfoID, LoginUserName = UserInfo.UserInfo_LoginUserName, DepartmentName = UserInfo.Department_Name, DepartmentCode = UserInfo.UserInfo_DepCode, PostID = UserInfo.UserInfo_Post, PostName = UserInfo.UserInfo_PostName, RoleID = UserInfo.UserInfo_RoleID, RoleName = UserInfo.UserInfo_RoleName, UserType = UserInfo.UserInfo_Type, DepType = UserInfo.Department_Type }); }
/// <summary> /// 信息初始化绑定 /// </summary> protected void InitBinds() { string id = RequstStr("id"); if (!string.IsNullOrEmpty(id)) { //modelViewUser = bllUser.FindViewUser(id); View_Sys_UserInfoBLL bllUser = new View_Sys_UserInfoBLL(); View_Sys_UserInfo modelViewUser = bllUser.Get(p => p.UserInfoID == id); //FormModel.SetForm<View_Sys_UserInfo>(this, modelViewUser, "t_"); t_UserInfo_LoginUserName.Text = modelViewUser.UserInfo_LoginUserName; t_UserInfo_FullName.Text = modelViewUser.UserInfo_FullName; //t_UserInfo_LoginUserPwd.Attributes.Add("value", DESEncrypt.Decrypt(modelViewUser.UserInfo_LoginUserPwd)); //modelUser.UserInfo_LoginUserPwd = DESEncrypt.Encrypt(t_UserInfo_LoginUserPwd.Text.ToString().Trim()); //t_UserInfo_LoginUserPwd.Text = modelViewUser.UserInfo_LoginUserPwd; t_UserInfo_PhoneNumber.Text = modelViewUser.UserInfo_PhoneNumber; t_UserInfo_Nation.SelectedValue = modelViewUser.UserInfo_Nation; t_UserInfo_Sex.SelectedValue = modelViewUser.UserInfo_Sex; t_UserInfo_IdentityCred.Text = modelViewUser.UserInfo_IdentityCred; t_UserInfo_Age.Text = Convert.ToInt32(modelViewUser.UserInfo_Age).ToString(); if (modelViewUser.UserInfo_DateBirth != null) { t_UserInfo_DateBirth.Text = Convert.ToDateTime(modelViewUser.UserInfo_DateBirth).ToString("yyyy年MM月dd日"); } t_UserInfo_StatusName.Text = modelViewUser.UserInfo_StatusName; t_Department_Name.Text = modelViewUser.Department_Name; t_UserInfo_PostName.Text = modelViewUser.UserInfo_PostName; t_UserInfo_Hometown.Text = modelViewUser.UserInfo_Hometown; t_UserInfo_Address.Text = modelViewUser.UserInfo_Address; t_UserInfo_PoliticalLandscape.Text = modelViewUser.UserInfo_PoliticalLandscape; t_UserInfo_EducationalLevel.Text = modelViewUser.UserInfo_EducationalLevel; t_UserInfo_Schools.Text = modelViewUser.UserInfo_Schools; t_UserInfo_Specialty.Text = modelViewUser.UserInfo_Specialty; if (modelViewUser.UserInfo_StartWorkDate != null) { t_UserInfo_StartWorkDate.Text = Convert.ToDateTime(modelViewUser.UserInfo_StartWorkDate).ToString("yyyy年MM月dd日"); } if (modelViewUser.UserInfo_JoinPartyDate != null) { t_UserInfo_JoinPartyDate.Text = Convert.ToDateTime(modelViewUser.UserInfo_JoinPartyDate).ToString("yyyy年MM月dd日"); } if (modelViewUser.UserInfo_NowHoldPostTime != null) { t_UserInfo_EnlistTime.Text = Convert.ToDateTime(modelViewUser.UserInfo_NowHoldPostTime).ToString("yyyy年MM月dd日"); } t_UserInfo_Badge.Text = modelViewUser.UserInfo_Badge; t_UserInfo_EnlistPlace.Text = modelViewUser.UserInfo_EduBackground; t_UserInfo_Position.Text = modelViewUser.UserInfo_Position; t_UserInfo_PositionLevel.Text = modelViewUser.UserInfo_PositionLevel; if (modelViewUser.UserInfo_NowHoldPostTime != null) { t_UserInfo_NowHoldPostTime.Text = Convert.ToDateTime(modelViewUser.UserInfo_NowHoldPostTime).ToString("yyyy年MM月dd日"); } t_UserInfo_OccupTitle.Text = modelViewUser.UserInfo_OccupTitle; // t_UserInfo_LoginUserPwd.Attributes.Add("value", DESEncrypt.Decrypt(modelViewUser.UserInfo_LoginUserPwd)); //t_UserInfo_DateBirth.Text = modelViewUser.UserInfo_DateBirth != null ? Convert.ToDateTime(modelViewUser.UserInfo_DateBirth).ToString("yyyy年MM月dd日") : ""; txt_Yhxx_DTcsrq.Value = modelViewUser.UserInfo_DateBirth != null?Convert.ToDateTime(modelViewUser.UserInfo_DateBirth).ToString("yyyy年MM月dd日") : ""; t_UserInfo_Age.Text = modelViewUser.UserInfo_Age != null?modelViewUser.UserInfo_Age.ToString() : ""; txt_Yhxx_Iage.Value = modelViewUser.UserInfo_Age != null?modelViewUser.UserInfo_Age.ToString() : ""; } }