Example #1
0
    /// <summary>
    /// 类名:UserInfo_Add
    /// 描述:用户管理处理
    ///
    /// 作者:陶春
    /// 创建时间:2009/01/10
    /// 最后修改时间:2009/01/10
    /// </summary>
    ///

    protected void Page_Load(object sender, EventArgs e)
    {
        //lblMessage.Text = string.Empty;
        if (!Page.IsPostBack)
        {
            string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            BindDrpList(companyCD);
            hidden_companycd.Value = companyCD;
            hidModuleID.Value      = ConstUtil.Menu_SerchUserInfo;
            string requestParam = Request.QueryString.ToString();
            //通过参数个数来判断是否从菜单过来
            int firstIndex = requestParam.IndexOf("&");
            //从列表过来时
            if (firstIndex > 0)
            {
                //获取列表的查询条件
                string searchCondition = requestParam.Substring(firstIndex);
                //去除参数
                searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.Menu_AddUserInfo, string.Empty);
                //设置检索条件
                hidSearchCondition.Value = searchCondition;
                //迁移页面
                btnback.Visible = true;
            }
            else
            {
                btnback.Visible = false;
            }


            //判断公司是否启用USBKEY
            IsCompanyOpen.Value = UserInfoBus.IsOpenValidateByCompany(UserInfo.CompanyCD) ? "1" : "0";
        }
    }
Example #2
0
    /// <summary>
    /// 类名:UserInfo_Modify
    /// 描述:用户管理处理
    ///
    /// 作者:陶春
    /// 创建时间:2009/01/10
    /// 最后修改时间:2009/01/10
    /// </summary>
    ///

    protected void Page_Load(object sender, EventArgs e)
    {
        //第一次初期化页面
        if (!IsPostBack)
        {
            //判断公司是否启用USBKEY
            IsCompanyOpen.Value = UserInfoBus.IsOpenValidateByCompany(UserInfo.CompanyCD) ? "1" : "0";

            string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;//待修改
            ////获取参数用户名ID
            //string userID = Request.QueryString["UserID"];
            ////绑定员工信息
            //BindDrpList(companyCD);
            ////页面初期设置
            BindDrpList(companyCD);
            string requestParam = Request.QueryString.ToString();
            hidModuleID.Value = ConstUtil.Menu_SerchUserInfo;
            int firstIndex = requestParam.IndexOf("&");
            //返回回来时
            if (firstIndex > 0)
            {
                string searchCondition = requestParam.Substring(firstIndex);
                //去除参数
                searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.Menu_AddUserInfo, string.Empty);
                //设置检索条件
                hidSearchCondition.Value = searchCondition;
                InitPage(Request.QueryString["UserIDFlag"]);
            }
            this.txtUserID.Value = Request.QueryString["UserIDFlag"];
        }
    }
Example #3
0
    /// <summary>
    /// 绑定用户
    /// </summary>
    private void BindDplUsreInfo()
    {
        DataTable userList = XBase.Business.Office.SystemManager.UserInfoBus.GetUserList();

        //string companycd = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        string companycd = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        string userid    = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID;

        this.hfuserid.Value = userid;
        TreeNode node = new TreeNode();

        node.Text        = "用户列表";
        node.NavigateUrl = string.Format("javascript:javascript:void(0)");

        DataRow[] rows = userList.Select("CompanyCD='" + companycd + "'");
        foreach (DataRow row in rows)//.GetEnumerator())
        {
            if (row["UserID"].ToString() != userid)
            {
                if (row["IsRoot"].ToString() != "1")
                {
                    TreeNode  node2 = new TreeNode(row["UserID"].ToString());
                    DataTable dt    = UserInfoBus.GetUserInfoByID(row["UserID"].ToString(), companycd);
                    if (dt.Rows.Count > 0)
                    {
                        hfcommanycd.Value = dt.Rows[0]["CompanyCD"].ToString();
                    }
                    node2.NavigateUrl = string.Format("javascript:SelectedNodeChanged('{0}');", node2.Text);
                    node.ChildNodes.Add(node2);
                }
            }
        }
        this.Tree_BillTpye.Nodes.Add(node);
        Tree_BillTpye.ExpandAll();
    }
Example #4
0
    private void BindDplUsreInfo()
    {
        UserInfoUtil UserInfo  = (UserInfoUtil)SessionUtil.Session["UserInfo"];
        string       CompanyCD = UserInfo.CompanyCD;
        DataTable    dt        = UserInfoBus.GetUserInfo(CompanyCD, "");

        if (dt.Rows.Count > 0)
        {
            Drp_UserInfo.DataTextField  = "UserID";
            Drp_UserInfo.DataValueField = "UserID";
            Drp_UserInfo.DataSource     = dt;
            Drp_UserInfo.DataBind();
            ListItem Item = new ListItem();
        }
    }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.txt_User.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID;
         string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
         //this.txt_User.Text = "admin";
         //string companyCD = "AAAAAA";
         DataTable dt = UserInfoBus.GetUserInfoByID(txt_User.Text, companyCD);
         if (dt.Rows.Count > 0)
         {
             hf_psd.Value      = dt.Rows[0]["password"].ToString();
             hfcommanycd.Value = dt.Rows[0]["CompanyCD"].ToString();
         }
     }
 }
Example #6
0
    /// <summary>
    /// 绑定员工姓名
    /// </summary>
    private void BindDrpList(string companyCD)
    {
        DataTable dt_employee = UserInfoBus.GetEmployeeInfo(companyCD);

        if (dt_employee != null && dt_employee.Rows.Count > 0)
        {
            EmployeeID.Items.Clear();
            foreach (DataRow Row in dt_employee.Rows)
            {
                ListItem Employee = new ListItem();
                Employee.Text  = Row["EmployeeName"].ToString() + "_" + Row["EmployeeNo"].ToString();
                Employee.Value = Row["ID"].ToString();
                EmployeeID.Items.Add(Employee);
            }
        }
    }
Example #7
0
    /// <summary>
    /// 初期化页面
    /// </summary>
    /// <param name="userID">用户ID</param>
    private void InitPage(string userID)
    {
        //获得公司代码
        string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;                         ///待修改

        //没有参数时,新规追加用户
        if (string.IsNullOrEmpty(userID))
        {
            return;
        }
        //修改用户
        //获取用户信息
        DataTable dt = new DataTable();

        dt = UserInfoBus.GetUserInfoByID(userID, companyCD);
        txtUserID.Value   = dt.Rows[0]["UserID"].ToString();
        txtUserName.Value = dt.Rows[0]["UserName"].ToString();
        EmployeeID.Value  = dt.Rows[0]["EmployeeID"].ToString();
        string IsRoot = dt.Rows[0]["IsRoot"].ToString();

        if (IsRoot.Equals("1"))
        {
            txtOpenDate.Disabled  = true;
            txtCloseDate.Disabled = true;
            chkLockFlag.Disabled  = true;
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["OpenDate"].ToString()))
        {
            DateTime OpenDate = DateTime.Parse(dt.Rows[0]["OpenDate"].ToString());
            txtOpenDate.Value = OpenDate.ToString("yyyy-MM-dd");
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["CloseDate"].ToString()))
        {
            DateTime CloseDate = DateTime.Parse(dt.Rows[0]["CloseDate"].ToString());
            txtCloseDate.Value = CloseDate.ToString("yyyy-MM-dd");
        }
        chkLockFlag.Checked       = ConstUtil.LOCK_FLAG_LOCKED.Equals(dt.Rows[0]["LockFlag"].ToString()) ? true : false;
        UsedStatus.Value          = dt.Rows[0]["UsedStatus"].ToString();
        txtRemark.Value           = dt.Rows[0]["remark"].ToString();
        chkIsHardValidate.Checked = dt.Rows[0]["IsHardValidate"].ToString() == "1" ? true : false;
    }
Example #8
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string    userid    = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID;
        string    companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        DataTable dt        = UserInfoBus.GetUserInfoByID(userid, companyCD);

        if (dt.Rows.Count > 0)
        {
            oldpsd = dt.Rows[0]["password"].ToString();
        }
        string OldPassword = StringUtil.EncryptPasswordWitdhMD5(this.txt_oldpsd.Text.Trim());

        if (oldpsd == OldPassword)
        {
            Response.Write("<script charset=\"GB2312\" language='javascript' type='text/javascript'>window.returnValue ='" + oldpsd + "';window.close();</script>");
        }
        else
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "info", "<script>alert('管理员密码不正确!')</script>");
        }
    }
    /// <summary>
    /// 类名:UserInfo_Query
    /// 描述:用户管理处理
    ///
    /// 作者:陶春
    /// 创建时间:2009/01/10
    /// 最后修改时间:2009/01/10
    /// </summary>
    ///
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //判断公司是否启用USBKEY
            IsCompanyOpen.Value = UserInfoBus.IsOpenValidateByCompany(UserInfo.CompanyCD) ? "1" : "0";

            string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            BindDrpList(companyCD);
            this.hidModuleID.Value = ConstUtil.Menu_AddUserInfo;

            string requestParam = Request.QueryString.ToString();
            //从列表过来时
            int firstIndex = requestParam.IndexOf("&");
            //返回回来时
            if (firstIndex > 0)
            {
                //获取是否查询的标识
                string flag = Request.QueryString["Flag"];
                //点击查询时,设置查询的条件,并执行查询
                if ("1".Equals(flag))
                {
                    this.txtUserID.Value = Request.QueryString["UserID"];

                    chklockflag.Value  = Request.QueryString["LockFlag"];
                    EmployeeID.Value   = Request.QueryString["UserName"];
                    txtOpenDate.Value  = Request.QueryString["OpenDate"];
                    txtCloseDate.Value = Request.QueryString["CloseDate"];
                    //获取当前页
                    string pageIndex = Request.QueryString["PageIndex"];
                    //获取每页显示记录数
                    string pageCount = Request.QueryString["PageCount"];
                    //执行查询
                    ClientScript.RegisterStartupScript(this.GetType(), "DoSearch"
                                                       , "<script language=javascript>this.pageCount = parseInt(" + pageCount + ");Fun_Search_UserInfo('" + pageIndex + "');</script>");
                }
            }
        }
    }
Example #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string UserSessionMinLife = System.Configuration.ConfigurationManager.AppSettings["UserSessionMinLife"];

        inpMessageTipTimerSpan.Value = System.Configuration.ConfigurationManager.AppSettings["DeskTipFrameTimeSpan"] == null ? "300" : System.Configuration.ConfigurationManager.AppSettings["DeskTipFrameTimeSpan"];
        ClientScript.RegisterClientScriptBlock(this.GetType(), "fdsfs", "var UserSessionMinLife=" + UserSessionMinLife, true);


        if (!IsPostBack)
        {
            switch (System.Configuration.ConfigurationManager.AppSettings["VerNameGuid"].ToString())
            {
            case XBase.Common.ConstUtil.Ver_ERP_Guid:    //生产版
                Zxl100Path = "Login/";
                Title      = "进销存系统";
                break;

            default:    //未匹配到
                break;
            }


            this.txt_User.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID;
            string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            //this.txt_User.Text = "admin";
            //string companyCD = "AAAAAA";
            DataTable dt = UserInfoBus.GetUserInfoByID(txt_User.Text, companyCD);
            if (dt.Rows.Count > 0)
            {
                hf_psd.Value      = dt.Rows[0]["password"].ToString();
                hfcommanycd.Value = dt.Rows[0]["CompanyCD"].ToString();

                lblUserInfo.Text = this.txt_User.Text;
            }
        }



        //获得用户页面控制权限
        UserInfoUtil UserInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

        //btn_czkhlxr


        string[] AuthInfo = XBase.Business.Common.SafeUtil.GetPageAuthorityFromDB("2021202", UserInfo);


        //有权限操作页面
        if (AuthInfo != null && AuthInfo.Length > 0)
        {
            //可操作的控件显示
            for (int i = 0; i < AuthInfo.Length; i++)
            {
                if (AuthInfo[i].Trim() == "btn_search")
                {
                    this.btn_czkhlxr.Visible = true;
                    break;
                }
            }
        }
    }