コード例 #1
0
        public static UserMore UserMoreBind(IDataReader drUserMore)
        {
            UserMore umObject = new UserMore();

            if (drUserMore.Read())
            {
                umObject.birthday = drUserMore["birthday"].ToString();
                umObject.nickname = drUserMore["nickname"].ToString();
                umObject.phone    = drUserMore["phone"].ToString();
                umObject.qq       = drUserMore["qq"].ToString();
                umObject.work     = drUserMore["work"].ToString();
                umObject.sex      = drUserMore["sex"].ToString();
            }
            else
            {
                umObject.birthday = "1970-01-01";
                umObject.nickname = "";
                umObject.phone    = "";
                umObject.qq       = "";
                umObject.work     = "";
                umObject.sex      = "0";
            }
            drUserMore.Close();
            return(umObject);
        }
コード例 #2
0
        public static string UserMoreJsonSel(int iUserID)
        {
            UserMore      umObject = UserMoreSelByID(iUserID);
            StringBuilder sbText   = new StringBuilder("{");

            sbText.AppendFormat("nickname:'{0}',", umObject.nickname.Trim());
            sbText.AppendFormat("birthday:'{0}',", umObject.birthday);
            sbText.AppendFormat("work:'{0}',", umObject.work);
            sbText.AppendFormat("phone:'{0}',", umObject.phone);
            sbText.AppendFormat("qq:'{0}',", umObject.qq.Trim());
            sbText.AppendFormat("sex:'{0}'", umObject.sex);
            sbText.Append("}");
            return(sbText.ToString());
        }
コード例 #3
0
        public static int UserMoreUpdate(UserMore umObject)
        {
            Database  dbUCenter  = DatabaseFactory.CreateDatabase(sConn);
            DbCommand dcUserMore = dbUCenter.GetStoredProcCommand("UserMore_UpdateByID");

            dbUCenter.AddInParameter(dcUserMore, "@userid", DbType.Int32, umObject.userid);
            dbUCenter.AddInParameter(dcUserMore, "@nickname", DbType.String, umObject.nickname);
            dbUCenter.AddInParameter(dcUserMore, "@birthday", DbType.String, umObject.birthday);
            dbUCenter.AddInParameter(dcUserMore, "@work", DbType.String, umObject.work);
            dbUCenter.AddInParameter(dcUserMore, "@phone", DbType.String, umObject.phone);
            dbUCenter.AddInParameter(dcUserMore, "@qq", DbType.String, umObject.qq);
            dbUCenter.AddInParameter(dcUserMore, "@sex", DbType.String, umObject.sex);

            return(dbUCenter.ExecuteNonQuery(dcUserMore));
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sRes = string.Empty;

            if (LoginSessionVal() || isLoginCookie())
            {
                if (Request.HttpMethod == "POST")
                {
                    string sBirthday = CYRequest.GetFormString("birthday").Trim();
                    string sNickname = CYRequest.GetFormString("nickname").Trim();
                    string sPhone    = CYRequest.GetFormString("phone").Trim();
                    string sQQ       = CYRequest.GetFormString("qq").Trim();
                    string sSex      = CYRequest.GetFormString("sex").Trim();
                    string sWork     = CYRequest.GetFormString("work").Trim();
                    string sGoUrL    = CYRequest.GetFormString("fromurl").Trim();
                    string sBackUrL  = Request.UrlReferrer.ToString();
                    if (sNickname.Length > 0 && sPhone.Length == 11 && sBirthday.Length > 7 && sQQ.Length > 4 && sSex.Length == 1 && sWork.Length > 0)
                    {
                        int      iUserID  = GetUserID();
                        UserMore umObject = new UserMore();
                        umObject.userid   = iUserID;
                        umObject.birthday = sBirthday;
                        umObject.nickname = sNickname;
                        umObject.phone    = sPhone;
                        umObject.qq       = sQQ;
                        umObject.sex      = sSex;
                        umObject.work     = sWork;
                        int iRes = UserMoreBLL.UserMoreAdd(umObject);
                        if (iRes > 0)
                        {
                            Response.Write(string.Format("<script>alert('修改成功!')</script><script>location.href='{0}'</script>", sGoUrL));
                            return;
                        }
                        else
                        {
                            Response.Write(string.Format("<script>alert('添加失败!')</script><script>location.href='{0}'</script>", sBackUrL));
                            return;
                        }
                    }
                    else
                    {
                        Response.Write(string.Format("<script>alert('输入内容有误,请从新输入!')</script><script>location.href='{0}'</script>", sBackUrL));
                        return;
                    }
                }
            }
        }
コード例 #5
0
 public static int UserMoreUpdate(UserMore umObject)
 {
     return(UserMoreDAL.UserMoreUpdate(umObject));
 }
コード例 #6
0
 public static int UserMoreAdd(UserMore umObject)
 {
     return(UserMoreDAL.UserMoreAdd(umObject));
 }