public Model_F_User_Client DataRowToModel(DataRow row) { Model_F_User_Client client = new Model_F_User_Client(); if (row != null) { if (row["UserId"] != null) { client.UserId = row["UserId"].ToString(); } if (row["UserName"] != null) { client.UserName = row["UserName"].ToString(); } if (row["Password"] != null) { client.Password = row["Password"].ToString(); } if (row["TrueName"] != null) { client.TrueName = row["TrueName"].ToString(); } if (row["UserIdentity"] != null) { client.UserIdentity = row["UserIdentity"].ToString(); } if ((row["Birthday"] != null) && (row["Birthday"].ToString() != "")) { client.Birthday = new DateTime?(DateTime.Parse(row["Birthday"].ToString())); } if (row["Sex"] != null) { client.Sex = row["Sex"].ToString(); } if (row["Email"] != null) { client.Email = row["Email"].ToString(); } if (row["Mobile"] != null) { client.Mobile = row["Mobile"].ToString(); } if (row["Province"] != null) { client.Province = row["Province"].ToString(); } if (row["City"] != null) { client.City = row["City"].ToString(); } if (row["County"] != null) { client.County = row["County"].ToString(); } if (row["School"] != null) { client.School = row["School"].ToString(); } if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != "")) { client.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString())); } if (row["Stoken"] != null) { client.Stoken = row["Stoken"].ToString(); } if ((row["StokenTime"] != null) && (row["StokenTime"].ToString() != "")) { client.StokenTime = new DateTime?(DateTime.Parse(row["StokenTime"].ToString())); } if (row["Resource_Version"] != null) { client.Resource_Version = row["Resource_Version"].ToString(); } if (row["GradeTerm"] != null) { client.GradeTerm = row["GradeTerm"].ToString(); } if (row["Subject"] != null) { client.Subject = row["Subject"].ToString(); } if (row["UserPost"] != null) { client.UserPost = row["UserPost"].ToString(); } if ((row["ExpirationDate"] != null) && (row["ExpirationDate"].ToString() != "")) { client.ExpirationDate = new DateTime?(DateTime.Parse(row["ExpirationDate"].ToString())); } if ((row["product_type"] != null) && (row["product_type"].ToString() != "")) { client.product_type = row["product_type"].ToString(); } } return(client); }
protected void Page_Load(object sender, EventArgs e) { string strToken = string.Empty; string strUserId = string.Empty; string strError = string.Empty; string strProductType = string.Empty; if (!String.IsNullOrEmpty(Request["token"]) && !String.IsNullOrEmpty(Request["userId"]) && !String.IsNullOrEmpty(Request["productType"])) { strToken = Request["token"].ToString().Filter(); strUserId = Request["userId"].ToString().Filter(); strProductType = Request["productType"].ToString().Filter(); Model_F_User_Client model = new Model_F_User_Client(); model = new BLL_F_User_Client().GetUserModelByClientToken(strUserId, strToken, strProductType); if (model != null) { string iurl = string.Empty; //用户信息 Model_F_User loginUser = new Model_F_User(); loginUser = new BLL_F_User().GetModel(strUserId); if (loginUser != null) { #region 前台用户 Session["FLoginUser"] = loginUser; Session["modlist"] = null; string local_url = string.Empty; // 局域网地址 #region 学校配置URL DataTable dtUrlLICH = new BLL_ConfigSchool().GetSchoolPublicUrl(loginUser.UserId).Tables[0]; if (dtUrlLICH.Rows.Count > 0) { Session["UserPublicUrl"] = dtUrlLICH.Rows[0]["publicUrl"]; local_url = dtUrlLICH.Rows[0]["apiUrlList"].ToString(); } #endregion if (loginUser.UserIdentity == "T") { iurl = "/teacher/Comment.aspx"; } else { iurl = "/student/basicSetting.aspx"; } string rurl = string.Format("/onlinecheck.aspx?iurl={0}&local_url={1}" , HttpContext.Current.Server.UrlEncode(iurl) , HttpContext.Current.Server.UrlEncode(local_url)); if (dtUrlLICH.Rows.Count > 0) // 有局域网配置数据,验证是否局域网 { iurl = rurl; } Response.Redirect(iurl); Response.End(); #endregion } else { #region 后台用户 Rc.Cloud.Model.Model_VSysUserRole loginModel = new Model.Model_VSysUserRole(); loginModel = new Rc.Cloud.BLL.BLL_VSysUserRole().GetSysUserInfoModelBySysUserId(strUserId); if (loginModel != null) { DataTable dt = new Rc.Cloud.BLL.BLL_SysModule().GetOwenModuleListByCacheBySysCode(loginModel.SysUser_ID, Rc.Common.StrUtility.clsUtility.ReDoStr(loginModel.SysRole_IDs, ',')); DataRow[] drs = dt.Select("isLast='1' and url<>'#'", "DefaultOrder desc"); if (drs.Count() > 0) { Session["LoginUser"] = loginModel; if (Request["iurl"] != null) { Response.Redirect(Request["iurl"].ToString()); } else { Response.Redirect("/" + drs[0]["url"].ToString()); } } else { Rc.Common.StrUtility.clsUtility.ErrorDispose(this.Page, 6, false); } } #endregion } } else { strError = "对不起,此账号已在其他机器登录。"; } } else { strError = "参数无效"; } Response.Write(strError); Response.End(); }