예제 #1
0
    public ClsAjaxPage(ClsPage owner)
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //
        gOwer   = owner;
        gFinish = false;
        gOwer.Response.Clear();

        gPageArgs = new ClsAjaxPageArgs();

        for (int i = 0; i < gPageArgs.Object.Count; i++)
        {
            gPageArgs.Object[i].Value = gOwer[gPageArgs.Object[i].Name];
        }

        gPageRequest = new ClsAjaxRequest();

        gXPort     = new XPort();
        gXPortArgs = new XPort.UIArgs(owner);

        gszSessionID = gPageArgs.SessionID;

        if (gszSessionID == "")
        {
            gszSessionID = Guid.NewGuid().ToString();
            gPageRequest.SetStorage("Azalea_SessionID", gszSessionID);
        }
    }
예제 #2
0
 public AzSqlProgram(ClsPage owner, string connstr, Ly.Formats.Json json)
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     gPro = new Ly.ZBox.Program("", new AzSqlLibrary(owner, connstr, json));
 }
예제 #3
0
 public Table2D(ClsPage pg)
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     gPage     = pg;
     gnTableID = dyk.Type.String.New(gPage["Arg_Table"]).ToNumber;
 }
예제 #4
0
    public static void CheckLogin(ClsPage owner, String Key, String Url)
    {
        String LoginName = Key == "" ? owner.Session.Manager : owner.Session[Key];

        if (LoginName == "")
        {
            owner.Response.Redirect(Url);
        }
    }
예제 #5
0
파일: XPort.cs 프로젝트: SimeonChan/Aos
        public UIArgs(ClsPage parent)
        {
            Init();
            gParent = parent;

            for (int i = 0; i < base.Count; i++)
            {
                base[i].Value = parent[base[i].Name];
            }
        }
예제 #6
0
파일: DsLibrary.cs 프로젝트: SimeonChan/Aos
 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;
 }
예제 #7
0
        /// <summary>
        /// 获取用户关于表的权限
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="TableID"></param>
        /// <returns></returns>
        public static dyk.Format.Limits GetTableLimits(ClsPage pg, long TableID)
        {
            dyk.Format.Limits res = dyk.Format.Limits.NoLimits();

            #region [=====获取个人权限=====]

            using (dyk.DB.Base.SystemUserLimits.ExecutionExp sul = new dyk.DB.Base.SystemUserLimits.ExecutionExp(pg.BaseConnectString)) {
                sul.GetDatasByUserAndTable(pg.UserInfo.ID, TableID);
                for (int i = 0; i < sul.StructureCollection.Count; i++)
                {
                    dyk.DB.Base.SystemUserLimits.StructureExp st = sul.StructureCollection[i];
                    res.AddLimitsByString(st.Limits);
                }
            }

            #endregion

            #region [=====获取部门权限=====]

            using (dyk.DB.Kernel.SystemDepartmentLimits.ExecutionExp sul = new dyk.DB.Kernel.SystemDepartmentLimits.ExecutionExp(pg.BaseConnectString)) {
                sul.GetDatasByDepartmentAndTable(pg.UserInfo.Department, TableID);
                for (int i = 0; i < sul.StructureCollection.Count; i++)
                {
                    dyk.DB.Kernel.SystemDepartmentLimits.StructureExp st = sul.StructureCollection[i];
                    res.AddLimitsByString(st.Limits);
                }
            }

            #endregion

            #region [=====获取用户组权限=====]

            using (dyk.DB.Kernel.SystemGroupLimits.ExecutionExp sul = new dyk.DB.Kernel.SystemGroupLimits.ExecutionExp(pg.BaseConnectString)) {
                sul.GetDatasByUserAndTable(pg.UserInfo.ID, TableID);
                for (int i = 0; i < sul.StructureCollection.Count; i++)
                {
                    dyk.DB.Kernel.SystemGroupLimits.StructureExp st = sul.StructureCollection[i];
                    res.AddLimitsByString(st.Limits);
                }
            }

            #endregion

            return(res);
        }
예제 #8
0
파일: XPort.cs 프로젝트: SimeonChan/Aos
 private void Init()
 {
     gParent                = null;
     this.UI                = "";
     this.UI_ID             = "";
     this.UI_Main           = "";
     this.UI_Page           = "";
     this.UI_Path           = "";
     this.UI_Title          = "";
     this.UI_Tool           = "";
     this.Arg_Path          = "";
     this.Azalea_AuthID     = "";
     this.Azalea_Rnd        = "";
     this.Azalea_SessionID  = "";
     this.Dialog_ElementID  = "";
     this.Dialog_ID         = "";
     this.Process_ElementID = "";
     this.Process_ID        = "";
 }
예제 #9
0
    public WebConfig(ClsPage owner)
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //


        string szName = "";

        if (owner != null)
        {
            szName = owner.UserInfo.Name;
        }
        if (szName == "")
        {
            szName = "Guest";
        }

        string szPathStr = Pub.IO.ReadAllText(owner.Server.MapPath(SZ_PATH));

        base.Object.SetChildrenByJsonString(szPathStr);

        string szAuthCode = "";

        using (dyk.DB.Aos.AosAuthorize.ExecutionExp aa = new dyk.DB.Aos.AosAuthorize.ExecutionExp(owner.AosConnectString)) {
            if (aa.GetDataByID(owner.AuthorizeID))
            {
                szAuthCode = aa.Structure.Code;
            }
        }

        gszSystemPath = base["SYSTEM"].Value.Replace("<UserName>", szName).Replace("<AuthCode>", szAuthCode);
        gszUserPath   = base["USER"].Value.Replace("<UserName>", szName).Replace("<AuthCode>", szAuthCode);
        gszAppPath    = base["APP"].Value.Replace("<UserName>", szName).Replace("<AuthCode>", szAuthCode);
        gszSharePath  = base["SHARE"].Value.Replace("<UserName>", szName).Replace("<AuthCode>", szAuthCode);
    }
예제 #10
0
 public static void CheckLogin(ClsPage owner, String Url)
 {
     CheckLogin(owner, "", Url);
 }
예제 #11
0
        public static string getValue(ClsPage owner, string connstr, int id, string name, string value, string format, string formatpath)
        {
            if (format != "")
            {
                ClsAjaxPageArgs gPageArgs = new ClsAjaxPageArgs();

                for (int i = 0; i < gPageArgs.Object.Count; i++)
                {
                    gPageArgs.Object[i].Value = owner[gPageArgs.Object[i].Name];
                }

                using (Ly.Formats.Json json = new Ly.Formats.Json(format)) {
                    switch (json["Type"].Value)
                    {
                    case "Month":
                        string   sMonth  = value + "-01";
                        DateTime dtMonth = DateTime.Now;
                        if (DateTime.TryParse(sMonth, out dtMonth))
                        {
                            //sValue = dtMonth.ToString(jValue["Binding"].Value);
                            return(dtMonth.ToString(json["Binding"].Value));
                        }
                        break;

                    case "Date":
                        string   sDate  = value;
                        DateTime dtDate = DateTime.Now;
                        if (DateTime.TryParse(sDate, out dtDate))
                        {
                            //sValue = dtDate.ToString(json["Binding"].Value);
                            return(dtDate.ToString(json["Binding"].Value));
                        }
                        break;

                    case "File":
                        switch (json["Binding"].Value)
                        {
                        case "Image":
                            break;

                        default:
                            //sValue = "<a href=\"" + sValue + "\" target=\"_blank\">下载</a>";
                            return("<a href=\"" + value + "\" target=\"_blank\">下载</a>");
                            //break;
                        }
                        break;

                    case "Number":
                        double dbTemp = 0;
                        if (double.TryParse(value, out dbTemp))
                        {
                            //sValue = dbTemp.ToString(json["Binding"].Value);
                            return(dbTemp.ToString(json["Binding"].Value));
                        }
                        else
                        {
                            //sValue = "&nbsp;";
                            return("&nbsp;");
                        }

                    //break;
                    case "Check":
                        #region [=====选择框模式=====]
                        int    nTemp   = 0;
                        string szValue = "";
                        if (int.TryParse(value, out nTemp))
                        {
                            //sValue = dbTemp.ToString(json["Binding"].Value);
                            //return nTemp.ToString(json["Binding"].Value);
                            if (nTemp > 0)
                            {
                                szValue = "√";
                            }
                        }
                        //ClsAjaxPage pg = new ClsAjaxPage(owner);
                        return("<div id=\"" + gPageArgs.UID + "_Check_" + id + "_" + name + "\" style=\"margin: 0 auto; width:14px;height:14px; line-height:14px; border:1px solid #ddd;text-align: center; vertical-align: middle; color:#090; font-weight: bold; background: #fff;cursor:pointer;\" onclick=\"Page.Functions.Table.CheckClick('" + gPageArgs.UID + "',{Arg_Key_ID: " + id + ",Arg_Key_Name: '" + name + "'});\">" + szValue + "</div>");

                        #endregion
                    case "Read":
                        #region [=====数据库读取模式=====]
                        //string szSql = Pub.IO.ReadAllText(Server.MapPath(this.WebConfig.ShareSQLSettingPath + "/" + gTab.SystemTables.Structure.Name + "_" + st.Name + "_Format.azsql"));
                        string szSql = Pub.IO.ReadAllText(formatpath);

                        using (Ly.Formats.Json jSql = new Ly.Formats.Json()) {
                            jSql["Value"].Value = value;
                            using (AzSqlProgram Asm = new AzSqlProgram(owner, connstr, jSql)) {
                                try {
                                    szSql = Asm.ExecuteString(szSql);
                                } catch (Exception ex) {
                                    //pg.OutPut("脚本执行发生异常:" + ex.Message + "<br><br>");
                                    //pg.OutPut(Asm.Program.Debug().Replace("\r\n", "<br>").Replace("\n", "<br>").Replace(" ", "&nbsp;"));
                                    string szError = "脚本执行发生异常:" + ex.Message;
                                    //szError += ";Sql:" + szSql;
                                    return(szError);
                                } finally {
                                    //pg.OutPut(Asm.Program.Debug().Replace("\r\n", "<br>").Replace("\n", "<br>").Replace(" ", "&nbsp;"));
                                }
                                //pg.OutPutAsText(Asm.Test(gszSql));
                                //pg.Dispose();
                            }
                        }

                        using (Ly.Data.SQLClient ConnValue = new Ly.Data.SQLClient(connstr)) {
                            try {
                                ConnValue.ExecuteReader(szSql);
                            } catch (Exception ex) {
                                //pg.OutPutAsText("错误信息:" + ex.Message);
                                //pg.OutPut("<br>");
                                //pg.OutPutAsText("Sql:" + szSql);
                                //pg.Dispose();
                                string szError = "错误信息:" + ex.Message;
                                szError += ";Sql:" + szSql;
                                return(szError);
                            }

                            if (ConnValue.DataReader.Read())
                            {
                                //sValue = ConnValue.DataReader[0].ToString();
                                return(ConnValue.DataReader[0].ToString());
                            }
                            else
                            {
                                //sValue = "";
                                return("&nbsp;");
                            }
                        }
                        //break;
                        #endregion
                    }
                }
            }
            return(value);
        }
예제 #12
0
 public static string getValue(ClsPage owner, string connstr, string value, string format, string formatpath)
 {
     return(getValue(owner, connstr, 0, "", value, format, formatpath));
 }