public M_LiteUser GetModelFromReader(DataRow rdr) { M_LiteUser model = new M_LiteUser(); model.userId = Convert.ToInt32(rdr["UserID"]); model.groupId = ConvertToInt(rdr["groupId"]); model.userFace = ConverToStr(rdr["userFace"]); model.userName = ConverToStr(rdr["UserName"]); model.honeyName = ConverToStr(rdr["HoneyName"]); model.trueName = ConverToStr(rdr["trueName"]); model.openid = ConverToStr(rdr["openid"]); model.puid = ConvertToInt(rdr["puid"]); model.puname = ConverToStr(rdr["puname"]); model.address = ConverToStr(rdr["address"]); model.mobile = ConverToStr(rdr["mobile"]); model.sex = ConvertToInt(rdr["userSex"]) == 1 ? "男" : "女"; model.cardType = ConverToStr(rdr["cardType"]); model.idcard = ConverToStr(rdr["idCard"]); model.age = ConvertToInt(rdr["age"]); model.siteId = ConvertToInt(rdr["siteId"]); //------------ //if (string.IsNullOrEmpty(model.userFace)) //{ // model.userFace = SiteConfig.SiteInfo.SiteUrl + "/Images/UserFace/noface.png"; //} //else if (!model.userFace.Contains("://")) //{ // model.userFace = SiteConfig.SiteInfo.SiteUrl + model.userFace; //} return(model); }
public override SqlParameter[] GetParameters() { M_LiteUser model = this; SqlParameter[] sp = GetSP(); return(sp); }
public M_LiteUser SelReturnModel(int uid) { DataTable dt = DBCenter.Sel(TbName, "UserID=" + uid, ""); if (dt.Rows.Count < 1) { return(null); } M_LiteUser model = new M_LiteUser().GetModelFromReader(dt.Rows[0]); return(model); }
public M_LiteUser SelModelByOpenId(string openid) { if (string.IsNullOrEmpty(openid)) { return(null); } List <SqlParameter> sp = new List <SqlParameter>() { new SqlParameter("openid", openid) }; DataTable dt = DBCenter.Sel(TbName, "openid=@openid", "", sp); if (dt.Rows.Count < 1) { return(null); } M_LiteUser model = new M_LiteUser().GetModelFromReader(dt.Rows[0]); return(model); }
public M_LiteUser SelModelByPasswd(string uname, string passwd) { if (string.IsNullOrEmpty(uname) || string.IsNullOrEmpty(passwd)) { return(null); } passwd = StringHelper.MD5(passwd); List <SqlParameter> sp = new List <SqlParameter>() { new SqlParameter("uname", uname), new SqlParameter("passwd", passwd) }; DataTable dt = DBCenter.Sel(TbName, "UserName=@uname AND UserPwd=@passwd", "", sp); if (dt.Rows.Count < 1) { return(null); } M_LiteUser model = new M_LiteUser().GetModelFromReader(dt.Rows[0]); return(model); }
public bool UpdateByID(M_LiteUser model) { return(DBCenter.UpdateByID(model, model.userId)); }