Exemplo n.º 1
0
    //检查登录用户名是否重名
    private bool CheckLoginUserName(string strName)
    {
        Tz888.BLL.Sys.EmployeeInfoTab empbll = new Tz888.BLL.Sys.EmployeeInfoTab();
        DataTable dt = empbll.CheckUserLoginName(strName).Tables[0];

        bool flg = false;

        if (dt != null && dt.Rows.Count > 0)
        {
            flg = true;
        }
        else
        {
            flg = false;
        }
        return(flg);
    }
Exemplo n.º 2
0
    protected string getEmployeeID()
    {
        BasePage bp = new BasePage();

        string LoginName = bp.LoginName;

        Tz888.BLL.Sys.EmployeeInfoTab EmployeeBll = new Tz888.BLL.Sys.EmployeeInfoTab();
        DataSet ds         = EmployeeBll.GetList(" LoginName='" + LoginName + "'");
        string  EmployeeID = "0";

        if (ds.Tables[0].Rows.Count > 0)
        {
            EmployeeID = ds.Tables[0].Rows[0]["EmployeeID"].ToString();
        }

        // Response.Cookies["loginedUser"].Value; //从cookie中获取登录成功后的用户名

        return(EmployeeID);
    }
Exemplo n.º 3
0
    private void UpdateEmpTab()
    {
        //Employeeinfotab表
        Tz888.BLL.Sys.EmployeeInfoTab   empBll   = new Tz888.BLL.Sys.EmployeeInfoTab();
        Tz888.Model.Sys.EmployeeInfoTab empModel = new Tz888.Model.Sys.EmployeeInfoTab();

        empModel.LoginName    = txtLoginName.Text;
        empModel.EmployeeName = txtEmployeeName.Text.Trim();
        string strSex = rblSex.SelectedValue.Trim();

        empModel.Sex               = Convert.ToBoolean(strSex);
        empModel.NickName          = txtNickName.Text.Trim();
        empModel.Birthday          = Convert.ToDateTime(tbDate.Value.Trim());
        empModel.CertificateID     = ddlCertificateID.SelectedValue.ToString().Trim();
        empModel.CertificateNumber = txtCertificateNumber.Text.Trim();

        //*区域,这是修改内部会员资料,所以不更新它
        //*empModel.CountryCode = "CN";
        //*empModel.ProvinceID = "1098";
        //*empModel.CityID = "1099";
        //*empModel.CountyID = "1100";

        empModel.Address  = txtAddress.Text.Trim();
        empModel.PostCode = txtPostCode.Text.Trim();
        empModel.Tel      = txtCountryCode.Text.Trim() + "-" + txtAreaCode.Text.Trim() + "-" + txtTelPhone.Text.Trim();
        empModel.Mobile   = txtMobile.Text.Trim();
        empModel.FAX      = txtFax.Text.Trim();
        empModel.Email    = txtEmail.Text.Trim();
        empModel.DeptID   = ddlDept.SelectedValue.Trim();
        empModel.WorkType = ddlWorkType.SelectedValue.Trim();
        empModel.DegreeID = ddlDegree.SelectedValue.Trim();

        if (empBll.UpdateEmpTab(empModel) > 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", "alert('资料修改成功!'); location.href='SysUser.aspx'", true);
        }
        else
        {
            Tz888.Common.MessageBox.Show(this, "资料修改失败!");
        }
    }
Exemplo n.º 4
0
    //更新数据
    private void UpdateUserDoc()
    {
        //Employeeinfotab表
        Tz888.BLL.Sys.EmployeeInfoTab   empBll   = new Tz888.BLL.Sys.EmployeeInfoTab();
        Tz888.Model.Sys.EmployeeInfoTab empModel = new Tz888.Model.Sys.EmployeeInfoTab();

        empModel.LoginName    = txtLoginName.Text;
        empModel.EmployeeName = txtEmployeeName.Text.Trim();
        string strSex = rblSex.SelectedValue.Trim();

        empModel.Sex               = Convert.ToBoolean(strSex);
        empModel.NickName          = txtNickName.Text.Trim();
        empModel.Birthday          = Convert.ToDateTime(tbDate.Value.Trim());
        empModel.CertificateID     = ddlCertificateID.SelectedValue.ToString().Trim();
        empModel.CertificateNumber = txtCertificateNumber.Text.Trim();

        //*区域,这是修改内部会员资料,所以不更新它
        //*empModel.CountryCode = "CN";
        //*empModel.ProvinceID = "1098";
        //*empModel.CityID = "1099";
        //*empModel.CountyID = "1100";

        empModel.Address  = txtAddress.Text.Trim();
        empModel.PostCode = txtPostCode.Text.Trim();
        empModel.Tel      = txtCountryCode.Text.Trim() + "-" + txtAreaCode.Text.Trim() + "-" + txtTelPhone.Text.Trim();
        empModel.Mobile   = txtMobile.Text.Trim();
        empModel.FAX      = txtFax.Text.Trim();
        empModel.Email    = txtEmail.Text.Trim();
        empModel.DeptID   = ddlDept.SelectedValue.Trim();
        empModel.WorkType = ddlWorkType.SelectedValue.Trim();
        empModel.DegreeID = ddlDegree.SelectedValue.Trim();


        //logininfotab表
        Tz888.BLL.Login.LoginInfoBLL loginBll   = new Tz888.BLL.Login.LoginInfoBLL();
        Tz888.Model.LoginInfo        loginModel = new Tz888.Model.LoginInfo();

        //######更新密码,暂不用
        //SHA1 sha1 = SHA1.Create();
        //byte[] bytePassword = sha1.ComputeHash(Encoding.Unicode.GetBytes(txtPassword.Text.Trim()));
        //loginModel.Password = bytePassword;
        //######

        loginModel.LoginName = txtLoginName.Text;
        //loginModel.PasswordQuestion = txtPasswordQuestion.Text.Trim();
        //loginModel.PasswordAnswer = txtPasswordAnswer.Text.Trim();
        loginModel.RoleName  = "2";
        loginModel.IsCheckUp = false;
        loginModel.NickName  = txtNickName.Text.Trim();
        loginModel.Tel       = txtCountryCode.Text.Trim() + "-" + txtAreaCode.Text.Trim() + "-" + txtTelPhone.Text.Trim();
        loginModel.Email     = txtEmail.Text.Trim();
        //*loginModel.RequirInfo = "";
        //*loginModel.RealName = "";
        //*loginModel.ManageTypeID = "1001";
        //*loginModel.MemberGradeID = "1001";//和以前的项目一样
        //*loginModel.Enable = true;  //有效

        string sTem = "";//不修改角色(有专门的修改页面)

        if (empBll.Update(loginModel, empModel, sTem) > 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", "alert('资料修改成功!'); location.href='SysUser.aspx'", true);
        }
        else
        {
            Tz888.Common.MessageBox.Show(this, "资料修改失败!");
        }
    }
Exemplo n.º 5
0
    private void InsertData()
    {
        //检查登录名是否重名
        if (CheckLoginUserName(txtLoginName.Text.Trim()))
        {
            Tz888.Common.MessageBox.Show(this, "该用户名已经存在,请使用其它用户名!");
            txtLoginName.Focus();
            //txtLoginName.Text = "";
            return;
        }

        //Employeeinfotab表
        Tz888.BLL.Sys.EmployeeInfoTab   empBll   = new Tz888.BLL.Sys.EmployeeInfoTab();
        Tz888.Model.Sys.EmployeeInfoTab empModel = new Tz888.Model.Sys.EmployeeInfoTab();

        //密码
        SHA1 sha1 = SHA1.Create();

        byte[] bytePassword = sha1.ComputeHash(Encoding.Unicode.GetBytes(txtPassword.Text.Trim()));

        empModel.LoginName    = txtLoginName.Text.Trim();
        empModel.Password     = bytePassword;
        empModel.EmployeeName = txtEmployeeName.Text.Trim();
        string strSex = rblSex.SelectedValue.Trim();

        empModel.Sex      = Convert.ToBoolean(strSex);
        empModel.NickName = txtNickName.Text.Trim();
        if (!string.IsNullOrEmpty(tbDate.Value.Trim()))
        {
            empModel.Birthday = Convert.ToDateTime(tbDate.Value.Trim());
        }
        else
        {
            //empModel.Birthday = DateTime.Now.ToShortTimeString();
            empModel.Birthday = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
            //Response.Write("<script>alert('" + empModel.Birthday + "')</script>");
        }
        empModel.CertificateID     = ddlCertificateID.SelectedValue.ToString().Trim();
        empModel.CertificateNumber = txtCertificateNumber.Text.Trim();
        empModel.CountryCode       = "CN";
        empModel.ProvinceID        = "1098";
        empModel.CityID            = "1099";
        empModel.CountyID          = "1100";
        empModel.Address           = txtAddress.Text.Trim();
        empModel.PostCode          = txtPostCode.Text.Trim();
        empModel.Tel      = txtCountryCode.Text.Trim() + "-" + txtAreaCode.Text.Trim() + "-" + txtTelPhone.Text.Trim();
        empModel.Mobile   = txtMobile.Text.Trim();
        empModel.FAX      = txtFax.Text.Trim();
        empModel.Email    = txtEmail.Text.Trim();
        empModel.DeptID   = ddlDept.SelectedValue.Trim();
        empModel.WorkType = ddlWorkType.SelectedValue.Trim();
        empModel.DegreeID = ddlDegree.SelectedValue.Trim();
        empModel.Enable   = true; //有效

        string sTem = ddlRole.SelectedValue.Trim();

        //if (empBll.Insert(empModel,sTem) > 0)
        if (empBll.Insert_V1(empModel, sTem) > 0) //2010-8-9改为存储过程
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", "alert('注册成功!'); location.href='SysUser.aspx'", true);
        }
        else
        {
            Tz888.Common.MessageBox.Show(this, "注册失败!");
        }
    }
Exemplo n.º 6
0
    //注册
    private void SaveUserDoc()
    {
        //检查登录名是否重名
        if (CheckLoginUserName(txtLoginName.Text.Trim()))
        {
            Tz888.Common.MessageBox.Show(this, "该用户名已经存在,请使用其它用户名!");
            txtLoginName.Focus();
            //txtLoginName.Text = "";
            return;
        }

        //Employeeinfotab表
        Tz888.BLL.Sys.EmployeeInfoTab   empBll   = new Tz888.BLL.Sys.EmployeeInfoTab();
        Tz888.Model.Sys.EmployeeInfoTab empModel = new Tz888.Model.Sys.EmployeeInfoTab();


        empModel.LoginName    = txtLoginName.Text.Trim();
        empModel.EmployeeName = txtEmployeeName.Text.Trim();
        string strSex = rblSex.SelectedValue.Trim();

        empModel.Sex      = Convert.ToBoolean(strSex);
        empModel.NickName = txtNickName.Text.Trim();
        if (string.IsNullOrEmpty(tbDate.Value.Trim()))
        {
            empModel.Birthday = Convert.ToDateTime(tbDate.Value.Trim());
        }
        else
        {
            empModel.Birthday = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
        }
        empModel.CertificateID     = ddlCertificateID.SelectedValue.ToString().Trim();
        empModel.CertificateNumber = txtCertificateNumber.Text.Trim();
        empModel.CountryCode       = "CN";
        empModel.ProvinceID        = "1098";
        empModel.CityID            = "1099";
        empModel.CountyID          = "1100";
        empModel.Address           = txtAddress.Text.Trim();
        empModel.PostCode          = txtPostCode.Text.Trim();
        empModel.Tel      = txtCountryCode.Text.Trim() + "-" + txtAreaCode.Text.Trim() + "-" + txtTelPhone.Text.Trim();
        empModel.Mobile   = txtMobile.Text.Trim();
        empModel.FAX      = txtFax.Text.Trim();
        empModel.Email    = txtEmail.Text.Trim();
        empModel.DeptID   = ddlDept.SelectedValue.Trim();
        empModel.WorkType = ddlWorkType.SelectedValue.Trim();
        empModel.DegreeID = ddlDegree.SelectedValue.Trim();
        empModel.Enable   = true; //有效


        //logininfotab表
        Tz888.BLL.Login.LoginInfoBLL loginBll   = new Tz888.BLL.Login.LoginInfoBLL();
        Tz888.Model.LoginInfo        loginModel = new Tz888.Model.LoginInfo();
        SHA1 sha1 = SHA1.Create();

        byte[] bytePassword = sha1.ComputeHash(Encoding.Unicode.GetBytes(txtPassword.Text.Trim()));

        loginModel.LoginName = txtLoginName.Text.Trim();
        loginModel.Password  = bytePassword;
        //loginModel.PasswordQuestion = txtPasswordQuestion.Text.Trim();
        //loginModel.PasswordAnswer = txtPasswordAnswer.Text.Trim();
        loginModel.RoleName      = "2";
        loginModel.IsCheckUp     = false;
        loginModel.NickName      = txtNickName.Text.Trim();
        loginModel.Tel           = txtCountryCode.Text.Trim() + "-" + txtAreaCode.Text.Trim() + "-" + txtTelPhone.Text.Trim();
        loginModel.Email         = txtEmail.Text.Trim();
        loginModel.RequirInfo    = "";
        loginModel.RealName      = "";
        loginModel.ManageTypeID  = "1001";
        loginModel.MemberGradeID = "1001"; //和以前的项目一样
        loginModel.Enable        = true;   //有效

        string sTem = ddlRole.SelectedValue.Trim();

        if (empBll.Add(loginModel, empModel, sTem) > 0)
        {
            //Tz888.Common.MessageBox.Show(this, "注册成功!");
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", "alert('注册成功!'); location.href='SysUser.aspx'", true);
        }
        else
        {
            Tz888.Common.MessageBox.Show(this, "注册失败!");
        }
    }