Exemple #1
0
        protected void btnAudit_Click(object sender, EventArgs e)
        {
            this.ChkAdminLevel(nameof(user_audit), DTEnums.ActionEnum.Audit.ToString());
            int num1 = 0;
            int num2 = 0;

            Rain.BLL.users users = new Rain.BLL.users();
            for (int index = 0; index < this.rptList.Items.Count; ++index)
            {
                int int32 = Convert.ToInt32(((HiddenField)this.rptList.Items[index].FindControl("hidId")).Value);
                if (((CheckBox)this.rptList.Items[index].FindControl("chkId")).Checked)
                {
                    if (users.UpdateField(int32, "status=0") > 0)
                    {
                        ++num1;
                    }
                    else
                    {
                        ++num2;
                    }
                }
            }
            this.AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核会员成功" + (object)num1 + "条,失败" + (object)num2 + "条");
            this.JscriptMsg("审核通过" + (object)num1 + "条,失败" + (object)num2 + "条!", Utils.CombUrlTxt("user_audit.aspx", "keywords={0}", this.keywords));
        }
Exemple #2
0
        private bool DoAdd()
        {
            Rain.Model.users model1 = new Rain.BLL.users().GetModel(this.txtUserName.Text.Trim());
            if (model1 == null)
            {
                return(false);
            }
            bool flag = false;

            Rain.Model.user_recharge model2       = new Rain.Model.user_recharge();
            Rain.BLL.user_recharge   userRecharge = new Rain.BLL.user_recharge();
            model2.user_id       = model1.id;
            model2.user_name     = model1.user_name;
            model2.recharge_no   = "R" + this.txtRechargeNo.Text.Trim();
            model2.payment_id    = Utils.StrToInt(this.ddlPaymentId.SelectedValue, 0);
            model2.amount        = Utils.StrToDecimal(this.txtAmount.Text.Trim(), new Decimal(0));
            model2.status        = 1;
            model2.add_time      = DateTime.Now;
            model2.complete_time = new DateTime?(DateTime.Now);
            if (userRecharge.Recharge(model2))
            {
                this.AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "给会员:" + model2.user_name + ",充值:" + (object)model2.amount + "元");
                flag = true;
            }
            return(flag);
        }
Exemple #3
0
        private void ShowInfo(int _id)
        {
            this.model = new Rain.BLL.orders().GetModel(_id);
            this.rptList.DataSource = (object)this.model.order_goods;
            this.rptList.DataBind();
            if (this.model.user_id > 0)
            {
                Rain.Model.users model1 = new Rain.BLL.users().GetModel(this.model.user_id);
                if (model1 != null)
                {
                    Rain.Model.user_groups model2 = new Rain.BLL.user_groups().GetModel(model1.group_id);
                    if (model2 != null)
                    {
                        this.dlUserInfo.Visible  = true;
                        this.lbUserName.Text     = model1.user_name;
                        this.lbUserGroup.Text    = model2.title;
                        this.lbUserDiscount.Text = model2.discount.ToString() + " %";
                        this.lbUserAmount.Text   = model1.amount.ToString();
                        this.lbUserPoint.Text    = model1.point.ToString();
                    }
                }
            }
            switch (this.model.status)
            {
            case 1:
                if (this.model.payment_status > 0)
                {
                    this.btnPayment.Visible = this.btnCancel.Visible = this.btnEditAcceptInfo.Visible = true;
                }
                else
                {
                    this.btnConfirm.Visible = this.btnCancel.Visible = this.btnEditAcceptInfo.Visible = true;
                }
                this.btnEditRemark.Visible = this.btnEditRealAmount.Visible = this.btnEditExpressFee.Visible = this.btnEditPaymentFee.Visible = this.btnEditInvoiceTaxes.Visible = true;
                break;

            case 2:
                if (this.model.express_status == 1)
                {
                    this.btnExpress.Visible = this.btnCancel.Visible = this.btnEditAcceptInfo.Visible = true;
                }
                else if (this.model.express_status == 2)
                {
                    this.btnComplete.Visible = this.btnCancel.Visible = true;
                }
                this.btnEditRemark.Visible = true;
                break;

            case 3:
                this.btnInvalid.Visible = this.btnEditRemark.Visible = true;
                break;
            }
            if (this.model.express_status != 2 || this.model.express_no.Trim().Length <= 0)
            {
                return;
            }
            new Rain.BLL.express().GetModel(this.model.express_id);
            new Rain.BLL.orderconfig().loadConfig();
        }
Exemple #4
0
 protected string get_user_avatar(string user_name)
 {
     Rain.BLL.users users = new Rain.BLL.users();
     if (!users.Exists(user_name))
     {
         return("");
     }
     return(users.GetModel(user_name).avatar);
 }
Exemple #5
0
        private bool DoAdd()
        {
            bool flag = false;

            Rain.Model.users model = new Rain.Model.users();
            Rain.BLL.users   users = new Rain.BLL.users();
            model.group_id = int.Parse(this.ddlGroupId.SelectedValue);
            model.status   = int.Parse(this.rblStatus.SelectedValue);
            if (users.Exists(this.txtUserName.Text.Trim()))
            {
                return(false);
            }
            model.user_name = Utils.DropHTML(this.txtUserName.Text.Trim());
            model.salt      = Utils.GetCheckCode(6);
            model.password  = DESEncrypt.Encrypt(this.txtPassword.Text.Trim(), model.salt);
            model.email     = Utils.DropHTML(this.txtEmail.Text);
            model.nick_name = Utils.DropHTML(this.txtNickName.Text);
            model.avatar    = Utils.DropHTML(this.txtAvatar.Text);
            model.sex       = this.rblSex.SelectedValue;
            DateTime result;

            if (DateTime.TryParse(this.txtBirthday.Text.Trim(), out result))
            {
                model.birthday = new DateTime?(result);
            }
            model.telphone = Utils.DropHTML(this.txtTelphone.Text.Trim());
            model.mobile   = Utils.DropHTML(this.txtMobile.Text.Trim());
            model.qq       = Utils.DropHTML(this.txtQQ.Text);
            model.msn      = Utils.DropHTML(this.txtMsn.Text);
            model.address  = Utils.DropHTML(this.txtAddress.Text.Trim());
            model.amount   = Decimal.Parse(this.txtAmount.Text.Trim());
            model.point    = int.Parse(this.txtPoint.Text.Trim());
            model.exp      = int.Parse(this.txtExp.Text.Trim());
            model.reg_time = DateTime.Now;
            model.reg_ip   = DTRequest.GetIP();
            if (users.Add(model) > 0)
            {
                this.AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加用户:" + model.user_name);
                flag = true;
            }
            return(flag);
        }
Exemple #6
0
        public bool IsUserLogin()
        {
            if (HttpContext.Current.Session["dt_session_user_info"] != null)
            {
                return(true);
            }
            string cookie1 = Utils.GetCookie("dt_cookie_user_name_remember", "Rain");
            string cookie2 = Utils.GetCookie("dt_cookie_user_pwd_remember", "Rain");

            if (cookie1 != "" && cookie2 != "")
            {
                Rain.Model.users model = new Rain.BLL.users().GetModel(cookie1, cookie2, 0, 0, false);
                if (model != null)
                {
                    HttpContext.Current.Session["dt_session_user_info"] = (object)model;
                    return(true);
                }
            }
            return(false);
        }
Exemple #7
0
 private void UserPage_Init(object sender, EventArgs e)
 {
     this.turl = Utils.GetCookie("dt_cookie_url_referrer");
     if (string.IsNullOrEmpty(this.turl) || this.turl == HttpContext.Current.Request.Url.ToString().ToLower())
     {
         this.turl = this.linkurl("usercenter", (object)"index");
     }
     if (this.IsUserLogin())
     {
         HttpContext.Current.Response.Redirect(this.turl);
     }
     else if (HttpContext.Current.Session["oauth_name"] == null || HttpContext.Current.Session["oauth_access_token"] == null || HttpContext.Current.Session["oauth_openid"] == null)
     {
         HttpContext.Current.Response.Redirect(this.linkurl("error", (object)("?msg=" + Utils.UrlEncode("登录失败,用户授权已过期,请重新登录!"))));
     }
     else
     {
         Rain.Model.user_oauth model1 = new Rain.BLL.user_oauth().GetModel(HttpContext.Current.Session["oauth_name"].ToString(), HttpContext.Current.Session["oauth_openid"].ToString());
         if (model1 == null)
         {
             return;
         }
         Rain.Model.users model2 = new Rain.BLL.users().GetModel(model1.user_name);
         if (model2 == null)
         {
             HttpContext.Current.Response.Redirect(this.linkurl("error", (object)("?msg=" + Utils.UrlEncode("登录失败,授权用户不存在或已被删除!"))));
         }
         else
         {
             HttpContext.Current.Session["dt_session_user_info"] = (object)model2;
             HttpContext.Current.Session.Timeout = 45;
             Utils.WriteCookie("dt_cookie_user_name_remember", "Rain", model2.user_name);
             Utils.WriteCookie("dt_cookie_user_pwd_remember", "Rain", model2.password);
             model1.oauth_access_token = HttpContext.Current.Session["oauth_access_token"].ToString();
             new Rain.BLL.user_oauth().Update(model1);
             HttpContext.Current.Response.Redirect(this.turl);
         }
     }
 }
Exemple #8
0
 private void ShowInfo(int _id)
 {
     Rain.Model.users model = new Rain.BLL.users().GetModel(_id);
     this.ddlGroupId.SelectedValue = model.group_id.ToString();
     this.rblStatus.SelectedValue  = model.status.ToString();
     this.txtUserName.Text         = model.user_name;
     this.txtUserName.ReadOnly     = true;
     this.txtUserName.Attributes.Remove("ajaxurl");
     if (!string.IsNullOrEmpty(model.password))
     {
         this.txtPassword.Attributes["value"] = this.txtPassword1.Attributes["value"] = this.defaultpassword;
     }
     this.txtEmail.Text        = model.email;
     this.txtNickName.Text     = model.nick_name;
     this.txtAvatar.Text       = model.avatar;
     this.rblSex.SelectedValue = model.sex;
     if (model.birthday.HasValue)
     {
         this.txtBirthday.Text = model.birthday.GetValueOrDefault().ToString("yyyy-M-d");
     }
     this.txtTelphone.Text = model.telphone;
     this.txtMobile.Text   = model.mobile;
     this.txtQQ.Text       = model.qq;
     this.txtMsn.Text      = model.msn;
     this.txtAddress.Text  = model.address;
     this.txtAmount.Text   = model.amount.ToString();
     this.txtPoint.Text    = model.point.ToString();
     this.txtExp.Text      = model.exp.ToString();
     this.lblRegTime.Text  = model.reg_time.ToString();
     this.lblRegIP.Text    = model.reg_ip.ToString();
     Rain.Model.user_login_log lastModel = new Rain.BLL.user_login_log().GetLastModel(model.user_name);
     if (lastModel == null)
     {
         return;
     }
     this.lblLastTime.Text = lastModel.login_time.ToString();
     this.lblLastIP.Text   = lastModel.login_ip;
 }
Exemple #9
0
        private bool DoEdit(int _id)
        {
            bool flag = false;

            Rain.BLL.users   users = new Rain.BLL.users();
            Rain.Model.users model = users.GetModel(_id);
            model.group_id = int.Parse(this.ddlGroupId.SelectedValue);
            model.status   = int.Parse(this.rblStatus.SelectedValue);
            if (this.txtPassword.Text.Trim() != this.defaultpassword)
            {
                model.password = DESEncrypt.Encrypt(this.txtPassword.Text.Trim(), model.salt);
            }
            model.email     = Utils.DropHTML(this.txtEmail.Text);
            model.nick_name = Utils.DropHTML(this.txtNickName.Text);
            model.avatar    = Utils.DropHTML(this.txtAvatar.Text);
            model.sex       = this.rblSex.SelectedValue;
            DateTime result;

            if (DateTime.TryParse(this.txtBirthday.Text.Trim(), out result))
            {
                model.birthday = new DateTime?(result);
            }
            model.telphone = Utils.DropHTML(this.txtTelphone.Text.Trim());
            model.mobile   = Utils.DropHTML(this.txtMobile.Text.Trim());
            model.qq       = Utils.DropHTML(this.txtQQ.Text);
            model.msn      = Utils.DropHTML(this.txtMsn.Text);
            model.address  = Utils.DropHTML(this.txtAddress.Text.Trim());
            model.amount   = Utils.StrToDecimal(this.txtAmount.Text.Trim(), new Decimal(0));
            model.point    = Utils.StrToInt(this.txtPoint.Text.Trim(), 0);
            model.exp      = Utils.StrToInt(this.txtExp.Text.Trim(), 0);
            if (users.Update(model))
            {
                this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改用户信息:" + model.user_name);
                flag = true;
            }
            return(flag);
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Rain.Model.siteconfig siteconfig = new Rain.BLL.siteconfig().loadConfig();
            string  upper       = DTRequest.GetFormString("pay_order_no").ToUpper();
            Decimal formDecimal = DTRequest.GetFormDecimal("pay_order_amount", new Decimal(0));
            string  formString1 = DTRequest.GetFormString("pay_user_name");
            string  formString2 = DTRequest.GetFormString("pay_subject");
            string  empty1      = string.Empty;
            string  empty2      = string.Empty;
            string  str1        = string.Empty;
            string  empty3      = string.Empty;
            string  empty4      = string.Empty;

            if (string.IsNullOrEmpty(upper) || formDecimal == new Decimal(0))
            {
                this.Response.Redirect(new BasePage().linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,您提交的参数有误!"))));
            }
            else
            {
                string str2;
                string address;
                string telphone;
                string mobile;
                if (upper.StartsWith("R"))
                {
                    Rain.Model.user_recharge model1 = new Rain.BLL.user_recharge().GetModel(upper);
                    if (model1 == null)
                    {
                        this.Response.Redirect(new BasePage().linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,您充值的订单号不存在或已删除!"))));
                        return;
                    }
                    if (model1.amount != formDecimal)
                    {
                        this.Response.Redirect(new BasePage().linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,您充值的订单金额与实际金额不一致!"))));
                        return;
                    }
                    Rain.Model.users model2 = new Rain.BLL.users().GetModel(model1.user_id);
                    if (model2 == null)
                    {
                        this.Response.Redirect(new BasePage().linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,用户账户不存在或已删除!"))));
                        return;
                    }
                    str2     = model2.nick_name;
                    address  = model2.address;
                    telphone = model2.telphone;
                    mobile   = model2.mobile;
                }
                else
                {
                    Rain.Model.orders model = new Rain.BLL.orders().GetModel(upper);
                    if (model == null)
                    {
                        this.Response.Redirect(new BasePage().linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,您支付的订单号不存在或已删除!"))));
                        return;
                    }
                    if (model.order_amount != formDecimal)
                    {
                        this.Response.Redirect(new BasePage().linkurl("error", (object)("?msg=" + Utils.UrlEncode("对不起,您支付的订单金额与实际金额不一致!"))));
                        return;
                    }
                    str2     = model.accept_name;
                    address  = model.address;
                    str1     = model.post_code;
                    telphone = model.telphone;
                    mobile   = model.mobile;
                }
                string str3 = !(formString1 != "") ? "匿名用户" : "支付会员:" + formString1;
                if (Config.Type == "1")
                {
                    this.Response.Write(new Service().Create_direct_pay_by_user(new SortedDictionary <string, string>()
                    {
                        {
                            "payment_type",
                            "1"
                        },
                        {
                            "show_url",
                            siteconfig.weburl
                        },
                        {
                            "out_trade_no",
                            upper
                        },
                        {
                            "subject",
                            siteconfig.webname + "-" + formString2
                        },
                        {
                            "body",
                            str3
                        },
                        {
                            "total_fee",
                            formDecimal.ToString()
                        },
                        {
                            "paymethod",
                            ""
                        },
                        {
                            "defaultbank",
                            ""
                        },
                        {
                            "anti_phishing_key",
                            ""
                        },
                        {
                            "exter_invoke_ip",
                            DTRequest.GetIP()
                        },
                        {
                            "buyer_email",
                            ""
                        },
                        {
                            "royalty_type",
                            ""
                        },
                        {
                            "royalty_parameters",
                            ""
                        }
                    }));
                }
                else
                {
                    this.Response.Write(new Service().Create_partner_trade_by_buyer(new SortedDictionary <string, string>()
                    {
                        {
                            "payment_type",
                            "1"
                        },
                        {
                            "out_trade_no",
                            upper
                        },
                        {
                            "subject",
                            siteconfig.webname + "-" + formString2
                        },
                        {
                            "price",
                            formDecimal.ToString()
                        },
                        {
                            "quantity",
                            "1"
                        },
                        {
                            "logistics_fee",
                            "0.00"
                        },
                        {
                            "logistics_type",
                            "EXPRESS"
                        },
                        {
                            "logistics_payment",
                            "SELLER_PAY"
                        },
                        {
                            "body",
                            str3
                        },
                        {
                            "show_url",
                            siteconfig.weburl
                        },
                        {
                            "receive_name",
                            str2
                        },
                        {
                            "receive_address",
                            address
                        },
                        {
                            "receive_zip",
                            str1
                        },
                        {
                            "receive_phone",
                            telphone
                        },
                        {
                            "receive_mobile",
                            mobile
                        }
                    }));
                }
            }
        }