日期:2014-05-17 浏览次数:20711 次
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { CS.BLL.UserInfo bllui = new CS.BLL.UserInfo(); CS.Model.UserInfo uif = new CS.Model.UserInfo(); CS.BLL.LmUserXinXi luxx = new CS.BLL.LmUserXinXi(); CS.Model.LmUserXinXi model = new CS.Model.LmUserXinXi(); bool b = bllui.Existss(YongHuMing.Value.ToString(), MiMa.Value.ToString()); CS.Model.UserInfo UIF = bllui.GetModel(YongHuMing.Value); userid = UIF.UserID; if (b){ bool bl = luxx.exct(userid); if (bl) { model.UserID = userid; model.NickName = YongHuMing.Value.ToString(); model.ZhangHuLeiXing =1; model.ZhuangTai = "正常"; CS.Model.LmUserXinXi Model = model; luxx.Add(Model); Page.ClientScript.RegisterStartupScript(typeof(Page), "", "alert('登录成功')", true); } else { Page.ClientScript.RegisterStartupScript(typeof(Page), "", "alert('登录成功')", true); } } else { Page.ClientScript.RegisterStartupScript(typeof(Page), "", "alert('登录失败,账户或密码错误.')", true); } }
public bool exct(int UserID) { return dal.exct(UserID); } -------------------- /// <summary> /// 查询用户是否已加入到联盟2011年5月24日 /// </summary> /// <param name="UserID"></param> /// <returns></returns> public bool exct(int UserID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from LmUserXinXi"); strSql.Append(" where UserID=@UserID"); SqlParameter[] parameters = { new SqlParameter("@UserID", SqlDbType.Int)}; parameters[0].Value = UserID; return DbHelperSQL.Exists(strSql.ToString(), parameters); }