/// <summary>
        /// UserReg
        /// </summary>
        /// <param name="UserModel"></param>
        /// <param name="valdates"></param>
        /// <returns>0,1,-1,-2,-3 分别是 注册失败,注册成功,该用户已经存在,验证码错误,缺少参数</returns>
        public int UserReg(ROYcms.Sys.Model.ROYcms_user UserModel, string valdates)
        {
            int PER = 0;

            //try
            //{
            if (UserModel.name != null && UserModel.password != null && UserModel.email != null && valdates != null)
            {
                if (valdates.Trim().ToUpperInvariant() == ROYcms.Common.Session.Get("code"))
                {
                    if (!___ROYcms_user_bll.Exists(UserModel.name))
                    {
                        UserModel.password = ROYcms.Common.DESEncrypt.Encrypt(UserModel.password); //对密码进行编码
                        int rt = ___ROYcms_user_bll.Add(UserModel);                                //添加一条数据返回添加的标识
                        //初始化
                        adduserinfor(rt);
                        if (rt > 0)
                        {
                            //写入登录日志
                            this.InsertSystemLog("4", UserModel.name + "新注册会员", UserModel.name + "新注册会员");           //写入日志
                            ROYcms.Common.Session.Add("user_id", rt.ToString());
                            ROYcms.Common.Session.Add("user", UserModel.name);
                            ROYcms.Common.Session.Add("ugroup_id", UserModel.UgroupID);
                            PER = 1;
                        }
                        else
                        {
                            PER = 0;
                        }                    //注册失败!
                    }
                    else
                    {
                        PER = -1;
                    }                     //该用户已存在!
                }
                else
                {
                    PER = -2;
                }                     //验证码错误!
            }
            else
            {
                PER = -3;
            }                     //缺少参数!
            //}
            //catch
            //{
            //    this.InsertSystemLog("5", "普通会员注册失败", "普通会员注册失败");
            //}
            return(PER);
        }
Beispiel #2
0
 {    /// <summary>
     /// XML help?
     /// </summary>
     protected void Page_Load(object sender, EventArgs e)
     {
         if (!IsPostBack)
         {
             ROYcms.Sys.BLL.ROYcms_Goods_Order   Goods_Order_BLL   = new ROYcms.Sys.BLL.ROYcms_Goods_Order();
             ROYcms.Sys.Model.ROYcms_Goods_Order Goods_Order_Model = new ROYcms.Sys.Model.ROYcms_Goods_Order();
             ROYcms.Sys.BLL.ROYcms_Payment       Payment_BLL       = new ROYcms.Sys.BLL.ROYcms_Payment();
             ROYcms.Sys.Model.ROYcms_Payment     Payment_Model     = new ROYcms.Sys.Model.ROYcms_Payment();
             ROYcms.Sys.BLL.ROYcms_user          user_BLL          = new ROYcms.Sys.BLL.ROYcms_user();
             ROYcms.Sys.Model.ROYcms_user        user_Model        = new ROYcms.Sys.Model.ROYcms_user();
             string OrderId = Request["order_id"];
             if (OrderId != null)
             {
                 //修改订单状态
                 Goods_Order_Model = Goods_Order_BLL.GetModel(OrderId);
                 if (Goods_Order_Model == null)
                 {
                     //订单无效
                     return;
                 }
                 Goods_Order_Model.order_sn     = OrderId;
                 Goods_Order_Model.order_status = 1;
                 Goods_Order_BLL.Update_(Goods_Order_Model);
                 //创建支付记录
                 Payment_Model.PaymentAmount = Goods_Order_Model.goods_amount;
                 Payment_Model.PaymentName   = "支付接口名称";
                 Payment_Model.PaymentNum    = "支付号";
                 Payment_Model.PaymentType   = "支付接口类型";
                 Payment_Model.UserID        = Goods_Order_Model.user_id;
                 Payment_Model.UpdateTime    = DateTime.Now;
                 Payment_BLL.Add(Payment_Model);
                 //修改用户积分
                 user_Model = user_BLL.GetModel(Convert.ToInt32(Goods_Order_Model.user_id));
                 if (user_Model == null)
                 {
                     //用户无效
                     return;
                 }
                 user_Model.money = user_Model.money + Goods_Order_Model.goods_amount;
             }
             else
             {
                 ROYcms.Common.MessageBox.Show(this, "订单号码不能为空!");
             }
         }
     }
Beispiel #3
0
        public int GETpassword()
        {
            int    PER      = 0;
            string username = ROYcms.Common.Request.GetFormString("username");

            if (BLL.Exists(username))
            {
                Model = BLL.GetModel(username);
                string md5P = ROYcms.Common.DESEncrypt.Encrypt(username + "," + DateTime.Now);

                bool sendErr = ROYcms.Common.SystemCms.SendMail("找回密码信息", "请点击该链接<a herf='" + Request.Url.Host + "/UCENTER/update_password.aspx?R=" + md5P + "'>" + Request.Url.Host + "/UCENTER/update_password.aspx?R=" + md5P + "</a>", Model.email);//将密码发送到邮箱内
                if (sendErr)
                {
                    PER = 1;
                }
                else
                {
                    PER = -1;
                }
            }
            return(PER);
        }
Beispiel #4
0
        /// <summary>
        /// Shows the info.
        /// </summary>
        /// <param name="bh">The bh.</param>
        private void ShowInfo(int bh)
        {
            Model = ___ROYcms_user_bll.GetModel(bh);

            ___ROYcms_user_model   = Model;
            this.txtname.Text      = ___ROYcms_user_model.name;
            this.txtpassword.Text  = ROYcms.Common.DESEncrypt.Decrypt(___ROYcms_user_model.password);
            this.txtpassword2.Text = ROYcms.Common.DESEncrypt.Decrypt(___ROYcms_user_model.password);
            this.txtqq.Text        = ___ROYcms_user_model.qq;
            this.txtemail.Text     = ___ROYcms_user_model.email;
            this.txtusername.Text  = ___ROYcms_user_model.username;
            if (___ROYcms_user_model.UgroupID != null && ___ROYcms_user_model.UgroupID != "")
            {
                try
                {
                    this.UGroup_DropDownList.SelectedValue = ___ROYcms_user_model.UgroupID;
                }
                catch
                {  //删除无效的用户组所属权限
                    ___ROYcms_user_bll.Update(___ROYcms_user_model.UgroupID);
                }
            }
        }