/// <summary> /// 更新一条数据(包含所有字段) /// </summary> public int Update_AllInfo(Sys.Model.Member model) { return(dal.Update_AllInfo(model)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(Sys.Model.Member model) { return(dal.Update(model)); }
/// <summary> /// 获得数据列表 /// </summary> public List <Sys.Model.Member> DataTableToList(DataTable dt) { List <Sys.Model.Member> modelList = new List <Sys.Model.Member>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Sys.Model.Member model; for (int n = 0; n < rowsCount; n++) { model = new Sys.Model.Member(); if (dt.Rows[n]["UserID"].ToString() != "") { model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString()); } model.Username = dt.Rows[n]["Username"].ToString(); if (dt.Rows[n]["GroupID"].ToString() != "") { model.GroupID = int.Parse(dt.Rows[n]["GroupID"].ToString()); } model.GroupName = dt.Rows[n]["GroupName"].ToString(); model.Email = dt.Rows[n]["Email"].ToString(); if (dt.Rows[n]["EmailState"].ToString() != "") { model.EmailState = int.Parse(dt.Rows[n]["EmailState"].ToString()); } if (dt.Rows[n]["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString()); } model.CreateIP = dt.Rows[n]["CreateIP"].ToString(); model.Question = dt.Rows[n]["Question"].ToString(); model.Answer = dt.Rows[n]["Answer"].ToString(); if (dt.Rows[n]["LoginTimes"].ToString() != "") { model.LoginTimes = int.Parse(dt.Rows[n]["LoginTimes"].ToString()); } if (dt.Rows[n]["LastLoginTime"].ToString() != "") { model.LastLoginTime = DateTime.Parse(dt.Rows[n]["LastLoginTime"].ToString()); } model.LastLoginIP = dt.Rows[n]["LastLoginIP"].ToString(); if (dt.Rows[n]["ThisLoginTime"].ToString() != "") { model.ThisLoginTime = DateTime.Parse(dt.Rows[n]["ThisLoginTime"].ToString()); } model.ThisLoginIP = dt.Rows[n]["ThisLoginIP"].ToString(); if (dt.Rows[n]["ActiveTime"].ToString() != "") { model.ActiveTime = DateTime.Parse(dt.Rows[n]["ActiveTime"].ToString()); } if (dt.Rows[n]["State"].ToString() != "") { model.State = int.Parse(dt.Rows[n]["State"].ToString()); } if (dt.Rows[n]["IsVIP"].ToString() != "") { model.IsVIP = int.Parse(dt.Rows[n]["IsVIP"].ToString()); } if (dt.Rows[n]["VIPStartTime"].ToString() != "") { model.VIPStartTime = DateTime.Parse(dt.Rows[n]["VIPStartTime"].ToString()); } if (dt.Rows[n]["VIPEndTime"].ToString() != "") { model.VIPEndTime = DateTime.Parse(dt.Rows[n]["VIPEndTime"].ToString()); } if (dt.Rows[n]["Birthday"].ToString() != "") { model.Birthday = DateTime.Parse(dt.Rows[n]["Birthday"].ToString()); } model.RealName = dt.Rows[n]["RealName"].ToString(); model.Sign = dt.Rows[n]["Sign"].ToString(); model.QQ = dt.Rows[n]["QQ"].ToString(); model.MSN = dt.Rows[n]["MSN"].ToString(); model.Guid = dt.Rows[n]["Guid"].ToString(); if (dt.Rows[n]["Integral"].ToString() != "") { model.Integral = int.Parse(dt.Rows[n]["Integral"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 增加一条数据 /// </summary> public int AddReturnUserID(Sys.Model.Member model, string Password) { return(dal.AddReturnUserID(model, Password)); }
/// <summary> /// 登陆 /// </summary> private void UserLogin() { //URL登陆定向,涉及SSO登陆 if (url.Length > 7 && url.Substring(0, 7) == "http://") { url = ""; } else { url = Utils.UrlEncode(url); } //用户名字段判断 if (username == "") { Response.Redirect("login.aspx?url=" + url + "&errmsg=帐户为空,请重新输入!&username="******"") { Response.Redirect("login.aspx?url=" + url + "&errmsg=密码为空,请重新输入!&username="******"") // Response.Redirect("login.aspx?url=" + url + "&errmsg=验证码为空,请重新输入!&username="******"ValidateCode"].Value.ToLower()) // Response.Redirect("login.aspx?url=" + url + "&errmsg=验证码不正确,请重新输入!&username="******"WebConfig", "AdminIpBlockType", 0); switch (AdminIpBlockType) { case 0: break; case 1: { var bllIpBlock = new Sys.BLL.SysIpBlock(); if (bllIpBlock.Exists(0, 1, Utils.GetRealIP())) { Response.Redirect("login.aspx?url=" + url + "&errmsg=当前IP被限制登录系统后台!&username="******"login.aspx?url=" + url + "&errmsg=当前IP被限制登录系统后台!&username="******"login.aspx?url=" + url + "&errmsg=帐户不存在!&username="******"login.aspx?url=" + url + "&errmsg=密码不正确!&username="******"login.aspx?url=" + url + "&errmsg=该账户无权登陆系统!&username="******"login.aspx?url=" + url + "&errmsg=该账户禁止登陆系统!&username="******"login.aspx?url=" + url + "&errmsg=该账户无权登陆系统后台!&username="******"login.aspx?url=" + url + "&errmsg=该账户禁止登陆系统后台!&username="******"managelogin", "登陆成功"); //Cookie保存-帐户 Sys.BLL.Admin.SetUsername(modelAdmin.Username); //Cookie保存-姓名 Sys.BLL.Admin.SetRealName(modelAdmin.RealName); //Cookie保存-rememberme if (PageRequest.GetInt("rememberme", 0) == 1) { Utils.WriteCookie("manage_LoginName", Utils.UrlEncode(username), 518400, ConfigHelper.GetConfigString("CookieDomain")); } if (modelAdmin.Username == modelAdmin.RealName) { Response.Redirect("main.aspx?url=" + Utils.UrlEncode("user/profile.aspx")); } else if (url != "") { Response.Redirect("main.aspx?url=" + Utils.UrlEncode(url)); } else { Response.Redirect("main.aspx"); } }