Beispiel #1
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();
    }
Beispiel #2
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();
         }
     }
 }
Beispiel #3
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;
    }
Beispiel #4
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>");
        }
    }
Beispiel #5
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;
                }
            }
        }
    }