Beispiel #1
0
    /// <summary>
    /// 绑定页面数据
    /// </summary>
    private void BindData()
    {
        if (!Tools.Validator.IsPositiveInt(q("id")) || Tools.RequestCheck.CheckKeyWord(q("id")))
        {
            FinalMessage("URL解析错误,请勿在Url中添加非法关键词!", "Manage_Member.aspx", 1);
        }

        modelUser = bulUser.GetModel(int.Parse(q("id")));
        if (modelUser != null)
        {
            this.txtUserName.Value = modelUser.userName.ToString();
            this.hidName.Value     = modelUser.userName.ToString();
            this.txtTrueName.Value = modelUser.trueName.ToString();
            Tools.WebControl.SeRadioButtonList(this.rbSex, (modelUser.sex == true ? "1" : "0"));
            string pro  = modelUser.province;
            string city = modelUser.city;
            GetCity(pro, city);
            this.hidProvince.Value = pro;
            this.hidCity.Value     = city;
            Tools.WebControl.SetSelectedListByText(this.ddlProcince, pro);
            isbenuessTag = modelUser.isBusiness == true ? "1" : "0";
            Tools.WebControl.SeRadioButtonList(this.rbIsBusiness, isbenuessTag);
            this.txtRegistNumber.Value = modelUser.registNumber.ToString();
            this.txtDepartment.Value   = modelUser.department.ToString();
            this.txtPosition.Value     = modelUser.position.ToString();
            this.txtPhone.Value        = modelUser.phone.ToString();
            this.txtAddress.Value      = modelUser.address.ToString();
        }
    }
Beispiel #2
0
    /// <summary>
    /// 新增会员
    /// </summary>
    protected void btnSend_Click(object sender, EventArgs e)
    {
        string _userName = this.txtUserName.Value.Trim();
        DataSet temds = common.GetList(" select [userName] FROM tb_sys_userinfo where [userName]='" + _userName + "' ");
        if (Tools.Validator.CheckDataSet(temds, 0))
            FinalMessage("此账号已经存在,请更换!", "Add_Member.aspx", 1);

        Test_Model.sys_userinfo modelUser = new Test_Model.sys_userinfo();
        modelUser.userName = _userName;
        modelUser.password = EncryptAdmin(this.txtPassword.Value.Trim());
        modelUser.trueName = this.txtTrueName.Value.Trim();
        modelUser.currentScore = 30;//暂用,待改
        modelUser.totalScore = 30;//暂用,待改
        modelUser.sex = Tools.StringHelp.GetInt(this.rbSex.SelectedValue) == 1 ? true : false;
        modelUser.province = this.hidProvince.Value;
        modelUser.city = this.hidCity.Value;
        modelUser.isBusiness = Tools.StringHelp.GetInt(this.rbIsBusiness.SelectedValue) == 1 ? true : false;
        modelUser.registNumber = this.txtRegistNumber.Value.Trim();
        modelUser.department = this.txtDepartment.Value.Trim();
        modelUser.position = this.txtPosition.Value.Trim();
        modelUser.phone = this.txtPhone.Value.Trim();
        modelUser.address = Tools.StringHelp.CutStirngNormal(this.txtAddress.Value.Trim(), 100, 1);
        modelUser.addTime = DateTime.Now;

        Test_BUL.sys_userinfo bulUser = new Test_BUL.sys_userinfo();
        if (bulUser.Add(modelUser) > 0)
            Response.Redirect("Manage_Member.aspx");
        else
            FinalMessage("保存失败!", "Add_Member.aspx", 1);
    }
Beispiel #3
0
    /// <summary>
    /// 绑定页面数据
    /// </summary>
    private void BindData()
    {
        if (!Tools.Validator.IsPositiveInt(q("id")) || Tools.RequestCheck.CheckKeyWord(q("id")))
            FinalMessage("URL解析错误,请勿在Url中添加非法关键词!", "Manage_Member.aspx", 1);

        modelUser = bulUser.GetModel(int.Parse(q("id")));
        if (modelUser != null)
        {
            this.txtUserName.Value = modelUser.userName.ToString();
            this.hidName.Value = modelUser.userName.ToString();
            this.txtTrueName.Value = modelUser.trueName.ToString();
            Tools.WebControl.SeRadioButtonList(this.rbSex, (modelUser.sex == true ? "1" : "0"));
            string pro = modelUser.province;
            string city = modelUser.city;
            GetCity(pro, city);
            this.hidProvince.Value = pro;
            this.hidCity.Value = city;
            Tools.WebControl.SetSelectedListByText(this.ddlProcince, pro);
            isbenuessTag = modelUser.isBusiness == true ? "1" : "0";
            Tools.WebControl.SeRadioButtonList(this.rbIsBusiness, isbenuessTag);
            this.txtRegistNumber.Value = modelUser.registNumber.ToString();
            this.txtDepartment.Value = modelUser.department.ToString();
            this.txtPosition.Value = modelUser.position.ToString();
            this.txtPhone.Value = modelUser.phone.ToString();
            this.txtAddress.Value = modelUser.address.ToString();
        }
    }
Beispiel #4
0
    /// <summary>
    /// 新增会员
    /// </summary>
    protected void btnSend_Click(object sender, EventArgs e)
    {
        string  _userName = this.txtUserName.Value.Trim();
        DataSet temds     = common.GetList(" select [userName] FROM tb_sys_userinfo where [userName]='" + _userName + "' ");

        if (Tools.Validator.CheckDataSet(temds, 0))
        {
            FinalMessage("此账号已经存在,请更换!", "Add_Member.aspx", 1);
        }

        Test_Model.sys_userinfo modelUser = new Test_Model.sys_userinfo();
        modelUser.userName     = _userName;
        modelUser.password     = EncryptAdmin(this.txtPassword.Value.Trim());
        modelUser.trueName     = this.txtTrueName.Value.Trim();
        modelUser.currentScore = 30; //暂用,待改
        modelUser.totalScore   = 30; //暂用,待改
        modelUser.sex          = Tools.StringHelp.GetInt(this.rbSex.SelectedValue) == 1 ? true : false;
        modelUser.province     = this.hidProvince.Value;
        modelUser.city         = this.hidCity.Value;
        modelUser.isBusiness   = Tools.StringHelp.GetInt(this.rbIsBusiness.SelectedValue) == 1 ? true : false;
        modelUser.registNumber = this.txtRegistNumber.Value.Trim();
        modelUser.department   = this.txtDepartment.Value.Trim();
        modelUser.position     = this.txtPosition.Value.Trim();
        modelUser.phone        = this.txtPhone.Value.Trim();
        modelUser.address      = Tools.StringHelp.CutStirngNormal(this.txtAddress.Value.Trim(), 100, 1);
        modelUser.addTime      = DateTime.Now;

        Test_BUL.sys_userinfo bulUser = new Test_BUL.sys_userinfo();
        if (bulUser.Add(modelUser) > 0)
        {
            Response.Redirect("Manage_Member.aspx");
        }
        else
        {
            FinalMessage("保存失败!", "Add_Member.aspx", 1);
        }
    }