コード例 #1
0
        /// <summary>
        /// 新建文本框自动完成
        /// </summary>
        public void EditAutoFullM2M_TB()
        {
            MapExt  myme = new MapExt(this.MyPK);
            MapM2Ms m2ms = new MapM2Ms(myme.FK_MapData);

            if (m2ms.Count == 0)
            {
                this.Pub1.Clear();
                //this.Pub1.AddFieldSet("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");
                //this.Pub1.Add("该表单下没有从表,所以您不能为从表设置自动填充。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfo("设置自动填充从表", "<p>该表单下没有从表,所以您不能为从表设置自动填充。<a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a></p>");
                return;
            }

            Pub1.AddTableNormal();
            Pub1.AddTRGroupTitle("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");

            string[] strs       = myme.Tag2.Split('$');
            bool     isHaveM2M  = false;
            bool     isHaveM2MM = false;

            foreach (MapM2M m2m in m2ms)
            {
                if (m2m.HisM2MType == M2MType.M2M)
                {
                    isHaveM2M = true;
                }
                if (m2m.HisM2MType == M2MType.M2MM)
                {
                    isHaveM2MM = true;
                }

                TextBox tb = new TextBox();
                tb.ID      = "TB_" + m2m.NoOfObj;
                tb.Columns = 70;
                tb.Style.Add("width", "100%");
                tb.Rows     = 5;
                tb.TextMode = TextBoxMode.MultiLine;
                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }

                    if (s.Contains(m2m.NoOfObj + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    tb.Text = ss[1];
                }

                //this.Pub1.AddFieldSet("编号:" + m2m.NoOfObj + ",名称:" + m2m.Name);
                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.Add("编号:" + m2m.NoOfObj + ",名称:" + m2m.Name);
                Pub1.Add(tb);
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                //this.Pub1.AddFieldSetEnd();
            }

            //this.Pub1.AddHR();
            Pub1.AddTableEnd();
            Pub1.AddBR();

            //Button mybtn = new Button();
            var mybtn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            mybtn.Click += new EventHandler(mybtn_SaveAutoFullM2M_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddSpace(1);

            mybtn        = new LinkBtn(false, NamesOfBtn.Cancel, "取消");
            mybtn.Click += new EventHandler(mybtn_SaveAutoFullM2M_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddBR();
            //this.Pub1.AddFieldSetEnd();

            if (isHaveM2M)
            {
                //this.Pub1.AddFieldSet("帮助:一对多");
                Pub1.AddEasyUiPanelInfoBegin("帮助:一对多", "icon-help");
                this.Pub1.Add("在主表相关数据发生变化后,一对多数据要发生变化,变化的格式为:");
                this.Pub1.AddBR("实例:SELECT No,Name FROM WF_Emp WHERE FK_Dept='@Key' ");
                this.Pub1.AddBR("相关内容的值发生改变时而自动填充checkbox。");
                this.Pub1.AddBR("注意:");
                this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
                this.Pub1.AddBR("2,必须并且仅有No,Name两个列,顺序不要颠倒。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfoEnd();
            }

            if (isHaveM2MM)
            {
                //this.Pub1.AddFieldSet("帮助:一对多多");
                Pub1.AddEasyUiPanelInfoBegin("帮助:一对多多", "icon-help");
                this.Pub1.Add("在主表相关数据发生变化后,一对多多数据要发生变化,变化的格式为:");
                this.Pub1.AddBR("实例:SELECT a.FK_Emp M1ID, a.FK_Station as M2ID, b.Name as M2Name FROM " + BP.WF.Glo.EmpStation + " a, Port_Station b WHERE  A.FK_Station=B.No and a.FK_Emp='@Key'");
                this.Pub1.AddBR("相关内容的值发生改变时而自动填充checkbox。");
                this.Pub1.AddBR("注意:");
                this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
                this.Pub1.AddBR("2,必须并且仅有3个列 M1ID,M2ID,M2Name,顺序不要颠倒。第1列的ID对应列表的ID,第2,3列对应的是列表数据源的ID与名称。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfoEnd();
            }
        }
コード例 #2
0
        /// <summary>
        /// 新建文本框自动完成
        /// </summary>
        public void EditAutoFullDtl_TB()
        {
            MapExt  myme = new MapExt(this.MyPK);
            MapDtls dtls = new MapDtls(myme.FK_MapData);

            if (dtls.Count == 0)
            {
                this.Pub1.Clear();
                Pub1.AddEasyUiPanelInfo("设置自动填充从表", "<p>该表单下没有从表,所以您不能为从表设置自动填充。<a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a></p>");
                return;
            }

            Pub1.AddTableNormal();
            Pub1.AddTRGroupTitle("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");

            string[] strs = myme.Tag1.Split('$');
            foreach (MapDtl dtl in dtls)
            {
                TextBox tb = new TextBox();
                tb.ID      = "TB_" + dtl.No;
                tb.Columns = 70;
                tb.Style.Add("width", "100%");
                tb.Rows     = 5;
                tb.TextMode = TextBoxMode.MultiLine;
                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }

                    if (s.Contains(dtl.No + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    tb.Text = ss[1];
                }

                //this.Pub1.AddFieldSet("编号:" + dtl.No + ",名称:" + dtl.Name);
                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.Add("编号:" + dtl.No + ",名称:" + dtl.Name);
                Pub1.AddBR();
                Pub1.Add(tb);
                Pub1.AddBR();

                string   fs    = "可填充的字段:";
                MapAttrs attrs = new MapAttrs(dtl.No);
                foreach (MapAttr item in attrs)
                {
                    if (item.KeyOfEn == "OID" || item.KeyOfEn == "RefPKVal")
                    {
                        continue;
                    }
                    fs += item.KeyOfEn + ",";
                }

                this.Pub1.Add(fs.Substring(0, fs.Length - 1));
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
            }

            //this.Pub1.AddHR();
            Pub1.AddTableEnd();
            Pub1.AddBR();

            //Button mybtn = new Button();
            var mybtn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            mybtn.Click += new EventHandler(mybtn_SaveAutoFullDtl_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddSpace(1);

            mybtn        = new LinkBtn(false, NamesOfBtn.Cancel, "取消");
            mybtn.Click += new EventHandler(mybtn_SaveAutoFullDtl_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddBR();
            //this.Pub1.AddFieldSetEnd();

            //this.Pub1.AddFieldSet("帮助:");
            Pub1.AddEasyUiPanelInfoBegin("帮助", "icon-help");
            this.Pub1.Add("在这里您需要设置一个查询语句");
            this.Pub1.AddBR("例如:SELECT XLMC AS suozaixianlu, bustype as V_BusType FROM [V_XLVsBusType] WHERE jbxx_htid='@Key'");
            this.Pub1.AddBR("这个查询语句要与从表的列对应上就可以在文本框的值发生改变时而自动填充。");
            this.Pub1.AddBR("注意:");
            this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
            this.Pub1.AddBR("2,从表列字段字名,与填充sql列字段大小写匹配。");
            //this.Pub1.AddFieldSetEnd();
            Pub1.AddEasyUiPanelInfoEnd();
        }