示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        gTabs = new Ly.DB.Dream.Tables(this.ConnectString);

        gstrPath = "";
        if (Request["Path"] != null)
        {
            gstrPath = Request["Path"].ToString().Trim().Replace("\\", "/");
        }
        if (gstrPath.StartsWith("/") || gstrPath.IndexOf("..") >= 0)
        {
            gstrPath = "";
        }
        if (gstrPath != "" && !gstrPath.EndsWith("/"))
        {
            gstrPath += "/";
        }
        gstrFullPath = "/" + gstrPath;
        gJson        = new Ly.Formats.Json(Pub.IO.ReadAllText(Server.MapPath(this.WebConfig.SystemExtensionPath)));

        gnType      = Ly.String.Source(this["Type"]).toInteger;
        gnChat      = Ly.String.Source(this["ID"]).toInteger;
        gszTempSign = this["Sign"];

        if (gnType <= 0 || gnType > 4)
        {
            gnType = 1;
            gnChat = (int)this.UserInfo.Department;
        }



        gszSign = "";

        switch (gnType)
        {
        case 1:
            gszSign = "Department:" + gnChat;
            break;

        case 2:
            gszSign = "User:"******"Group:" + gnChat;
            break;

        case 4:
            gszSign = gszTempSign;
            gnChat  = 0;
            break;
        }

        if (gszSign == "")
        {
            gszSign = "Unknow";
        }
    }
示例#2
0
 public DsLibrary(ClsPage owner, string connstr, dyk.Format.Json json)
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     gTab          = new Ly.DB.Dream.Tables(connstr);
     gnTable       = 0;
     gbTable       = false;
     gParent       = owner;
     gJson         = json;
     gszConnString = connstr;
 }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        gstrPath = "";

        if (Request.Cookies["UserName"] != null)
        {
            gszCookieName = Request.Cookies["UserName"].Value;
        }

        gUserAgent = new Ly.Web.HttpUserAgent(HttpContext.Current.Request.UserAgent);

        //Session["Manager"] = "Admin";
        string szKey = "";

        if (Request["key"] != null)
        {
            szKey = Request["key"].ToString();
        }

        Random rnd = new Random();

        if (szKey != "")
        {
            Response.Redirect("/ui_window/Default.aspx?key=" + szKey + "&rnd=" + rnd.NextDouble());
        }
        else
        {
            Response.Redirect("/ui_window/Default.aspx?rnd=" + rnd.NextDouble());
        }


        if (Request["Path"] != null)
        {
            gstrPath = Request["Path"].ToString().Trim().Replace("\\", "/");
        }
        if (gstrPath.StartsWith("/") || gstrPath.IndexOf("..") >= 0)
        {
            gstrPath = "";
        }
        if (gstrPath != "" && !gstrPath.EndsWith("/"))
        {
            gstrPath += "/";
        }
        gstrFullPath = "/" + gstrPath;
        gJson        = new Ly.IO.JsonFile(Server.MapPath("/Files/System/Apps.txt"), System.Text.Encoding.UTF8);

        //String Connstr = Pub.IO.ReadAllText(Server.MapPath("/Files/System/Conn.txt"));

        //检测是否安装了数据
        string szConnectString = Pub.IO.ReadAllText(base.Server.MapPath(WebConfig.SZ_PATH_CONNECTSTRING));

        if (!Pub.CheckInstall(szConnectString))
        {
            Response.Redirect("/Files/App/Install/Install.aspx");
        }

        //gstrApps = "{Array:[";

        for (int i = 0; i < gJson.Objects.Count; i++)
        {
            if (gJson.Objects[i].Name == "App")
            {
                if (gJson.Objects[i].Items["Name"].Value == "#(TableList)")
                {
                    using (Ly.DB.Dream.Tables gTab = new Ly.DB.Dream.Tables(szConnectString)) {
                        gTab.SystemTables.GetDatasOrderByIndex();
                        for (int j = 0; j < gTab.SystemTables.StructureCollection.Count; j++)
                        {
                            if (gstrApps != "")
                            {
                                gstrApps += ",";
                            }
                            using (Ly.IO.Json js = new Ly.IO.Json()) {
                                js.Items["text"].Value = gTab.SystemTables.StructureCollection[j].Text;
                                js.Items["name"].Value = "System/Table";
                                js.Items["logo"].Value = "/Files/App/System/Manager/Logo.png";
                                js.Items["url"].Value  = "/Files/App/System/Table/Default.aspx?Table=" + gTab.SystemTables.StructureCollection[j].ID;
                                gstrApps += js.Object.ToString().Replace("\"", "\\\"");
                            }
                        }
                    }
                }
                else
                {
                    if (gstrApps != "")
                    {
                        gstrApps += ",";
                    }
                    using (Ly.IO.Json js = new Ly.IO.Json()) {
                        js.Items["text"].Value = gJson.Objects[i].Items["Name"].Value;
                        js.Items["name"].Value = gJson.Objects[i].Items["Dir"].Value;
                        js.Items["logo"].Value = gJson.Objects[i].Items["Icon"].Value;
                        js.Items["url"].Value  = gJson.Objects[i].Items["App"].Value;
                        gstrApps += js.Object.ToString().Replace("\"", "\\\"");
                    }
                }
            }
        }

        gstrApps = "{Array:[" + gstrApps + "]}";
    }