示例#1
0
    private void TViewSystem_Create()
    {
        SysManageDb sysManageDb = new SysManageDb();
        DataTable   dtSystem    = sysManageDb.QueryAllSys();

        this.TViewSystem_Generate(this.TViewSystem.Nodes, dtSystem, "0");
    }
示例#2
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();
        }
    }
示例#3
0
    private void RestoreMail(int iMailID, string strSenderCode)
    {
        MailManage mailManage = new MailManage();
        DataTable  oneMail    = mailManage.GetOneMail(iMailID, strSenderCode);

        if (oneMail.Rows.Count > 0)
        {
            int num = int.Parse(oneMail.Rows[0]["i_SysID"].ToString());
            if (num != this._iSysID)
            {
                SysManageDb sysManageDb = new SysManageDb();
                DataTable   dataTable   = sysManageDb.QuerySys(num);
                string      str         = dataTable.Rows[0]["v_SysName"].ToString();
                dataTable.Rows[0]["v_Sys"].ToString();
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString() + "[来自:" + str + "]";
            }
            else
            {
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString();
            }
            this.LabConsignee.Text = oneMail.Rows[0]["v_jsrxm"].ToString();
            string strUserCode = oneMail.Rows[0]["v_jsrdm"].ToString();
            this.LabTitle.Text    = oneMail.Rows[0]["v_zt"].ToString();
            this.LabDateTime.Text = oneMail.Rows[0]["dtm_sjsj"].ToString();
            string text = oneMail.Rows[0]["txt_zw"].ToString();
            text = text.Replace("\r\n", "<BR>");
            text = text.Replace(" ", "&nbsp;");
            text = "&nbsp;&nbsp;&nbsp;&nbsp;" + text;
            this.contentBlock.InnerHtml = text;
            DataTable mailAnnex = mailManage.GetMailAnnex(iMailID);
            if (mailAnnex.Rows.Count > 0)
            {
                for (int i = 0; i < mailAnnex.Rows.Count; i++)
                {
                    string[] array = mailAnnex.Rows[i]["v_Lmc"].ToString().Split(new char[]
                    {
                        '-'
                    });
                    HtmlGenericControl expr_24F  = this.annexBlock;
                    string             innerHtml = expr_24F.InnerHtml;
                    expr_24F.InnerHtml = string.Concat(new string[]
                    {
                        innerHtml,
                        "<LI><A href=\"#\" onclick=\"javascript:download('",
                        mailAnnex.Rows[i]["v_fjlj"].ToString(),
                        mailAnnex.Rows[i]["v_Lmc"].ToString(),
                        "','",
                        array[1].ToString(),
                        "');\">",
                        array[1].ToString(),
                        "</A>"
                    });
                }
            }
            mailManage.ReadMail(iMailID, strUserCode);
        }
    }
示例#4
0
    private void RestoreMail(int iMailID, string strSenderCode)
    {
        MailManage mailManage = new MailManage();
        DataTable  oneMail    = mailManage.GetOneMail(iMailID, strSenderCode);

        if (oneMail.Rows.Count > 0)
        {
            int num = int.Parse(oneMail.Rows[0]["i_SysID"].ToString());
            if (num != this._iSysID)
            {
                SysManageDb sysManageDb = new SysManageDb();
                DataTable   dataTable   = sysManageDb.QuerySys(num);
                dataTable.Rows[0]["v_Sys"].ToString();
                string str = dataTable.Rows[0]["v_SysName"].ToString();
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString() + "[来自:" + str + "]";
            }
            else
            {
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString();
            }
            this.LabConsignee.Text = this.sub(oneMail.Rows[0]["v_SJR"].ToString());
            this.LbCSR.Text        = this.sub(oneMail.Rows[0]["V_CSR"].ToString());
            this.LabTitle.Text     = oneMail.Rows[0]["v_zt"].ToString();
            this.LabDateTime.Text  = oneMail.Rows[0]["dtm_sjsj"].ToString();
            this.LblCon.Text       = oneMail.Rows[0]["txt_zw"].ToString();
            DataTable mailAnnex = mailManage.GetMailAnnex(iMailID);
            int       num2      = 20 * mailAnnex.Rows.Count;
            this.tr_fj.Attributes["height"] = num2.ToString() + "px";
            if (mailAnnex.Rows.Count > 0)
            {
                for (int i = 0; i < mailAnnex.Rows.Count; i++)
                {
                    string[] array = mailAnnex.Rows[i]["v_Lmc"].ToString().Split(new char[]
                    {
                        '-'
                    });
                    HtmlGenericControl expr_25A  = this.annexBlock;
                    string             innerHtml = expr_25A.InnerHtml;
                    expr_25A.InnerHtml = string.Concat(new string[]
                    {
                        innerHtml,
                        "<a href='",
                        mailAnnex.Rows[i]["v_fjlj"].ToString(),
                        mailAnnex.Rows[i]["v_Lmc"].ToString(),
                        "' target=_blank>",
                        array[1].ToString(),
                        "</a> "
                    });
                }
            }
            mailManage.ReadMail(iMailID, strSenderCode);
        }
    }
示例#5
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);
 }
示例#6
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();
        }
    }
示例#7
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();
     }
 }
示例#8
0
    protected void Button1_ServerClick(object sender, EventArgs e)
    {
        if (this.LBoxSelectedMan.Items.Count == 0)
        {
            return;
        }
        SysManageDb sysManageDb = new SysManageDb();
        DataTable   dataTable   = sysManageDb.QuerySys(Convert.ToInt32(this.LBoxSelectedMan.SelectedValue));
        WebRequest  webRequest  = WebRequest.Create(dataTable.Rows[0]["v_addressURL"].ToString());

        webRequest.Timeout = 1000;
        try
        {
            webRequest.GetResponse();
        }
        catch
        {
            this.RegisterClientScriptBlock("script", "<script language=javascript>alert('网络连接超时!');</script>");
            this.LBoxSelectedMan.Items.Clear();
            return;
        }
        this.RegisterClientScriptBlock("script", "<script language=javascript>window.close();</script>");
    }
示例#9
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");
    }
示例#10
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;
        }
    }
示例#11
0
        private void AdminForm_Load(object sender, EventArgs e)
        {
            string dbPath = $@"Data Source={AppDomain.CurrentDomain.BaseDirectory}SysManage.db;password={"admin"};";

            _sysManageDb = new SysManageDb(new SQLiteDataProvider(), dbPath);
        }