public int InsertByModel(RoteUserModel Model) { String sql = "INSERT INTO RoteUser(AID,RUName,RUSex,RUAge,RUDetail,RUImGUrl) VALUES(@AID,@RUName,@RUSex,@RUAge,@RUDetail,@RUImGUrl)"; return(DataBaseOpen.NoQuery(sql, new SqlParameter[] { new SqlParameter("@RUID", Model.RUID), new SqlParameter("@AID", Model.AID), new SqlParameter("@RUName", Model.RUName), new SqlParameter("@RUSex", Model.RUSex), new SqlParameter("@RUAge", Model.RUAge), new SqlParameter("@RUDetail", Model.RUDetail), new SqlParameter("@RUImGUrl", Model.RUImGUrl), })); }
protected void Page_Load(object sender, EventArgs e) { UsersModel usermodel = null; if (Request.Cookies["UserCode"] == null || Request.Cookies["UserPassword"] == null) { Request.Cookies.Add(new HttpCookie("UserCode")); Request.Cookies.Add(new HttpCookie("UserPassword")); } String UserCode = Request.Cookies["UserCode"].Value; String UserPassword = Request.Cookies["UserPassword"].Value; if (UserPassword == null || UserPassword == "") { //未登陆 return; } else { usermodel = userBLL.ToModel(userBLL.LoginByUserCodePasswordReturnModel(UserCode, UserPassword))[0]; //已经登录 } try { int RUID = Convert.ToInt32(Request["RUID"]); String IP = Request.UserHostAddress.ToString(); RoteUserModel model = roteUserBLL.ToModel(roteUserBLL.SelectByID(RUID))[0]; LABEL_Age.Text = model.RUAge.ToString(); LABEL_Detail.Text = model.RUDetail.ToString(); LABEL_SEX.Text = model.RUSex ? "女" : "男"; LABEL_UserName.Text = model.RUName; IMAGE_UserImage.ImageUrl = model.RUImGUrl; if (joinTableBLL.GetRoteInfoCountByIP(model.AID, IP) <= 0) { int exc = roteInfoBLL.InsertByModel(new RoteInfoModel() { RCreateTime = DateTime.Now.ToString(), RID = 0, RIP = IP, RUID = RUID, UID = usermodel.UID, }); } } catch { Response.End(); } }
public int UpdateByModel(RoteUserModel Model) { String ImgSql = Model.RUImGUrl == ""?"":" ,RUImGUrl=@RUImGUrl "; String sql = "UPDATE RoteUser SET AID=@AID,RUName=@RUName,RUSex=@RUSex,RUAge=@RUAge,RUDetail=@RUDetail " + ImgSql + " WHERE RUID=@RUID"; return(DataBaseOpen.NoQuery(sql, new SqlParameter[] { new SqlParameter("@RUID", Model.RUID), new SqlParameter("@AID", Model.AID), new SqlParameter("@RUName", Model.RUName), new SqlParameter("@RUSex", Model.RUSex), new SqlParameter("@RUAge", Model.RUAge), new SqlParameter("@RUDetail", Model.RUDetail), new SqlParameter("@RUImGUrl", Model.RUImGUrl), })); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } webFormTool.DropDownListSourceBindingToActionList(DROPDOWNLIST_ActionSelect); DataTable userTbale = roteUserBLL.SelectByID(RUID()); if (userTbale.Rows.Count <= 0) { return; } RoteUserModel userModel = roteUserBLL.ToModel(userTbale)[0]; TEXTBOX_Name.Text = userModel.RUName; TEXTBOX_Age.Text = userModel.RUAge.ToString(); TEXTBOX_Detail.Text = userModel.RUDetail; DROPDOWNLIST_Sex.SelectedIndex = userModel.RUSex ? 1 : 0; DROPDOWNLIST_ActionSelect.SelectedValue = userModel.AID.ToString(); }
public int UpdateByModel(RoteUserModel Model) { return(DAL.UpdateByModel(Model)); }
public int InsertByModel(RoteUserModel Model) { return(DAL.InsertByModel(Model)); }