示例#1
0
    public bool Save()
    {
        bool b = false;

        try
        {
            tmm          = tm.GetModel(Convert.ToInt64(ul.LoginID));
            tmm.m_id     = Convert.ToInt64(ul.LoginID);
            tmm.m_idcard = txtIdKard.Text.Trim();
            tmm.m_mail   = txtMail.Text.Trim();
            tmm.m_name   = txtName.Text.Trim();
            tmm.m_mobile = txtTel.Text.Trim();
            tmm.m_login  = txtUserName.Text.Trim();
            if (!string.IsNullOrEmpty(txtBirth.Text))
            {
                tmm.m_birth = Convert.ToDateTime(txtBirth.Text);
            }
            tm.Update(tmm);
            b = true;
        }
        catch (Exception)
        {
            b = false;
            throw;
        }
        return(b);
    }
示例#2
0
    /// <summary>
    /// 修改登录密码
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {
        int count = 0;

        foreach (RepeaterItem item in Repeater1.Items)
        {
            if ((item.FindControl("CheckBox1") as CheckBox).Checked)
            {
                int userId = Convert.ToInt32((item.FindControl("CheckBox1") as CheckBox).ToolTip);
                Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
                tmm            = tm.GetModel(userId);
                tmm.m_password = Tunnel.Data.DESEncrypt.Encrypt(TextBox1.Text.Trim());
                tm.Update(tmm);
                count++;
            }
        }
        Repeater1.DataSource = tm.GetModelList("1=1");
        Repeater1.DataBind();
        Tunnel.Common.Message.Show("成功更改了" + count + "个用户的密码!");
    }
示例#3
0
    public bool Save()
    {
        bool b = false;

        try
        {
            tmm             = tm.GetModel(Convert.ToInt64(ul.LoginID));
            tmm.m_id        = Convert.ToInt64(ul.LoginID);
            tmm.m_spassword = Tunnel.Data.DESEncrypt.Encrypt(TextBox3.Text.Trim());
            tm.Update(tmm);
            b = true;
        }
        catch (Exception)
        {
            b = false;
            throw;
        }
        return(b);
    }
示例#4
0
    public bool Save()
    {
        bool b = false;

        try
        {
            tmm.m_id     = Convert.ToInt64(Request.QueryString["updid"].ToString());
            tmm.m_idcard = txtIdKard.Text.Trim();
            if (!string.IsNullOrEmpty(DropDownList1.SelectedValue))
            {
                tmm.m_jiao = Convert.ToInt32(DropDownList1.SelectedValue);
            }
            tmm.m_bum  = int.Parse(ddlBum.SelectedValue.Trim());
            tmm.m_duty = int.Parse(ddlDuty.SelectedValue.Trim());
            string xjb = string.Empty;
            foreach (ListItem item in CheckBoxList3.Items)
            {
                if (item.Selected)
                {
                    xjb += item.Value + "|";
                }
            }
            if (xjb.Length > 0)
            {
                xjb = xjb.Substring(0, xjb.Length - 1);
            }
            if (!string.IsNullOrEmpty(xjb))
            {
                tmm.m_xjb = xjb;
            }
            else
            {
                tmm.m_xjb = "";
            }

            tmm.m_mail = txtMail.Text.Trim();
            tmm.m_name = txtName.Text.Trim();
            if (txtPwd.Attributes["value"] != txtPwd.Text)
            {
                tmm.m_password = Tunnel.Data.DESEncrypt.Encrypt(txtPwd.Text.Trim());
            }
            else
            {
                tmm.m_password = txtPwd.Attributes["value"];
            }

            if (txtsPwd.Attributes["value"] != txtsPwd.Text)
            {
                tmm.m_spassword = Tunnel.Data.DESEncrypt.Encrypt(txtsPwd.Text.Trim());
            }
            else
            {
                tmm.m_spassword = txtsPwd.Attributes["value"];
            }
            tmm.m_state  = Convert.ToInt32(rbState.SelectedValue);
            tmm.m_mobile = txtTel.Text.Trim();
            tmm.m_login  = txtUserName.Text.Trim();
            if (!string.IsNullOrEmpty(txtBirth.Text))
            {
                tmm.m_birth = Convert.ToDateTime(txtBirth.Text);
            }
            string ksid = string.Empty;
            foreach (ListItem item in cbListKS.Items)
            {
                if (item.Selected)
                {
                    ksid += item.Value + ",";
                }
            }
            if (ksid.Length > 0)
            {
                ksid = ksid.Substring(0, ksid.Length - 1);
            }
            if (!string.IsNullOrEmpty(ksid))
            {
                tmm.m_KSID = ksid;
            }
            else
            {
                tmm.m_KSID = "";
            }

            tm.Update(tmm);
            b = true;
        }
        catch (Exception ex)
        {
            Tunnel.Common.Message.Show(ex.Message);
        }
        return(b);
    }