예제 #1
0
        private void Enter(long userId)
        {
            Logout();

            XYECOM.Model.UserRegInfo userInfo = new Business.UserReg().GetItem(userId);

            if (userInfo == null) return;

            XYECOM.Core.Utils.WriteCookie("U_ID", userInfo.UserId.ToString(),webInfo.CookieDomain);

            //---------------------��Cookie--------------------------------------
            XYECOM.Core.Utils.WriteCookie("UserId", userInfo.UserId.ToString(), webInfo.CookieDomain);
            //�û�������
            XYECOM.Core.Utils.WriteCookie("UserGradeId", userInfo.GradeId.ToString(), webInfo.CookieDomain);
            //---------------------------------------------------------------------

            string strUserType = "user";

            XYECOM.Core.Utils.WriteCookie("U_Name", userInfo.LoginName.ToString(), webInfo.CookieDomain);
            XYECOM.Core.Utils.WriteCookie("UserName", userInfo.LoginName.ToString(), webInfo.CookieDomain);
            XYECOM.Core.Utils.WriteCookie("PassWord", userInfo.Password, webInfo.CookieDomain);
            XYECOM.Core.Utils.WriteCookie("UserType", strUserType, webInfo.CookieDomain);

            Response.Redirect(webInfo.WebDomain + "user/index." + webInfo.WebSuffix);
        }
예제 #2
0
파일: UserInfo.cs 프로젝트: xyecom/AMS
        /// <summary>
        /// �����û�����ȡ�û���Ϣ
        /// </summary>
        /// <param name="username">�û�����</param>
        /// <returns>ʵ�����</returns>
        public XYECOM.Model.UserInfo GetItem(string username)
        {
            Model.UserRegInfo regInfo = new Business.UserReg().GetItem(username);

            if (regInfo == null) return null;

            return GetItem(regInfo.UserId);
        }
예제 #3
0
파일: PartList.aspx.cs 프로젝트: xyecom/AMS
        protected override void BindData()
        {
            XYECOM.Business.UserReg regBll = new Business.UserReg();
            DataTable table = regBll.GetPartList(userinfo.CompanyId);

            this.rptPartList.DataSource = table;
            this.rptPartList.DataBind();
        }
예제 #4
0
파일: PartList.aspx.cs 프로젝트: xyecom/AMS
        protected void lbtnStatus_Click(object sender, EventArgs e)
        {
            XYECOM.Business.UserReg regBll = new Business.UserReg();

            LinkButton lbtn = sender as LinkButton;

            string ca = lbtn.CommandArgument;

            string[] ids = ca.Split(new char[] { '|' });

            regBll.UpdatePartState(ids[0], ids[1]);

            BindData();
        }
예제 #5
0
        protected override void BindData()
        {
            this.lblMessage.Text = "";
            long userId = Core.XYRequest.GetQueryInt64("userId");
            DataTable dt = new Business.UserReg().GetPartList(userId);
            lblCompanyName.Text = new XYECOM.Business.UserInfo().GetItem(userId).Name;

            if (dt.Rows.Count > 0)
            {
                this.gvlist.DataSource = dt;
                this.gvlist.DataBind();
            }
            else
            {
                this.lblMessage.Text = "没有相关信息记录";
                this.gvlist.DataBind();
            }
        }
예제 #6
0
파일: XYAjax.ashx.cs 프로젝트: xyecom/AMS
        private void UserMessage()
        {
            string strMsg = "";

            string content = XYECOM.Core.Utils.IsLength(100, XYECOM.Core.XYRequest.GetQueryString("content"));
            string code = XYECOM.Core.XYRequest.GetQueryString("code");
            string title = XYECOM.Core.Utils.IsLength(50, XYECOM.Core.XYRequest.GetQueryString("title"));
            string type = XYECOM.Core.XYRequest.GetQueryString("type");
            string ids = XYECOM.Core.XYRequest.GetQueryString("ids");
            string uids = XYECOM.Core.XYRequest.GetQueryString("uids");

            if (content.Equals("") || title.Equals("") || ids.Equals("") || uids.Equals(""))
            {
                strMsg = "-1";
            }
            else if (!Business.CheckUser.CheckUserLogin())
            {
                strMsg = "nologin";
            }
            else
            {
                if (Business.CheckUser.UserInfo.userid.ToString() == uids)
                {
                    strMsg = "nomessage";
                }
            }

            if (XYECOM.Configuration.Security.Instance.IsEnabledValidateCode(XYECOM.Configuration.ValidateCodeItem.Message))
            {
                if (!CheckCode(code))
                {
                    strMsg = "codeErr";
                }
            }

            if (!strMsg.Equals(""))
            {
                ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
            }

            //当前登录用户ID
            long loginUserId = Business.CheckUser.UserInfo.userid;
            //当前信息发布者ID
            long infoUserId = Convert.ToInt64(uids);

            string toEmail = new Business.UserReg().GetItem(infoUserId).Email;
            long infoId = XYECOM.Core.MyConvert.GetInt64(ids);

            #region 企业会员留言
            XYECOM.Business.UserInfo userInfoBLL = new XYECOM.Business.UserInfo();

            XYECOM.Model.UserInfo userInfo = userInfoBLL.GetItem(loginUserId);

            if (userInfo != null)
            {
                XYECOM.Model.MessageInfo messageInfo = new XYECOM.Model.MessageInfo();

                messageInfo.M_Adress = userInfo.Address;
                messageInfo.M_Content = XYECOM.Core.Utils.RemoveHTML(content);
                messageInfo.M_Email = userInfo.RegInfo.Email.ToString();
                messageInfo.M_FHM = userInfo.Fax.ToString();
                messageInfo.M_HasReply = false;
                messageInfo.M_Moblie = userInfo.Mobile.ToString();
                messageInfo.M_PHMa = userInfo.Telephone;
                messageInfo.M_Adress = userInfo.Address.ToString();
                messageInfo.M_RecverType = "";
                messageInfo.M_SenderType = type;
                messageInfo.M_Title = XYECOM.Core.Utils.RemoveHTML(title);
                messageInfo.UR_ID = infoUserId;
                messageInfo.M_UserName = userInfo.LinkMan;
                messageInfo.M_UserType = false;
                messageInfo.U_ID = loginUserId;
                messageInfo.M_CompanyName = userInfo.Name.ToString();
                messageInfo.M_Sex = userInfo.Sex;
                messageInfo.Area_ID = userInfo.AreaId;
                messageInfo.InfoId = infoId;

                string sexStr = "女士";

                if (userInfo.Sex) sexStr = "先生";

                int result = new XYECOM.Business.Message().Insert(messageInfo);
                if (result >= 0)
                {

                    string[] dLabel = new string[] {
                    messageInfo.M_Title,
                    messageInfo.M_Content,
                    "<ul><li>姓名:"+messageInfo.M_UserName+" " + sexStr+"("+messageInfo.M_CompanyName+")</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";
                }
            }
            #endregion

            ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
        }
예제 #7
0
파일: Register.aspx.cs 프로젝트: xyecom/AMS
        protected void btnReg_Click(object sender, EventArgs e)
        {
            string loginName = string.Empty;
            string companyName = string.Empty;
            string pwd = string.Empty;
            int areaId = Core.MyConvert.GetInt32(this.city.Value.Trim());
            string email = string.Empty;
            string chief = string.Empty;
            int selIndex = this.MultiView1.ActiveViewIndex;
            Model.UserType userType = XYECOM.Model.UserType.CreditorEnterprise;
            loginName = txtUserName.Text.Trim();
            pwd = txtPwd1.Text.Trim();
            email = txtEmail.Text.Trim();

            switch (selIndex + 1)
            {
                case 1:

                    userType = XYECOM.Model.UserType.CreditorEnterprise;
                    companyName = this.txtCompanyName.Text.Trim();

                    chief = this.txtCompanyChief.Text.Trim();
                    break;
                case 2:
                    userType = XYECOM.Model.UserType.CreditorIndividual;
                    break;
                case 3:
                    userType = XYECOM.Model.UserType.Layer;
                    companyName = this.txtLawyerCompanyName.Text.Trim();
                    break;
                case 4:
                    userType = XYECOM.Model.UserType.NotLayer;
                    break;
            }

            Model.UserRegInfo regInfo = new XYECOM.Model.UserRegInfo();

            regInfo.LoginName = loginName;
            regInfo.Password = Core.SecurityUtil.MD5(pwd, XYECOM.Configuration.Security.Instance.Md5value);
            regInfo.Email = email;
            regInfo.RegDate = DateTime.Now;
            regInfo.UserType = (int)userType;
            regInfo.AreaId = areaId;
            regInfo.Answer = string.Empty;
            regInfo.Question = string.Empty;
            regInfo.IsPrimary = true;

            XYECOM.Model.UserInfo userInfo = new XYECOM.Model.UserInfo();
            userInfo.Email = email;
            userInfo.AreaId = areaId;
            userInfo.Name = companyName;
            userInfo.LinkMan = chief;

            userInfo.Address = string.Empty;
            userInfo.Address = string.Empty;
            userInfo.BuyPro = string.Empty;
            userInfo.License = string.Empty;
            userInfo.Character = string.Empty;
            userInfo.EmployeeTotal = string.Empty;
            userInfo.HomePage = string.Empty;
            userInfo.Synopsis = string.Empty;
            userInfo.Postcode = string.Empty;
            //userInfo.RegAreaId
            userInfo.Mobile = string.Empty;
            //userInfo.UserTypeId
            userInfo.Sex = true;
            userInfo.Section = string.Empty;
            userInfo.Post = string.Empty;
            userInfo.SupplyOrBuy = 3;
            userInfo.SupplyPro = string.Empty;
            userInfo.BuyPro = string.Empty;
            userInfo.Mode = string.Empty;
            userInfo.RegisteredCapital = decimal.Zero;
            userInfo.RegYear = 1;
            userInfo.Address = string.Empty;
            userInfo.MainProduct = string.Empty;
            userInfo.MoneyType = string.Empty;
            userInfo.IM = string.Empty;
            userInfo.Telephone = string.Empty;
            userInfo.Fax = string.Empty;
            userInfo.TradeIds = string.Empty;

            long userId = 0;

            string message = string.Empty;

            Model.ResisterUserReturnValue value = new Business.UserReg().Register(regInfo, userInfo, pwd, out userId);

            if (value == XYECOM.Model.ResisterUserReturnValue.UserNameExists)
                message = "注册失败,用户名已经被占用";

            if (value == XYECOM.Model.ResisterUserReturnValue.EmailExists)
                message = "注册失败,邮箱已经被占用";

            if (value == XYECOM.Model.ResisterUserReturnValue.Failed)
                message = "注册失败,异常错误,请检查各项数据";

            if (value == XYECOM.Model.ResisterUserReturnValue.ForbidName)
                message = "注册失败,此用户名禁止注册";

            if (!string.IsNullOrEmpty(message))
            {
                GotoMsgBoxPageForDynamicPage(message, 5, "/register.aspx");
                return;
            }

            string gotoUrl = "";

            if (userType == XYECOM.Model.UserType.CreditorEnterprise || userType == Model.UserType.CreditorIndividual)
            {
                gotoUrl = "/Creditor/index.aspx";
            }
            else
            {
                gotoUrl = "Server/index.aspx";
            }

            message = "注册成功,系统将自动进入会员中心...";

            GotoMsgBoxPageForDynamicPage(message, 1, gotoUrl);
        }