Exemplo n.º 1
0
        public static List<UcmlVcTabPage> GetVcTab(SqlConnection conn, string bpoid)
        {
            List<UcmlVcTabPage> tabList = new List<UcmlVcTabPage>();
            List<UcmlViewCompnent> vcList = new List<UcmlViewCompnent>();

            //构造SQL函数,获取BPO下的所有VC
            StringBuilder sql = new StringBuilder("select ");
            sql.Append("a.BusiViewCompLinkDataSetOID,a.ParentOID,b.AppletName,b.Caption,b.fTreeGridMode,b.fSubTableTreeMode,b.ImageLink,");
            sql.Append("b.SubBCs,b.SubParentFields,b.SubPicFields,b.SubLabelFields,b.SubFKFields,b.TargetHTMLSource ,b.AllowEdit,a.fHidden,");
            sql.Append("b.UserDesignWebPage,a.alignHeight,a.alignWidth,c.BCName,b.AppletDataSetOID,b.AllowAddNew,b.AppletKind,");
            sql.Append("b.JSCIPTInit,b.JSCIPTBeforeUpdate,b.JSCIPTAfterApplyScript,b.HttpGetScript,b.HttpPostScript,b.PageLoadScript");
            sql.Append(" from BusiViewCompLinkDataSet as a,AppletDataSet as b,BusinessTableDataSet as c ");
            sql.Append("where a.AppletOID=b.AppletDataSetOID and c.BusinessTableDataSetOID=b.BusinessTableOID and a.UCMLClassOID='" + bpoid+"'");

            SqlCommand cmd = new SqlCommand(sql.ToString(), conn);
            SqlDataReader reader = cmd.ExecuteReader();

            //读取VC基本信息
            while (reader.Read())
            {
                UcmlViewCompnent vc = new UcmlViewCompnent();
                vc.LinkOID = Util.GetProperGuid(reader, 0);
                vc.LinkPOID = Util.GetProperGuid(reader, 1);
                vc.VCName = Util.GetPropString(reader, 2);
                vc.Caption = Util.GetPropString(reader, 3);
                vc.fTreeGridMode = Util.GetPropBool(reader, 4);
                vc.fSubTableTreeMode = Util.GetPropBool(reader, 5);
                vc.ImageLink = Util.GetPropString(reader, 6);
                vc.SubBCs = Util.GetPropString(reader, 7);
                vc.SubParentFields = Util.GetPropString(reader, 8);
                vc.SubPicFields = Util.GetPropString(reader, 9);
                vc.SubLabelFields = Util.GetPropString(reader, 10);
                vc.SubFKFields = Util.GetPropString(reader, 11);
                vc.SetVCNode(Util.GetPropString(reader, 12), "div");
                vc.EnabledEdit = Util.GetPropBool(reader, 13);
                vc.fHidden = Util.GetPropBool(reader, 14);
                vc.UserDefineHTML = Util.GetPropBool(reader, 15);
                vc.alignHeight = Util.GetPropBool(reader, 16);
                vc.alignWidth = Util.GetPropBool(reader, 17);
                vc.BCName = Util.GetPropString(reader, 18);
                vc.OID = Util.GetProperGuid(reader, 19);
                vc.haveMenu = Util.GetPropBool(reader, 20);
                vc.Kind = Util.GetProperInt(reader, 21);
                vc.InitScript = Util.GetPropString(reader, 22);
                vc.BeforeUpdateScript = Util.GetPropString(reader, 23);
                vc.AfterApplyScript = Util.GetPropString(reader, 24);
                vc.HttpGetCSharpCode = Util.GetPropString(reader, 25);
                vc.HttpPostCSharpCode = Util.GetPropString(reader, 26);
                vc.PageLoadCSharpCode = Util.GetPropString(reader, 27);

                vcList.Add(vc);
            }

            //关闭SqlDataReader
            reader.Close();

            foreach (UcmlViewCompnent vc in vcList)
            {
                //加载列信息
                vc.Columns = GetVcColumn(conn, vc.OID);
                vc.Buttons = GetVcButton(conn, vc.OID);
            }

            //将VC按照POID分类在不同的VCTab中
            List<string> OIDList = new List<string>();
            string tmpOID = "";
            for (int i = 0; i < vcList.Count; i++)
            {
                if (OIDList.Contains(vcList[i].LinkPOID)) continue;
                tmpOID = vcList[i].LinkPOID;
                UcmlVcTabPage vcTab = new UcmlVcTabPage();
                vcTab.Name = vcList[i].VCName;
                vcTab.Caption = vcList[i].Caption;
                vcTab.ParentOID = vcList[i].LinkPOID;
                vcTab.VCList.Add(vcList[i]);

                for (int j = i + 1; j < vcList.Count; j++)
                {
                    if (vcList[j].LinkPOID == tmpOID)
                    {
                        vcTab.VCList.Add(vcList[j]);
                        vcList.Remove(vcList[j]);
                    }
                }
                OIDList.Add(tmpOID);
                tabList.Add(vcTab);
            }

            return tabList;
        }
Exemplo n.º 2
0
        public static List <UcmlVcTabPage> GetVcTab(SqlConnection conn, string bpoid)
        {
            List <UcmlVcTabPage>    tabList = new List <UcmlVcTabPage>();
            List <UcmlViewCompnent> vcList  = new List <UcmlViewCompnent>();

            //构造SQL函数,获取BPO下的所有VC
            StringBuilder sql = new StringBuilder("select ");

            sql.Append("a.BusiViewCompLinkDataSetOID,a.ParentOID,b.AppletName,b.Caption,b.fTreeGridMode,b.fSubTableTreeMode,b.ImageLink,");
            sql.Append("b.SubBCs,b.SubParentFields,b.SubPicFields,b.SubLabelFields,b.SubFKFields,b.TargetHTMLSource ,b.AllowEdit,a.fHidden,");
            sql.Append("b.UserDesignWebPage,a.alignHeight,a.alignWidth,c.BCName,b.AppletDataSetOID,b.AllowAddNew,b.AppletKind,");
            sql.Append("b.JSCIPTInit,b.JSCIPTBeforeUpdate,b.JSCIPTAfterApplyScript,b.HttpGetScript,b.HttpPostScript,b.PageLoadScript");
            sql.Append(" from BusiViewCompLinkDataSet as a,AppletDataSet as b,BusinessTableDataSet as c ");
            sql.Append("where a.AppletOID=b.AppletDataSetOID and c.BusinessTableDataSetOID=b.BusinessTableOID and a.UCMLClassOID='" + bpoid + "'");

            SqlCommand    cmd    = new SqlCommand(sql.ToString(), conn);
            SqlDataReader reader = cmd.ExecuteReader();

            //读取VC基本信息
            while (reader.Read())
            {
                UcmlViewCompnent vc = new UcmlViewCompnent();
                vc.LinkOID           = Util.GetProperGuid(reader, 0);
                vc.LinkPOID          = Util.GetProperGuid(reader, 1);
                vc.VCName            = Util.GetPropString(reader, 2);
                vc.Caption           = Util.GetPropString(reader, 3);
                vc.fTreeGridMode     = Util.GetPropBool(reader, 4);
                vc.fSubTableTreeMode = Util.GetPropBool(reader, 5);
                vc.ImageLink         = Util.GetPropString(reader, 6);
                vc.SubBCs            = Util.GetPropString(reader, 7);
                vc.SubParentFields   = Util.GetPropString(reader, 8);
                vc.SubPicFields      = Util.GetPropString(reader, 9);
                vc.SubLabelFields    = Util.GetPropString(reader, 10);
                vc.SubFKFields       = Util.GetPropString(reader, 11);
                vc.SetVCNode(Util.GetPropString(reader, 12), "div");
                vc.EnabledEdit        = Util.GetPropBool(reader, 13);
                vc.fHidden            = Util.GetPropBool(reader, 14);
                vc.UserDefineHTML     = Util.GetPropBool(reader, 15);
                vc.alignHeight        = Util.GetPropBool(reader, 16);
                vc.alignWidth         = Util.GetPropBool(reader, 17);
                vc.BCName             = Util.GetPropString(reader, 18);
                vc.OID                = Util.GetProperGuid(reader, 19);
                vc.haveMenu           = Util.GetPropBool(reader, 20);
                vc.Kind               = Util.GetProperInt(reader, 21);
                vc.InitScript         = Util.GetPropString(reader, 22);
                vc.BeforeUpdateScript = Util.GetPropString(reader, 23);
                vc.AfterApplyScript   = Util.GetPropString(reader, 24);
                vc.HttpGetCSharpCode  = Util.GetPropString(reader, 25);
                vc.HttpPostCSharpCode = Util.GetPropString(reader, 26);
                vc.PageLoadCSharpCode = Util.GetPropString(reader, 27);

                vcList.Add(vc);
            }

            //关闭SqlDataReader
            reader.Close();

            foreach (UcmlViewCompnent vc in vcList)
            {
                //加载列信息
                vc.Columns = GetVcColumn(conn, vc.OID);
                vc.Buttons = GetVcButton(conn, vc.OID);
            }

            //将VC按照POID分类在不同的VCTab中
            List <string> OIDList = new List <string>();
            string        tmpOID  = "";

            for (int i = 0; i < vcList.Count; i++)
            {
                if (OIDList.Contains(vcList[i].LinkPOID))
                {
                    continue;
                }
                tmpOID = vcList[i].LinkPOID;
                UcmlVcTabPage vcTab = new UcmlVcTabPage();
                vcTab.Name      = vcList[i].VCName;
                vcTab.Caption   = vcList[i].Caption;
                vcTab.ParentOID = vcList[i].LinkPOID;
                vcTab.VCList.Add(vcList[i]);

                for (int j = i + 1; j < vcList.Count; j++)
                {
                    if (vcList[j].LinkPOID == tmpOID)
                    {
                        vcTab.VCList.Add(vcList[j]);
                        vcList.Remove(vcList[j]);
                    }
                }
                OIDList.Add(tmpOID);
                tabList.Add(vcTab);
            }

            return(tabList);
        }