示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Response.Cache.SetNoStore();
        SysManageDb sysManageDb = new SysManageDb();

        if (base.Request.QueryString.Count > 0)
        {
            try
            {
                this._iSysID = int.Parse(base.Request.QueryString["sysid"].ToString());
                goto IL_5F;
            }
            catch
            {
                goto IL_5F;
            }
        }
        this._iSysID = sysManageDb.GetDefault();
IL_5F:
        this.HdnSysID.Value = this._iSysID.ToString();
        if (!base.IsPostBack)
        {
            int num = 0;
            try
            {
                num = int.Parse(base.Request.QueryString["deptid"].ToString());
            }
            catch
            {
            }
            if (num > 1)
            {
                userManageDb userManageDb = new userManageDb();
                DataSet      dataSet      = userManageDb.DepUserQuaryForMail(num.ToString());
                DataTable    dataTable    = dataSet.Tables[0];
                this.LBoxHuman.Items.Clear();
                for (int i = 0; i < dataTable.Rows.Count; i++)
                {
                    ListItem item = new ListItem(dataTable.Rows[i]["v_xm"].ToString(), dataTable.Rows[i]["v_yhdm"].ToString());
                    this.LBoxHuman.Items.Add(item);
                }
            }
            else
            {
                if (num == -1)
                {
                    MailManage mailManage = new MailManage();
                    DataTable  dataTable2 = mailManage.SelLinkman(this.Session["yhdm"].ToString());
                    this.LBoxHuman.Items.Clear();
                    for (int j = 0; j < dataTable2.Rows.Count; j++)
                    {
                        ListItem item2 = new ListItem(dataTable2.Rows[j]["v_xm"].ToString(), dataTable2.Rows[j]["v_yhdm"].ToString());
                        this.LBoxHuman.Items.Add(item2);
                    }
                }
            }
            this.SelectedList_Restore();
        }
    }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         this._iSysID = int.Parse(base.Request.QueryString["sysid"].ToString());
     }
     catch
     {
     }
     if (this._iSysID == 0)
     {
         SysManageDb sysManageDb = new SysManageDb();
         this._iSysID = sysManageDb.GetDefault();
     }
     this.TViewDept_Create(this._iSysID);
 }
示例#3
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        SysManageDb sysManageDb = new SysManageDb();

        if (base.Request.QueryString.Count > 0)
        {
            try
            {
                this._iSysID = int.Parse(base.Request.QueryString["sysid"].ToString());
                goto IL_4F;
            }
            catch
            {
                goto IL_4F;
            }
        }
        this._iSysID = sysManageDb.GetDefault();
IL_4F:
        this.HdnSysID.Value = this._iSysID.ToString();
        if (!base.IsPostBack)
        {
            int num = 0;
            try
            {
                num = int.Parse(base.Request.QueryString["deptid"].ToString());
            }
            catch
            {
            }
            if (num != 0 && num != 1)
            {
                userManageDb userManageDb = new userManageDb();
                DataSet      dataSet      = userManageDb.DepUserQuaryDs(num.ToString(), "y");
                DataTable    dataTable    = dataSet.Tables[0];
                this.LBoxHuman.Items.Clear();
                for (int i = 0; i < dataTable.Rows.Count; i++)
                {
                    ListItem item = new ListItem(dataTable.Rows[i]["v_xm"].ToString(), dataTable.Rows[i]["v_yhdm"].ToString());
                    this.LBoxHuman.Items.Add(item);
                }
            }
            this.SelectedList_Restore();
        }
    }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         try
         {
             this._iSysID = int.Parse(base.Request.QueryString["sysid"].ToString());
         }
         catch
         {
         }
         if (this._iSysID == 0)
         {
             SysManageDb sysManageDb = new SysManageDb();
             this._iSysID = sysManageDb.GetDefault();
         }
         this.HT = base.Request["HT"].ToString();
         this.Tree_Bind();
     }
 }
示例#5
0
    private void Useronline()
    {
        string text  = this.txtName.Value.Trim();
        string text2 = this.txtPwd.Value.Trim();
        string iP    = this.GetIP();

        if (!this.IsRuleByText(text) || !this.IsRuleByText(text2))
        {
            string script = "<script>jw.alert('对不起!用户名或者密码输入错误,请重新输入!');</script>";
            base.ClientScript.RegisterStartupScript(base.GetType(), "IsRule", script);
            return;
        }
        HttpCookie httpCookie = base.Request.Cookies["cbPass"];

        if (httpCookie != null && text2 == "justwin")
        {
            text2 = EncryptionUtility.Decryption(httpCookie.Value);
        }
        object obj   = userManageDb.ValidatorLoginAccess(text, text2);
        string text3 = (obj == null) ? string.Empty : obj.ToString();
        int    num   = this.IsReturnLogin(text3);

        if (string.IsNullOrEmpty(text3))
        {
            string script2 = "<script>jw.alert('系统提示', '对不起!用户名或者密码错误,请重新输入!');</script>";
            base.ClientScript.RegisterStartupScript(base.GetType(), "JavaScript", script2);
            return;
        }
        SysManageDb sysManageDb = new SysManageDb();

        this.Session["SysID"]  = sysManageDb.GetDefault().ToString();
        this.Session["yhdm"]   = text3;
        this.Session["yhdma"]  = text3;
        this.Session["SkinID"] = userManageDb.getUserSkin(text3);
        this.Session["SkinID"] = "4";
        this.Session["PmSet"]  = PmTypeAction.GetPmType(obj.ToString());
        this.Session["ptcs"]   = myxml.Getcs(base.Server.MapPath("/ptcs.txt"));
        this.Session["pttest"] = "notest";
        if (this.Session["pttest"].ToString() != "notest" && (this.Session["ptcs"] == null || Convert.ToInt32(this.Session["ptcs"]) >= 200))
        {
            string str     = "请找甲乙软件联系。";
            string script3 = string.Format("<script>jw.alert('试用已到期;如需要继续使用,\\r\\n'+'" + str + "');</script>", new object[0]);
            base.ClientScript.RegisterStartupScript(base.GetType(), "Startup", script3);
            return;
        }
        this.Session["OpModules"] = userManageDb.GetUserOpModules(this.Session["yhdm"].ToString());
        this.Session["CorpCode"]  = userManageDb.GetCorpCode(this.Session["yhdm"].ToString());
        HttpCookie httpCookie2 = new HttpCookie("LogName");

        httpCookie2.Values["key1"] = "zyg";
        httpCookie2.Expires        = DateTime.Now.AddHours(2.0);
        base.Response.Cookies.Add(httpCookie2);
        loginLogDb loginLogDb = new loginLogDb();

        loginLogDb.UserlLoginInfo(iP, this.Session["yhdm"].ToString());
        if (num == 0)
        {
            this.AddUserInfo(this.Session["yhdm"].ToString(), false);
        }
        else
        {
            base.Application.Lock();
            DataTable dataTable = (DataTable)base.Application["UserCodeCollection"];
            foreach (DataRow dataRow in dataTable.Rows)
            {
                if (dataRow["userCode"].ToString() == text3)
                {
                    dataRow["loginTime"] = DateTime.Now;
                    dataRow["endTime"]   = DateTime.Now;
                    dataRow["ip"]        = iP;
                    break;
                }
            }
            base.Application["UserCodeCollection"] = dataTable;
            base.Application.UnLock();
        }
        FormsAuthentication.RedirectFromLoginPage(text3, false);
        AduitAction.AddToLog(text3, "登录系统", iP, text);
        this.LogUserInfo();
        base.Response.Redirect("./SysFrame2/Desktop.aspx");
    }
示例#6
0
    public void Useronline()
    {
        string userHostAddress = this.Page.Request.UserHostAddress;

        if (!this.IsRuleByText(this.tb_yhdm.Value) || !this.IsRuleByText(this.tb_pwd.Value))
        {
            string script = "<script language='javascript'>alert('对不起!用户名或者密码输入错误,请重新输入!');</script>";
            base.ClientScript.RegisterStartupScript(base.GetType(), "IsRule", script);
            return;
        }
        HttpCookie httpCookie = base.Request.Cookies["cbPass"];

        if (httpCookie != null && this.tb_pwd.Value == "justwin")
        {
            this.tb_pwd.Value = this.DeCode(httpCookie.Value);
        }
        object obj  = userManageDb.ValidatorLoginAccess(this.tb_yhdm.Value, this.tb_pwd.Value);
        int    num  = this.IsReturnLogin((obj == null) ? "" : ((string)obj));
        bool   flag = true;

        if (obj != null && flag)
        {
            SysManageDb sysManageDb = new SysManageDb();
            this.Session["SysID"]  = sysManageDb.GetDefault().ToString();
            this.Session["yhdm"]   = Convert.ToString(obj);
            this.Session["yhdma"]  = Convert.ToString(obj);
            this.Session["SkinID"] = userManageDb.getUserSkin(obj.ToString());
            this.Session["SkinID"] = "4";
            this.Session["PmSet"]  = PmTypeAction.GetPmType(obj.ToString());
            this.Session["ptcs"]   = myxml.Getcs(base.Server.MapPath("/ptcs.txt"));
            this.Session["pttest"] = "notest";
            if (this.Session["pttest"].ToString() != "notest" && (this.Session["ptcs"] == null || Convert.ToInt32(this.Session["ptcs"]) >= 200))
            {
                string str     = "请找建文软件联系。";
                string script2 = string.Format("<script language='javascript'>alert('试用已到期;如需要继续使用,\\r\\n'+'" + str + "');</script>", new object[0]);
                base.ClientScript.RegisterStartupScript(base.GetType(), "Startup", script2);
                return;
            }
            this.Session["OpModules"] = userManageDb.GetUserOpModules(this.Session["yhdm"].ToString());
            this.Session["CorpCode"]  = userManageDb.GetCorpCode(this.Session["yhdm"].ToString());
            HttpCookie httpCookie2 = new HttpCookie("LogName");
            httpCookie2.Values["key1"] = "zyg";
            httpCookie2.Expires        = DateTime.Now.AddHours(2.0);
            base.Response.Cookies.Add(httpCookie2);
            loginLogDb loginLogDb = new loginLogDb();
            loginLogDb.UserlLoginInfo(userHostAddress, this.Session["yhdm"].ToString());
            if (num == 0)
            {
                this.AddUserInfo(this.Session["yhdm"].ToString(), false);
            }
            else
            {
                base.Application.Lock();
                DataTable dataTable = (DataTable)base.Application["UserCodeCollection"];
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    if (dataRow["userCode"].ToString() == obj.ToString())
                    {
                        dataRow["loginTime"] = DateTime.Now;
                        dataRow["endTime"]   = DateTime.Now;
                        dataRow["ip"]        = userHostAddress;
                        break;
                    }
                }
                base.Application["UserCodeCollection"] = dataTable;
                base.Application.UnLock();
            }
            FormsAuthentication.RedirectFromLoginPage(this.Session["yhdm"].ToString(), false);
            AduitAction.AddToLog(this.Session["yhdm"].ToString(), "登录系统", userHostAddress, this.tb_yhdm.Value);
            this.setCookUName();
            base.Response.Redirect("./SysFrame/frameset.aspx");
            return;
        }
        else
        {
            if (obj == null)
            {
                string script3 = "<script language='javascript'>alert('对不起!用户名或者密码错误,请重新输入!');</script>";
                base.ClientScript.RegisterStartupScript(base.GetType(), "JavaScript", script3);
                return;
            }
            if (!flag)
            {
                string script4 = "<script language='javascript'>alert('对不起!验证码输入错误,请重新输入!');</script>";
                base.ClientScript.RegisterStartupScript(base.GetType(), "JavaScript", script4);
            }
            return;
        }
    }