Ejemplo n.º 1
0
 public string GetUserName(string AccountId)
 {
     UserReg userRegBLL = new UserReg();
     XYECOM.Model.UserRegInfo userRegInfo = userRegBLL.GetItem(AccountId);
     if (userRegInfo == null)
         return "未知";
     return userRegInfo.LoginName + "/ " + userRegInfo.Email;
 }
Ejemplo n.º 2
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     String pwd = XYECOM.Core.SecurityUtil.MD5(this.txtpwd.Text, XYECOM.Configuration.Security.Instance.Md5value);
     XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();
     int num = userRegBLL.UpdatePassWord(XYECOM.Core.MyConvert.GetInt64(this.Request.QueryString["U_ID"].ToString()), pwd);
     if (num > 0)
     {
         this.libok.Text = "重设密码成功";
     }
     else
     {
         this.libok.Text = "重设密码失败";
     }
 }
Ejemplo n.º 3
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        Int64 uid = XYECOM.Core.MyConvert.GetInt64(this.Request.QueryString["U_ID"].ToString());

        XYECOM.Business.UserReg userreg = new XYECOM.Business.UserReg();
        XYECOM.Model.UserRegInfo euser = userreg.GetItem(uid);

        euser.Email = tdemail.Text.Trim();   //电子邮件
        euser.Answer = txtAnswer.Text.Trim();
        euser.Question = txtQuestion.Text.Trim();
        try
        {
            euser.RegDate = XYECOM.Core.MyConvert.GetDateTime(this.bgdate.Value); //注册时间
        }
        catch
        { }
        userreg.Update(euser);

        XYECOM.Business.UserInfo userinfo = new XYECOM.Business.UserInfo();
        XYECOM.Model.UserInfo info = userinfo.GetItem(uid);

        info.IM = txtIM.Text.Trim();

        info.LinkMan = tdrealname.Text.Trim(); //真实姓名
        info.Sex = tdsex.SelectedValue.Equals("1") ? true : false;//性别

        info.Mobile = tdmobil.Text.Trim(); //手机
        info.Section = tdsection.Text.Trim(); //所在部门
        info.Post = tdpost.Text.Trim();    //所任职位

        info.Name = companyname.Text.Trim(); //企业名称

        info.AreaId = XYECOM.Core.MyConvert.GetInt32(areatypeid.Value.ToString());
        info.Telephone = txtTelephone.Text.Trim();
        info.Fax = txtFax.Text.Trim();
        info.Postcode = tdpostcode.Text; //邮政编码
        info.HomePage = tdhomepage.Text.Trim(); //企业网址
        info.Address = tdlinkadress.Text.Trim(); //联系地址
        info.Character = tdcharacter.Text.Trim(); //企业性质

        info.UserTypeId = XYECOM.Core.MyConvert.GetInt64(companyid.Value.ToString());
        //info.U_SupplyProduct = tdsupply.Text.Trim(); //提供的产品.服务
        info.BuyPro = tdbuy.Text.Trim(); //需要的产品/服务

        info.RegisteredCapital = XYECOM.Core.MyConvert.GetDecimal(tdmoney.Text.Trim());//注册资金

        if (this.tdumode.SelectedValue != "")
        {
            info.Mode = "";
            for (int i = 0; i < tdumode.Items.Count; i++)
            {
                if (tdumode.Items[i].Selected)
                {
                    info.Mode += tdumode.Items[i].Text + ",";
                }
            }
            info.Mode = info.Mode.Substring(0, info.Mode.Length - 1);  //经营模式
        }

        info.RegYear = XYECOM.Core.MyConvert.GetInt32(lbyear.Text.Trim()); //注册时间
        info.BusinessAddress = lbarea.Text.Trim(); //主要经营地点
        info.RegAreaId = XYECOM.Core.MyConvert.GetInt32(lbaddress.Value.Trim()); //企业注册地
        //info.U_PType = tdptype.Text.Trim(); //主营产品/服务
        info.MainProduct = tdsupply.Text.Trim();
        info.EmployeeTotal = lbnumber.Text.Trim(); //企业人数
        info.Synopsis = tdsynopsis.Text.Trim(); //企业简介
        if (userinfo.Update(info) > 0)
            Alert("修改成功!", backURL);
        else
            Alert("发生错误,修改失败!");
    }
Ejemplo n.º 4
0
    private void BindData(Int64 uid)
    {
        string moneyformat = "n"; //货币转换格式

        XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();
        XYECOM.Model.UserRegInfo userRegInfo = new XYECOM.Model.UserRegInfo();
        userRegInfo = userRegBLL.GetItem(uid);
        if (!object.Equals(null, userRegInfo))
        {
            this.tdusername.Text = userRegInfo.LoginName; //用户名
            this.tdemail.Text = userRegInfo.Email;   //电子邮件
            this.bgdate.Value = userRegInfo.RegDate.ToShortDateString(); //注册时间
            txtQuestion.Text = userRegInfo.Question;
            txtAnswer.Text = userRegInfo.Answer;
        }
        else
        {
            Alert("该会员信息有误,请重新选择.", backURL);
        }

        XYECOM.Business.UserInfo userInfoBLL = new XYECOM.Business.UserInfo();
        XYECOM.Model.UserInfo userInfo = new XYECOM.Model.UserInfo();
        userInfo=userInfoBLL.GetItem(uid);
        if (!object.Equals(null, userInfo))
        {
            this.tdrealname.Text = userInfo.LinkMan; //真实姓名
            if (userInfo.Sex == true)                     //性别
                this.tdsex.Text = "1";
            else
                this.tdsex.Text = "0";

            tdIM.InnerHtml = XYECOM.Configuration.FreeCode.Instance.IM.Name + ":";
            txtIM.Text = userInfo.IM;
            this.tdmobil.Text = userInfo.Mobile; //手机
            this.tdsection.Text = userInfo.Section; //所在部门
            this.tdpost.Text = userInfo.Post;    //所任职位

            this.companyname.Text = userInfo.Name; //企业名称

            areatypeid.Value = userInfo.AreaId.ToString();
            txtTelephone.Text = userInfo.Telephone;
            txtFax.Text = userInfo.Fax;
            this.tdpostcode.Text = userInfo.Postcode; //邮政编码
            this.tdhomepage.Text = userInfo.HomePage.Trim(); //企业网址
            this.tdlinkadress.Text = userInfo.Address; //联系地址
            this.tdcharacter.Text = userInfo.Character; //企业性质

            companyid.Value = userInfo.UserTypeId.ToString();
            //this.tdsupply.Text = userInfo.U_SupplyProduct; //提供的产品.服务

            this.tdsupply.Text = userInfo.MainProduct;
            this.tdbuy.Text = userInfo.BuyPro; //需要的产品/服务

            if (userInfo.RegisteredCapital.ToString() != "")
                this.tdmoney.Text = Convert.ToDecimal(userInfo.RegisteredCapital).ToString(moneyformat);
            else
                this.tdmoney.Text = userInfo.Mode;     //注册资金

            this.tdmoneytype.Text = userInfo.MoneyType; //注册资金类别

            tdumode.DataSource = new XYECOM.Business.Mode().GetDataTable();
            tdumode.DataTextField = "M_Type";
            tdumode.DataValueField = "M_Type";
            tdumode.DataBind();

            string[] modes = userInfo.Mode.Split(',');

            foreach (string s in modes)
            {
                for (int i = 0; i < tdumode.Items.Count; i++)
                {
                    if (tdumode.Items[i].Value.Equals(s))
                    {
                        tdumode.Items[i].Selected = true;
                        break;
                    }
                }
            }

            this.lbyear.Text = userInfo.RegYear.ToString(); //注册时间
            this.lbarea.Text = userInfo.BusinessAddress; //主要经营地点
            this.lbaddress.Value = userInfo.RegAreaId.ToString(); //企业注册地
            //this.tdptype.Text = userInfo.U_PType; //主营产品/服务
            this.lbnumber.Text = userInfo.EmployeeTotal; //企业人数
            this.tdsynopsis.Text = userInfo.Synopsis; //企业简介

        }
        else
        {
            Alert("该会员信息有误,请重新选择.", backURL);
        }
    }
Ejemplo n.º 5
0
        private void VisitorMessasge()
        {
            string strMsg = "";
            string toemail = "";

            string userId = XYECOM.Core.XYRequest.GetQueryString("uids");

            long _UserID = XYECOM.Core.MyConvert.GetInt64(userId);
            int infoId = 0;
            #region 游客留言

            if (XYECOM.Configuration.Security.Instance.IsEnabledValidateCode(XYECOM.Configuration.ValidateCodeItem.Message))
            {
                if (!CheckCode(F("GCode").ToString()))
                {
                    strMsg = "codeErr";
                    ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
                }
            }

            XYECOM.Business.Message messageBLL = new XYECOM.Business.Message();
            XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();
            XYECOM.Model.UserRegInfo userRegInfo = null;
            infoId = XYECOM.Core.MyConvert.GetInt32(XYECOM.Core.XYRequest.GetQueryString("ids"));

            if (_UserID > 0)
            {
                userRegInfo = userRegBLL.GetItem(_UserID);

                if (userRegInfo != null)
                {
                    toemail = userRegInfo.Email;
                }
                else
                {
                    if (infoId > 0)
                    {
                        XYECOM.Model.SupplyInfo supplyInfo = new XYECOM.Business.Supply().GetItem(infoId);

                        if (supplyInfo != null)
                            userRegInfo = userRegBLL.GetItem(supplyInfo.UserID);

                        if (userRegInfo != null)
                        {
                            toemail = userRegInfo.Email.ToString();
                            _UserID = supplyInfo.UserID;
                        }
                    }
                }
            }
            XYECOM.Model.MessageInfo messageInfo = new XYECOM.Model.MessageInfo();
            messageInfo.M_UserName = XYECOM.Core.Utils.RemoveHTML(F("linkman")); //联系人
            messageInfo.M_Email = XYECOM.Core.Utils.RemoveHTML(F("email"));//电子邮件
            messageInfo.M_Moblie = XYECOM.Core.Utils.RemoveHTML(F("mobile"));//手机
            messageInfo.M_Title = XYECOM.Core.Utils.IsLength(40, XYECOM.Core.Utils.RemoveHTML(F("title")));//留言标题
            messageInfo.M_Content = XYECOM.Core.Utils.IsLength(400, XYECOM.Core.Utils.RemoveHTML(F("neirong")));//留言内容
            messageInfo.M_SenderType = F("type");
            messageInfo.M_Sex = false;
            messageInfo.U_ID = 0;
            messageInfo.M_UserType = false;
            messageInfo.M_RecverType = "";
            messageInfo.InfoId = infoId;
            string sexStr = "女士";

            if (F("sex") == "1")
            {
                messageInfo.M_Sex = true;
                sexStr = "先生";
            }

            if (_UserID > 0) messageInfo.UR_ID = _UserID;

            //这块有问题  因为客户端传递的变量usertype永远为1
            //个人认为应该根据选择企业或者个人值有所不同
            //if (F("usertype") == "1") messageInfo.M_UserType = true; //收到留言者类型
            messageInfo.M_UserType = true;

            int result = messageBLL.Insert(messageInfo);

            if (result >= 0)
            {

                string[] dLabel = new string[] {
                    messageInfo.M_Title,
                    messageInfo.M_Content,
                    "<ul><li>姓名:"+messageInfo.M_UserName+" " + sexStr+"</li><li>邮箱:"+messageInfo.M_Email+"</li><li>电话:"+messageInfo.M_Moblie+"</li></ul>",
                    webInfo.WebDomain,
                    webInfo.WebName
                };
                string[] sLabel = new string[] { "{$Title$}", "{$Body$}", "{$Contacts$}", "{$WebUrl$}", "{$WebName$}" };

                XYECOM.Business.Utils.SendMail(toemail, messageInfo.M_Title, XYECOM.Core.TemplateEmail.GetContent(dLabel, sLabel, "/templateEmail/Enquiry.htm"));

                XYECOM.Core.Utils.ClearSession("VNum");

                strMsg = "ok";
            }
            else
            {
                strMsg = "err";
            }

            ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
            #endregion
        }
Ejemplo n.º 6
0
        private void RetakePassword(string temp)
        {
            string email = XYECOM.Core.XYRequest.GetQueryString("email");

            if (email == "")
            {
                ResponseXML(Result.Null, "数据不完整!");
            }

            int _result = new XYECOM.Business.UserReg().RetakePassWord(email);

            //1:成功,0:邮箱不能为空,-1:邮箱不存在,-2:重设密码失败,-3:异常失败

            if (_result == 1) ResponseXML(Result.Success, "密码已发到邮箱");

            if (_result == 0) ResponseXML(Result.Null, "邮箱不能为空");

            if (_result == -1) ResponseXML(Result.Failed, "邮箱不存在,请输入注册邮箱");

            if (_result == -2) ResponseXML(Result.Failed, "重设密码失败,请稍候再试");

            if (_result == -3) ResponseXML(Result.Failed, "异常失败");
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 重设密码
        /// </summary>
        private void RetakePassword()
        {
            string userName = XYECOM.Core.XYRequest.GetQueryString("userName");
            string question = XYECOM.Core.XYRequest.GetQueryString("question");
            string answer = XYECOM.Core.XYRequest.GetQueryString("answer");
            string newPwd = XYECOM.Core.XYRequest.GetQueryString("newPwd");

            if (userName == "" || question == "" || answer == "" || newPwd == "")
            {
                ResponseXML(Result.Null, "数据不完整!");
            }

            int _result = new XYECOM.Business.UserReg().RetakePassWord(userName, XYECOM.Core.SecurityUtil.MD5(newPwd, XYECOM.Configuration.Security.Instance.Md5value), question, answer);

            string message = "";
            Result result = Result.Failed;

            if (_result == -2)
            {
                message = "重置失败!请重新尝试!";
            }

            if (_result == -1)
            {
                message = "密码提示问题或密码提示答案错误!";
            }

            if (_result == 1)
            {
                result = Result.Success;
                message = "重置密码成功!";
            }

            ResponseXML(result, message);
        }
Ejemplo n.º 8
0
        //登录
        private void Login()
        {
            string name = XYECOM.Core.XYRequest.GetQueryString("Name").Trim();
            string pwd = XYECOM.Core.XYRequest.GetQueryString("Pwd").Trim();
            string code = XYECOM.Core.XYRequest.GetQueryString("Code").Trim();
            string isSave = XYECOM.Core.XYRequest.GetQueryString("IsSave").Trim();
            string page = XYECOM.Core.XYRequest.GetQueryString("Page").Trim().ToLower();

            if (name.Equals("") || pwd.Equals(""))
            {
                ResponseXML(Result.Null, "信息不完整!");
            }

            //如果启用验证
            if (XYECOM.Configuration.Security.Instance.IsEnabledValidateCode(XYECOM.Configuration.ValidateCodeItem.Login))
            {
                if (!CheckCode(code))
                {
                    ResponseXML(Result.Failed, "验证码不正确!");
                    return;
                }
            }

            XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();

            XYECOM.Model.UserRegInfo userInfo = userRegBLL.Login(name, pwd, isSave != "");

            if (userInfo == null)
            {
                ResponseXML(Result.Failed, "用户名或密码有误!");
            }

            string strUserType = "user";

            string message = "";
            if (page.Equals("infologin")) message = "ok";

            string xmlUserInfo = "<userinfo>"
                                + "<userid>" + userInfo.UserId + "</userid>"
                                + "<loginname>" + userInfo.LoginName + "</loginname>"
                                + "<mark>" + userInfo.Mark + "</mark>"
                                + "<usertype>" + strUserType + "</usertype>"
                                + "</userinfo>";
            //登录成功合并购物车信息
            XYECOM.Model.GeneralUserInfo gernerUserInfo = Business.CheckUser.UserInfo;

            ResponseXML(Result.Success, message, xmlUserInfo);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 检查用户名是否存在
        /// 
        /// 返回值:
        /// -1,用户名为空
        /// 0,不存在,可以使用
        /// 1,已经存在
        /// 2,禁止使用的名称
        /// </summary>
        private void IsExistsUserByName()
        {
            string name = XYECOM.Core.XYRequest.GetQueryString("name").Trim().ToLower();

            if (name.Equals("")) ResponseXML(Result.Failed, "数据不完整");

            if (webInfo.ForbidName != "")
            {
                string[] names = webInfo.ForbidName.Split(',');

                for (int j = 0; j < names.Length; j++)
                {
                    if (name.Equals(names[j].ToLower()))
                    {
                        ResponseXML(Result.Failed, "此用户名不允许注册");
                        break;
                    }
                }
            }

            Business.UserReg userRegBLL = new XYECOM.Business.UserReg();
            if (userRegBLL.IsExistTheUserName(name))
            {
                Model.UserRegInfo userRegInfo = userRegBLL.GetItem(name);

                ResponseXML(Result.Failed, "此用户名已被注册,请选择其他用户名", "<question>" + userRegInfo.Question + "</question>");
            }

            ResponseXML(Result.Success, "验证通过");
        }
Ejemplo n.º 10
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        XYECOM.Business.Log l = new XYECOM.Business.Log();
        XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo();
        XYECOM.Business.UserReg ur = new XYECOM.Business.UserReg();

        string ids = "";

        foreach (GridViewRow GR in this.gvlist.Rows)
        {
            if (((CheckBox)(GR.FindControl("chkExport"))).Checked == true)
            {
                ids += "," + this.gvlist.DataKeys[GR.DataItemIndex].Value.ToString();
            }
        }

        if (ids.IndexOf(",") == 0)
        {
            ids = ids.Substring(1);
            int i = 0;
            i = ur.Delete(ids);
            if (i >= 0)
            {
                el.L_Title = "用户管理";
                el.L_Content = "删除用户信息成功";
                el.L_MF = "用户管理";
                el.UM_ID = AdminId;
                l.Insert(el);
                BindData();
            }
            else
            {
                el.L_Title = "用户管理";
                el.L_Content = "删除用户信息失败";
                el.L_MF = "用户管理";
                el.UM_ID = AdminId;
                l.Insert(el);
                Alert("删除失败!");
            }
        }
    }
Ejemplo n.º 11
0
        private void gvDataBind()
        {
            //设置编辑或查看评论后要返回当前页面的状态
            backURL = XYECOM.Core.Utils.JSEscape(
            "LogUserbehavior.aspx?Page1=" + Page1.CurPage.ToString() +
            "&txtname=" + txtname.Text.Trim() +
            "&DDLoperate=" + DDLoperate.SelectedValue +
            "&bgdate=" + bgdate.Value +
            "&egdate=" + egdate.Value
            );

            string strOrder = " order by AccountId desc";
            this.lblMessage.Text = "";
            string strTableName = "XY_AccountDetails";
            string strWhere = " where 1=1";
            string begindate = this.bgdate.Value;
            string enddate = this.egdate.Value;
            string Operate = this.DDLoperate.SelectedValue;

            if (Operate == "-1" || Operate == "")
            {
                strWhere += " and (Operate=" + (int)XYECOM.Model.AccountOperate.ContractMargin;
                strWhere += " or Operate=" + (int)XYECOM.Model.AccountOperate.InputMoney;
                strWhere += " or Operate=" + (int)XYECOM.Model.AccountOperate.PayContractMargin;
                strWhere += " or Operate=" + (int)XYECOM.Model.AccountOperate.PayOrders;
                strWhere += " or Operate=" + (int)XYECOM.Model.AccountOperate.PaySupMargin;
                strWhere += ")";
            }
            else
            {
                strWhere += " and Operate=" + XYECOM.Core.MyConvert.GetInt32(Operate);
            }

            if (begindate != "")
            {
                strWhere += " and (OperateDate > '" + begindate + "') ";
            }

            if (enddate != "")
            {
                strWhere += " and (OperateDate < '" + XYECOM.Core.MyConvert.GetDateTime(enddate).AddDays(1) + "') ";
            }

            if (this.txtname.Text != "")
            {
                UserReg userRegBLL = new UserReg();
                XYECOM.Model.UserRegInfo userRegInfo = userRegBLL.GetItem(this.txtname.Text.Trim());

                strOrder = "order by OperateDate desc";
                if (userRegInfo != null)
                {
                    strWhere += " and AccountId=" + userRegInfo.AccountId;
                }
                else
                {
                    strWhere += " and AccountId=0";
                }
            }
            this.Page1.RecTotal = Function.GetRows(strTableName, "ID", strWhere);
            DataTable dt = Function.GetPages(this.Page1.PageSize, this.Page1.CurPage, strWhere, strOrder, strTableName, " * ", "ID");
            if (dt.Rows.Count > 0)
            {
                this.gvlist.DataSource = dt;
                this.gvlist.DataBind();
            }
            else
            {
                this.lblMessage.Text = "没有相关信息";
                this.gvlist.DataBind();
            }
        }
Ejemplo n.º 12
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        long userId = XYECOM.Core.MyConvert.GetInt64(this.U_ID.Value);

        int i = NotPassAudit("u_user", userId, this.tbA_Reason.Text.Trim(), this.tbA_Advice.Text.Trim());

        XYECOM.Business.UserReg ur = new XYECOM.Business.UserReg();
        XYECOM.Business.UserFictitiouCount uft = new XYECOM.Business.UserFictitiouCount();

        #region 审核成功
        if (i > 0)
        {
            //给用户留言
            if (userId > 0)
            {
                SendMessage(userId, "企业信息审核", "企业信息审核未通过原因:" + this.tbA_Advice.Text);
            }

            //给用户发短信
            if (this.Email.Value != "")
            {
                SendEmail(this.lbcompanyname.InnerHtml, this.Email.Value);
            }
            //个人资料
            XYECOM.Business.FaithSet fs = new XYECOM.Business.FaithSet();
            DataTable dt = fs.GetDataTable();

            if (rbcommonerror.Checked == true)//普通错误扣除的诚信指数和UU币
            {
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["GF_ErrMoney"].ToString() != "")//扣除UU币
                    {
                        uft.DeductUserUUFictitiouCount(Convert.ToInt64(this.U_ID.Value), Convert.ToInt32(dt.Rows[0]["GF_ErrMoney"].ToString()));
                    }
                    if (dt.Rows[0]["GF_ErrFath"].ToString() != "")// 扣除诚信指数
                    {
                        ur.DeductFaithMongy(Convert.ToInt64(this.U_ID.Value), Convert.ToInt32(dt.Rows[0]["GF_ErrFath"].ToString()));
                    }
                }

            }
            else if (rbgravenesserror.Checked == true)//恶意错误扣除的诚信指数和UU币
            {
                if (dt.Rows.Count > 0)
                {

                    if (dt.Rows[0]["GF_Fath"].ToString() != "")
                    {
                        ur.DeductFaithMongy(Convert.ToInt64(this.U_ID.Value), Convert.ToInt32(dt.Rows[0]["GF_Fath"].ToString()));
                    }
                    if (dt.Rows[0]["GF_Money"].ToString() != "")
                    {
                        uft.DeductUserUUFictitiouCount(Convert.ToInt64(this.U_ID.Value), Convert.ToDecimal(dt.Rows[0]["GF_Money"].ToString()));
                    }
                }
                ur.AddUserMaliceErr(Convert.ToInt64(this.U_ID.Value), 1);//恶意处罚的次数
            }
            Alert("操作成功!", Request.Url.PathAndQuery);
        }
        #endregion
        else
        {
            Alert("操作失败!", Request.Url.PathAndQuery);
        }
    }