コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FrmEvents ndevs = new FrmEvents();

            ndevs.Retrieve(FrmEventAttr.FK_MapData, this.FK_MapData);

            FrmEvent mynde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, this.Event) as FrmEvent;

            if (mynde == null)
            {
                mynde          = new FrmEvent();
                mynde.FK_Event = this.Event;
            }

            this.Pub1.AddTable("class='Table' cellspacing='1' cellpadding='1' border='1' style='width:100%'");

            this.Pub1.AddTR();
            this.Pub1.AddTD("控制方式");
            var ddl = new DDL();

            ddl.BindSysEnum("MsgCtrl");
            ddl.ID = "DDL_" + FrmEventAttr.MsgCtrl;
            ddl.SetSelectItem((int)mynde.MsgCtrl);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            CheckBox cb = new CheckBox();

            cb.ID      = "CB_" + FrmEventAttr.MsgMailEnable;
            cb.Text    = "是否启用邮件通知?";
            cb.Checked = mynde.MsgMailEnable;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("邮件标题模版");
            var tb = new TextBox();

            tb.ID   = "TB_" + FrmEventAttr.MailTitle;
            tb.Text = mynde.MailTitle_Real;
            tb.Style.Add("width", "99%");
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("邮件内容模版:");
            tb          = new TextBox();
            tb.ID       = "TB_" + FrmEventAttr.MailDoc;
            tb.Text     = mynde.MailDoc_Real;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 50;
            tb.Rows     = 4;
            tb.Style.Add("width", "99%");
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            //手机短信....
            this.Pub1.AddTR();
            this.Pub1.AddTD("默认:不启用");
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmEventAttr.SMSEnable;
            cb.Text    = "是否启用手机短信通知?";
            cb.Checked = mynde.SMSEnable;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            tb      = new TextBox();
            tb.ID   = "TB_" + FrmEventAttr.SMSDoc;
            tb.Text = mynde.SMSDoc_Real;
            tb.Style.Add("width", "99%");
            tb.Rows = 2;
            this.Pub1.AddTR();
            if (string.IsNullOrEmpty(tb.Text) == true)
            {
                this.Pub1.AddTD("短信模版:");
            }
            else
            {
                this.Pub1.AddTD("短信模版");
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("默认:启用");
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmEventAttr.MobilePushEnable;
            cb.Text    = "是否启用手机应用,平板应用信息推送?";
            cb.Checked = mynde.MobilePushEnable;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();

            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Click);
            Pub1.Add(btn);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "Del")
            {
                FrmEvent delFE = new FrmEvent();
                delFE.MyPK = this.FK_MapData + "_" + this.Request.QueryString["RefXml"];
                delFE.Delete();
            }

            MapDtl dtl = new MapDtl(this.FK_MapData);

            this.Pub3.AddCaptionLeft("从表:" + dtl.Name);

            this.Title = "设置:从表事件";
            FrmEvents ndevs = new FrmEvents();

            ndevs.Retrieve(FrmEventAttr.FK_MapData, this.FK_MapData);
            EventListDtls xmls = new EventListDtls();

            xmls.RetrieveAll();

            string myEvent = this.Event;

            BP.WF.XML.EventListDtl myEnentXml = null;

            this.Pub1.Add("<a href='http://ccflow.org' target=_blank ><img src='/DataUser/ICON/" + SystemConfig.CompanyID + "/LogBiger.png' /></a>");
            this.Pub1.AddUL();
            foreach (BP.WF.XML.EventListDtl xml in xmls)
            {
                FrmEvent nde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, xml.No) as FrmEvent;
                if (nde == null)
                {
                    if (myEvent == xml.No)
                    {
                        myEnentXml = xml;
                        this.Pub1.AddLi("<font color=green><b>" + xml.Name + "</b></font>");
                    }
                    else
                    {
                        this.Pub1.AddLi("Action.aspx?FK_MapData=" + this.FK_MapData + "&Event=" + xml.No, xml.Name);
                    }
                }
                else
                {
                    if (myEvent == xml.No)
                    {
                        myEnentXml = xml;
                        this.Pub1.AddLi("<font color=green><b>" + xml.Name + "</b></font>");
                    }
                    else
                    {
                        this.Pub1.AddLi("Action.aspx?FK_MapData=" + this.FK_MapData + "&Event=" + xml.No + "&MyPK=" + nde.MyPK, "<b>" + xml.Name + "</b>");
                    }
                }
            }
            this.Pub1.AddULEnd();

            if (myEnentXml == null)
            {
                this.Pub2.AddFieldSet("帮助");
                this.Pub2.AddH2("事件是ccflow与您的应用程序接口,");
                this.Pub2.AddFieldSetEnd();
                return;
            }

            FrmEvent mynde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, myEvent) as FrmEvent;

            if (mynde == null)
            {
                mynde = new FrmEvent();
            }

            this.Pub2.AddFieldSet(myEnentXml.Name);
            this.Pub2.Add("要执行的内容<br>");
            TextBox tb = new TextBox();

            tb.ID       = "TB_Doc";
            tb.Columns  = 70;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 5;
            tb.Text     = mynde.DoDoc;
            this.Pub2.Add(tb);
            this.Pub2.AddHR();

            this.Pub2.Add("内容类型:");
            DDL ddl = new DDL();

            ddl.BindSysEnum("EventDoType");
            ddl.ID = "DDL_EventDoType";
            ddl.SetSelectItem((int)mynde.HisDoType);
            this.Pub2.Add(ddl);
            this.Pub2.AddHR();

            tb          = new TextBox();
            tb.ID       = "TB_MsgOK";
            tb.Columns  = 70;
            tb.Text     = mynde.MsgOKString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;

            this.Pub2.Add("执行成功信息提示<br>");
            this.Pub2.Add(tb);
            this.Pub2.AddHR();

            this.Pub2.Add("执行失败信息提示<br>");
            tb          = new TextBox();
            tb.ID       = "TB_MsgErr";
            tb.Columns  = 70;
            tb.Text     = mynde.MsgErrorString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;
            this.Pub2.Add(tb);
            this.Pub2.AddFieldSetEnd();

            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = "  Save  ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub2.Add(btn);

            if (this.MyPK != null)
            {
                this.Pub2.Add("&nbsp;&nbsp;<a href=\"javascript:DoDel('" + this.FK_MapData + "','" + this.Event + "')\"><img src='/WF/Img/Btn/Delete.gif' />删除</a>");
            }
        }
コード例 #3
0
        public void BindEdit(MapData md, MapDtl dtl)
        {
            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("从表属性");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("备注");
            this.Pub1.AddTREnd();

            int idx = 1;

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表英文名称");
            TB tb = new TB();

            tb.ID   = "TB_No";
            tb.Text = dtl.No;
            if (this.DoType == "Edit")
            {
                tb.Enabled = false;
            }
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            //this.Pub1.AddTD("英文名称全局唯一");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表中文名称");
            tb      = new TB();
            tb.ID   = "TB_Name";
            tb.Text = dtl.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("XX 从表");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("物理表名");
            tb      = new TB();
            tb.ID   = "TB_PTable";
            tb.Text = dtl.PTable;

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            //this.Pub1.AddTD("存储数据的物理表名称");
            //  this.Pub1.AddTD("存储数据的物理表名称");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("操作权限");
            DDL ddl = new DDL();

            ddl.BindSysEnum(MapDtlAttr.DtlOpenType, (int)dtl.DtlOpenType);
            ddl.ID = "DDL_DtlOpenType";
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            // this.Pub1.AddTD("用于从表的权限控制");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            CheckBox cb = new CheckBox();

            cb.ID      = "CB_IsView";
            cb.Text    = "是否可见";
            cb.Checked = dtl.IsView;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsUpdate";
            cb.Text    = "是否可以修改行"; // "是否可以修改行";
            cb.Checked = dtl.IsUpdate;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsInsert";
            cb.Text    = "是否可以新增行"; // "是否可以新增行";
            cb.Checked = dtl.IsInsert;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsDelete";
            cb.Text    = "是否可以删除行"; // "是否可以删除行";
            cb.Checked = dtl.IsDelete;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowIdx";
            cb.Text    = "是否显示序号列"; //"是否显示序号列";
            cb.Checked = dtl.IsShowIdx;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowSum";
            cb.Text    = "是否合计行";// "是否合计行";
            cb.Checked = dtl.IsShowSum;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsShowTitle";
            cb.Text    = "是否显示标头";// "是否显示标头";
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsExp";
            cb.Text    = "是否可以导出?";// "是否可以导出";
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsImp";
            cb.Text    = "是否可以导入?";// "是否可以导出";
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsCopyNDData";
            cb.Text    = "是允许从上一个节点Copy数据";
            cb.Checked = dtl.IsCopyNDData;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsHLDtl";
            cb.Text    = "是否是合流汇总从表(当前节点是合流节点有效)";
            cb.Checked = dtl.IsHLDtl;
            this.Pub1.AddTD("colspan=2", cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsEnableAthM";
            cb.Text    = "是否启用多附件";
            cb.Checked = dtl.IsEnableAthM;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2M;
            cb.Text    = "是否启用一对多";
            cb.Checked = dtl.IsEnableM2M;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2MM;
            cb.Text    = "是否启用一对多多";
            cb.Checked = dtl.IsEnableM2MM;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsEnablePass";
            cb.Text    = "是否起用审核字段?";// "是否合计行";
            cb.Checked = dtl.IsEnablePass;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();


            //cb = new CheckBox();
            //cb.ID = "CB_IsEnableAth";
            //cb.Text = "是否启用单附件";
            //cb.Checked = dtl.IsEnablePass;
            //this.Pub1.AddTD(cb);
            //this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("初始化行数");
            tb    = new TB();
            tb.ID = "TB_RowsOfList";
            tb.Attributes["class"] = "TBNum";
            tb.TextExtInt          = dtl.RowsOfList;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示格式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlShowModel";
            ddl.BindSysEnum(MapDtlAttr.DtlShowModel, (int)dtl.HisDtlShowModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("越出处理");
            ddl    = new DDL();
            ddl.ID = "DDL_WhenOverSize";
            ddl.BindSysEnum(MapDtlAttr.WhenOverSize, (int)dtl.HisWhenOverSize);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            GroupFields gfs = new GroupFields(md.No);

            if (gfs.Count > 1)
            {
                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("显示在分组");
                ddl    = new DDL();
                ddl.ID = "DDL_GroupField";
                ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, AddAllLocation.None);
                ddl.SetSelectItem(dtl.GroupID);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();
            }
            if (gfs.Count > 1)
            {
                this.Pub1.AddTR();
            }
            else
            {
                this.Pub1.AddTR1();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD("");
            this.Pub1.AddTDBegin("colspan=3 align=center");

            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose";
            btn.CssClass = "Btn";
            btn.Text     = " 保存并关闭 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            if (this.FK_MapDtl != null)
            {
                //btn = new Button();
                //btn.ID = "Btn_D";
                //btn.Text = this.ToE("DesignSheet", "设计表单"); // "设计表单";
                //btn.Click += new EventHandler(btn_Go_Click);
                //this.Pub1.Add(btn);

                btn          = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";
                btn.Text     = "删除"; // "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.Add(btn);


                btn          = new Button();
                btn.ID       = "Btn_New";
                btn.CssClass = "Btn";
                btn.Text     = "新建"; // "删除";
                btn.Click   += new EventHandler(btn_New_Click);
                this.Pub1.Add(btn);

                btn          = new Button();
                btn.ID       = "Btn_MapExt";
                btn.CssClass = "Btn";
                btn.Text     = "扩展设置"; // "删除";

                btn.Click += new EventHandler(btn_MapExt_Click);
                this.Pub1.Add(btn);

                if (dtl.IsEnableAthM)
                {
                    btn          = new Button();
                    btn.CssClass = "Btn";
                    btn.ID       = "Btn_IsEnableAthM";
                    btn.Text     = "附件属性"; // "删除";
                    btn.Click   += new EventHandler(btn_MapAth_Click);
                    this.Pub1.Add(btn);
                }

                // btn = new Button();
                // btn.ID = "Btn_DtlTR";
                // btn.Text = "多表头";
                // btn.Attributes["onclick"] = "javascript:WinOpen('')";
                //// btn.Click += new EventHandler(btn_DtlTR_Click);
                // this.Pub1.Add(btn);
            }
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mapAttr"></param>
        public void EditString(MapAttr mapAttr)
        {
            this.EditBeforeAdd(mapAttr);
            TB tb = new TB();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("最小长度");
            tb          = new TB();
            tb.ID       = "TB_MinLen";
            tb.CssClass = "TBNum";
            tb.Text     = mapAttr.MinLen.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("最大长度");
            tb          = new TB();
            tb.ID       = "TB_MaxLen";
            tb.CssClass = "TBNum";
            tb.Text     = mapAttr.MaxLen.ToString();

            //DDL cb = new DDL();
            //cb.ID = "DDL_TBType";
            //cb.Items.Add(new ListItem("单行文本框", "0"));
            //cb.Items.Add(new ListItem("多行文本框", "1"));
            //cb.Items.Add(new ListItem("Sina编辑框", "2"));
            //cb.Items.Add(new ListItem("FCKEditer编辑框", "3"));

            this.Pub1.AddTD(tb);

            DDL ddlBig = new DDL();

            ddlBig.ID = "DDL_TBModel";
            ddlBig.BindSysEnum("TBModel", mapAttr.TBModel);
            ddlBig.AutoPostBack          = true;
            ddlBig.SelectedIndexChanged += new EventHandler(ddlBig_SelectedIndexChanged);

            CheckBox cb = new CheckBox();

            cb.ID      = "CB_IsBigField";
            cb.Text    = "是否是超长字段";
            cb.Checked = mapAttr.Para_IsImgField;


            this.Pub1.AddTDBegin();
            this.Pub1.Add(ddlBig);
            this.Pub1.Add(cb);
            // this.Pub1.Add("<a href=''>关于超长字段</a>");
            this.Pub1.AddTDEnd();

            // this.Pub1.AddTD(ddlBig);

            //CheckBox cb = new CheckBox();
            //cb.CheckedChanged += new EventHandler(cb_CheckedChanged);
            //cb.ID = "CB_IsM";
            //cb.Text = this.ToE("IsBigDoc", "是否大块文本(对傻瓜表单有效)");
            //cb.AutoPostBack = true;
            //if (mapAttr.MaxLen >= 3000)
            //{
            //    cb.Checked = true;
            //    tb.Enabled = false;
            //}
            //else
            //{
            //    cb.Checked = false;
            //    tb.Enabled = true;
            //}
            //this.Pub1.AddTD(cb);
            //if (mapAttr.IsTableAttr)
            //    cb.Enabled = false;

            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("文本框宽度");
            tb          = new TB();
            tb.ID       = "TB_UIWidth";
            tb.CssClass = "TBNum";
            tb.Text     = mapAttr.UIWidth.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTDB("对从表有效");
            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("高度");
            tb          = new TB();
            tb.ID       = "TB_UIHeight";
            tb.CssClass = "TBNum";
            tb.Text     = mapAttr.UIHeight.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            this.EditBeforeEnd(mapAttr);
        }
コード例 #5
0
ファイル: Dtl.ascx.cs プロジェクト: zhaoyingju/ccflow
        public void Bind()
        {
            #region 生成标题
            Entity en    = this.HisEn;
            Map    map   = this.HisEn.EnMap;
            Attrs  attrs = map.Attrs;
            bool   isFJ  = false;
            if (attrs.Contains("MyFileName"))
            {
                isFJ = true;
            }

            this.ucsys1.AddTable();
            this.ucsys1.AddTR();
            this.ucsys1.AddTDTitle();

            string str1 = "<INPUT id='checkedAll' onclick='SelectAll(this);' type='checkbox' name='checkedAll'>";
            this.ucsys1.AddTDTitle(str1);
            foreach (Attr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                this.ucsys1.AddTDTitle(attr.Desc);
            }
            if (isFJ)
            {
                this.ucsys1.AddTDTitle();
            }

            this.ucsys1.AddTREnd();
            #endregion 生成标题

            this.Page.Title = en.EnDesc;

            Entities    dtls = this.HisEns;
            QueryObject qo   = new QueryObject(dtls);
            qo.AddWhere(this.RefKey, this.RefVal);

            #region 生成翻页
            this.ucsys2.Clear();
            try
            {
                this.ucsys2.BindPageIdx(qo.GetCount(), BP.SystemConfig.PageSize, this.PageIdx, "Dtl.aspx?EnName=" + this.EnName + "&PK=" + this.RefVal + "&EnsName=" + this.EnsName + "&RefVal=" + this.RefVal + "&RefKey=" + this.RefKey + "&MainEnsName=" + this.MainEnsName);
                qo.DoQuery(en.PK, this.PageSize, this.PageIdx, false);
            }
            catch
            {
                dtls.GetNewEntity.CheckPhysicsTable();
                //   this.Response.Redirect("Ens.aspx?EnsName=" + this.EnsName + "&RefPKVal=" + this.RefPKVal, true);
                return;
            }
            #endregion 生成翻页
            UAC uac = en.HisUAC;
            if (uac.IsDelete == false)
            {
                this.ToolBar1.GetBtnByID(NamesOfBtn.Delete).Enabled = false;
            }

            if (uac.IsInsert)
            {
                en.PKVal = "0";
                dtls.AddEntity(en);
            }

            DDL      ddl = new DDL();
            CheckBox cb  = new CheckBox();
            bool     is1 = false;

            #region 生成数据
            int i = 0;
            foreach (Entity dtl in dtls)
            {
                i++;
                if (dtl.PKVal == "0" || dtl.PKVal == "")
                {
                    this.ucsys1.AddTRSum();
                    this.ucsys1.AddTD("colspan=2", "<b>*</B>");
                }
                else
                {
                    //  is1 = this.ucsys1.AddTR(is1, "ondblclick=\"WinOpen( 'UIEn.aspx?EnsName=" + this.EnsName + "&PK=" + dtl.PKVal + "', 'cd' )\"");
                    is1 = this.ucsys1.AddTR(is1);

                    //  is1 = this.ucsys1.AddTR(is1);
                    this.ucsys1.AddTDIdx(i);
                    cb    = new CheckBox();
                    cb.ID = "CB_" + dtl.PKVal;
                    this.ucsys1.AddTD(cb);
                }

                foreach (Attr attr in attrs)
                {
                    if (attr.UIVisible == false)
                    {
                        continue;
                    }

                    if (attr.Key == "OID")
                    {
                        continue;
                    }

                    string val = dtl.GetValByKey(attr.Key).ToString();
                    switch (attr.UIContralType)
                    {
                    case UIContralType.TB:
                        TB tb = new TB();
                        this.ucsys1.AddTD(tb);
                        tb.LoadMapAttr(attr);
                        tb.ID = "TB_" + attr.Key + "_" + dtl.PKVal;
                        tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border-width:0px;";
                        switch (attr.MyDataType)
                        {
                        case DataType.AppMoney:
                        case DataType.AppRate:
                            tb.TextExtMoney = decimal.Parse(val);
                            break;

                        case DataType.AppDate:
                            tb.Text     = val.ToString();
                            tb.ShowType = TBType.Date;
                            if (attr.UIIsReadonly == false)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker();";
                            }
                            break;

                        case DataType.AppDateTime:
                            tb.Text     = val.ToString();
                            tb.ShowType = TBType.DateTime;
                            if (attr.UIIsReadonly == false)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                            }
                            break;

                        default:
                            tb.Text = val;
                            break;
                        }

                        if (attr.IsNum && attr.IsFKorEnum == false)
                        {
                            if (tb.Enabled)
                            {
                                // OnKeyPress="javascript:return VirtyNum(this);"
                                //  tb.Attributes["OnKeyDown"] = "javascript:return VirtyNum(this);";
                                // tb.Attributes["onkeyup"] += "javascript:C" + dtl.PKVal + "();C" + attr.Key + "();";
                                tb.Attributes["class"] = "TBNum";
                            }
                            else
                            {
                                //   tb.Attributes["onpropertychange"] += "C" + attr.Key + "();";
                                tb.Attributes["class"] = "TBNumReadonly";
                            }
                        }
                        break;

                    case UIContralType.DDL:
                        ddl    = new DDL();
                        ddl.ID = "DDL_" + attr.Key + "_" + dtl.PKVal;
                        if (attr.UIIsReadonly == false)
                        {
                            ddl.Items.Add(new ListItem(dtl.GetValRefTextByKey(attr.Key), val));
                            ddl.Enabled = false;
                        }
                        else
                        {
                            if (attr.IsEnum)
                            {
                                ddl.BindSysEnum(attr.UIBindKey);
                            }
                            else
                            {
                                ddl.BindEntities(attr.HisFKEns, attr.UIRefKeyValue, attr.UIRefKeyText);
                            }
                        }
                        this.ucsys1.AddTD(ddl);
                        ddl.SetSelectItem(val);
                        break;

                    case UIContralType.CheckBok:
                        cb      = new CheckBox();
                        cb.ID   = "CB_" + attr.Key + "_" + dtl.PKVal;
                        cb.Text = attr.Desc;
                        if (val == "1")
                        {
                            cb.Checked = true;
                        }
                        else
                        {
                            cb.Checked = false;
                        }
                        this.ucsys1.AddTD("nowarp=true", cb);
                        break;

                    default:
                        break;
                    }
                }

                if (isFJ)
                {
                    string ext = dtl.GetValStrByKey("MyFileExt");
                    if (ext != "")
                    {
                        this.ucsys1.AddTD("<img src='../Images/FileType/" + ext + ".gif' border=0/>" + dtl.GetValStrByKey("MyFileName"));
                    }
                }
                this.ucsys1.AddTREnd();
            }
            #region 生成合计
            //this.ucsys1.AddTRSum();
            //this.ucsys1.AddTD("colspan=2", "合计");
            //foreach (Attr attr in attrs)
            //{
            //    if (attr.UIVisible == false)
            //        continue;
            //    if (attr.IsNum && attr.IsFKorEnum == false)
            //    {
            //        TB tb = new TB();
            //        tb.ID = "TB_" + attr.Key;
            //        tb.Text = attr.DefaultVal.ToString();
            //        tb.ShowType = attr.HisTBType;
            //        tb.ReadOnly = true;
            //        tb.Font.Bold = true;
            //        tb.BackColor = System.Drawing.Color.FromName("infobackground");

            //        switch (attr.MyDataType)
            //        {
            //            case DataType.AppRate:
            //            case DataType.AppMoney:
            //                tb.TextExtMoney = dtls.GetSumDecimalByKey(attr.Key);
            //                break;
            //            case DataType.AppInt:
            //                tb.TextExtInt = dtls.GetSumIntByKey(attr.Key);
            //                break;
            //            case DataType.AppFloat:
            //                tb.TextExtFloat = dtls.GetSumFloatByKey(attr.Key);
            //                break;
            //            default:
            //                break;
            //        }
            //        this.ucsys1.AddTD(tb);
            //    }
            //    else
            //    {
            //        this.ucsys1.AddTD();
            //    }
            //}
            //this.ucsys1.AddTD();
            //this.ucsys1.AddTREnd();
            #endregion 生成合计

            #endregion 生成数据
            this.ucsys1.AddTableEnd();
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PushMsgs msgs = new PushMsgs(this.FK_Flow);
            var      msg  = msgs.GetEntityByKey(PushMsgAttr.FK_Event, this.Event, PushMsgAttr.FK_Node, int.Parse(this.NodeID)) as PushMsg;

            if (msg == null)
            {
                msg          = new PushMsg();
                msg.FK_Event = this.Event;
                msg.FK_Node  = int.Parse(this.NodeID);
            }

            if (!string.IsNullOrWhiteSpace(this.ThePushWay))
            {
                if (this.ThePushWay != msg.PushWay.ToString())
                {
                    msg.PushDoc = string.Empty;
                    msg.Tag     = string.Empty;
                }

                msg.PushWay = int.Parse(this.ThePushWay);
            }

            this.Pub1.AddTable("class='Table' cellspacing='1' cellpadding='1' border='1' style='width:100%'");

            this.Pub1.AddTR();
            this.Pub1.AddTD("style='width:100px'", "推送设置方式:");
            var ddl = new DDL();

            ddl.BindSysEnum(PushMsgAttr.PushWay);
            ddl.ID = "DDL_" + PushMsgAttr.PushWay;
            ddl.SetSelectItem((int)msg.PushWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            switch ((PushWay)msg.PushWay)
            {
            case PushWay.ByParas:

                #region  照系统指定参数

                Pub1.AddTR();
                Pub1.AddTD("输入参数名:");
                Pub1.AddTDBegin();

                var rad = new RadioBtn();
                rad.GroupName = "Para";
                rad.ID        = "RB_0";
                rad.Text      = "系统参数";
                rad.Checked   = msg.PushDoc == "0";

                Pub1.Add(rad);

                var tb = new TB();
                tb.ID = "TB_" + PushMsgAttr.Tag;

                if (msg.PushDoc == "0")
                {
                    tb.Text = msg.Tag;
                }
                else
                {
                    tb.Text = "NoticeTo";
                }

                Pub1.Add(tb);

                Pub1.Add("&nbsp;默认为NoticeTo");
                Pub1.AddBR();

                rad           = new RadioBtn();
                rad.GroupName = "Para";
                rad.ID        = "RB_1";
                rad.Text      = "表单字段参数";
                rad.Checked   = msg.PushDoc == "1";

                Pub1.Add(rad);

                MapAttrs attrs = new MapAttrs();
                attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + this.NodeID);

                MapAttrs attrNs = new MapAttrs();

                foreach (MapAttr attr in attrs)
                {
                    if (attr.IsBigDoc)
                    {
                        continue;
                    }

                    switch (attr.KeyOfEn)
                    {
                    case "Title":
                    case "FK_Emp":
                    case "MyNum":
                    case "FK_NY":
                    case WorkAttr.Emps:
                    case WorkAttr.OID:
                    case StartWorkAttr.Rec:
                    case StartWorkAttr.FID:
                        continue;

                    default:
                        break;
                    }

                    attrNs.AddEntity(attr);
                }

                ddl    = new DDL();
                ddl.ID = "DDL_" + PushMsgAttr.Tag;
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack = false;

                if (msg.PushDoc == "1")
                {
                    ddl.SetSelectItem(msg.Tag);
                }

                Pub1.Add(ddl);
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.NodeWorker:

                #region  照指定结点的工作人员

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                Pub1.Add("请选择要推送到的节点工作人员:<br />");
                Nodes    nds = new Nodes(this.FK_Flow);
                CheckBox cb  = null;

                foreach (BP.WF.Node nd in nds)
                {
                    if (nd.NodeID == int.Parse(this.NodeID))
                    {
                        continue;
                    }

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + nd.NodeID;
                    cb.Text    = nd.NodeID + " &nbsp;" + nd.Name;
                    cb.Checked = msg.PushDoc.Contains("@" + nd.NodeID + "@");
                    Pub1.Add(cb);
                    Pub1.AddBR();
                }

                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecDepts:

                #region  照指定的部门

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                this.Pub1.AddTR();
                this.Pub1.AddTD("colspan='3' class='GroupTitle'", "部门选择");
                this.Pub1.AddTREnd();

                //NodeDepts ndepts = new NodeDepts(int.Parse(this.NodeID));
                Depts depts = new Depts();
                depts.RetrieveAll();
                int i = 0;

                //foreach (NodeDept dept in ndepts)
                foreach (Dept dept in depts)
                {
                    i++;

                    if (i == 4)
                    {
                        i = 1;
                    }

                    if (i == 1)
                    {
                        Pub1.AddTR();
                    }

                    cb = new CheckBox();
                    //cb.ID = "CB_" + dept.FK_Dept;
                    //cb.Text = (depts.GetEntityByKey(dept.FK_Dept) as Dept).Name;
                    cb.ID   = "CB_" + dept.No;
                    cb.Text = dept.Name;

                    //if (msg.PushDoc.Contains("@" + dept.FK_Dept + "@"))
                    if (msg.PushDoc.Contains("@" + dept.No + "@"))
                    {
                        cb.Checked = true;
                    }

                    this.Pub1.AddTD(cb);

                    if (i == 3)
                    {
                        Pub1.AddTREnd();
                    }
                }

                switch (i)
                {
                case 1:
                    Pub1.AddTD();
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                case 2:
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                default:
                    break;
                }

                this.Pub1.AddTableEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecEmps:

                #region  照指定的人员

                Pub1.AddTR();
                //Pub1.AddTDBegin("colspan='2'");

                Pub1.AddTD("选择人员:");
                Pub1.AddTDBegin();

                tb          = new TB();
                tb.ID       = "TB_Users";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Style.Add("width", "99%");
                tb.Rows     = 4;
                tb.ReadOnly = true;

                var hf = new HiddenField();
                hf.ID = "HID_Users";

                //加载已经选择的人员
                if (!string.IsNullOrWhiteSpace(msg.PushDoc))
                {
                    hf.Value = msg.PushDoc.Replace("@@", ",").Trim('@');

                    var emps = new Emps();
                    emps.RetrieveAll();

                    tb.Text =
                        hf.Value.Split(',').Select(o => (emps.GetEntityByKey(o) as Emp).Name).Aggregate(
                            string.Empty, (curr, next) => curr + next + ",").TrimEnd(',');
                }

                Pub1.Add(tb);
                Pub1.Add(hf);
                Pub1.AddBR();
                Pub1.AddBR();

                Pub1.Add(
                    "<a class='easyui-linkbutton' data-options=\"iconCls:'icon-user'\" href='javascript:void(0)' onclick=\"showWin('../Comm/Port/SelectUser_Jq.aspx','" +
                    tb.ClientID + "','" + hf.ClientID + "');\">选择人员...</a>");
                Pub1.AddTDEnd();
                //Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                //depts = new Depts();
                //depts.RetrieveAll();
                //var emps = new Emps();
                //emps.RetrieveAll();
                //var empDepts = new EmpDepts();
                //empDepts.RetrieveAll();
                //var nemps = new NodeEmps(int.Parse(this.NodeID));

                //Emp emp = null;

                //foreach (Dept dept in depts)
                //{
                //    this.Pub1.AddTR();
                //    var mycb = new CheckBox();
                //    mycb.Text = dept.Name;
                //    mycb.ID = "CB_D_" + dept.No;
                //    this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                //    this.Pub1.AddTREnd();

                //    i = 0;
                //    string ctlIDs = "";

                //    foreach (EmpDept ed in empDepts)
                //    {
                //        if (ed.FK_Dept != dept.No)
                //            continue;

                //        //排除非当前结点绑定的人员
                //        if (nemps.GetEntityByKey(NodeEmpAttr.FK_Emp, ed.FK_Emp) == null)
                //            continue;

                //        i++;

                //        if (i == 4)
                //            i = 1;

                //        if (i == 1)
                //            Pub1.AddTR();

                //        emp = emps.GetEntityByKey(ed.FK_Emp) as Emp;

                //        cb = new CheckBox();
                //        cb.ID = "CB_E_" + emp.No;
                //        ctlIDs += cb.ID + ",";
                //        cb.Text = emp.Name;
                //        if (msg.PushDoc.Contains("@" + emp.No + "@"))
                //            cb.Checked = true;

                //        Pub1.AddTD(cb);

                //        if (i == 3)
                //            Pub1.AddTREnd();
                //    }

                //    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                //    switch (i)
                //    {
                //        case 1:
                //            Pub1.AddTD();
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        case 2:
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        default:
                //            break;
                //    }
                //}

                //Pub1.AddTableEnd();

                //Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecSQL:

                #region  照指定的SQL查询语句

                Pub1.AddTR();

                this.Pub1.AddTDBegin("colspan='2'");
                this.Pub1.Add("SQL查询语句:<br />");
                tb         = new TB();
                tb.ID      = "TB_" + PushMsgAttr.PushDoc;
                tb.Columns = 50;
                tb.Style.Add("width", "99%");
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Rows     = 4;
                tb.Text     = msg.PushDoc;
                this.Pub1.Add(tb);
                this.Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecStations:

                #region  照指定的岗位

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                if (BP.WF.Glo.OSModel == OSModel.WorkFlow)
                {
                    SysEnums ses = new SysEnums("StaGrade");
                    Stations sts = new Stations();
                    sts.RetrieveAll();

                    string    sql = "SELECT No,Name FROM Port_Station WHERE StaGrade  NOT IN (SELECT IntKey FROM Sys_Enum WHERE EnumKey='StaGrade')";
                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    if (dt.Rows.Count != 0)
                    {
                        if (ses.Count == 0)
                        {
                            SysEnum se = new SysEnum();
                            se.EnumKey = "StaGrade";
                            se.Lab     = "普通岗";
                            se.IntKey  = 0;
                            se.Insert();

                            ses.AddEntity(se);
                        }

                        foreach (Station st in sts)
                        {
                            st.StaGrade = 0;
                            st.Save();
                        }
                    }

                    this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                    foreach (SysEnum se in ses)
                    {
                        this.Pub1.AddTR();
                        CheckBox mycb = new CheckBox();
                        mycb.Text = se.Lab;
                        mycb.ID   = "CB_SG_" + se.IntKey;
                        this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                        this.Pub1.AddTREnd();

                        i = 0;
                        string ctlIDs = "";

                        foreach (Station st in sts)
                        {
                            if (st.StaGrade != se.IntKey)
                            {
                                continue;
                            }

                            i++;

                            if (i == 4)
                            {
                                i = 1;
                            }

                            if (i == 1)
                            {
                                Pub1.AddTR();
                            }

                            cb      = new CheckBox();
                            cb.ID   = "CB_S_" + st.No;
                            ctlIDs += cb.ID + ",";
                            cb.Text = st.Name;

                            if (msg.PushDoc.Contains("@" + st.No + "@"))
                            {
                                cb.Checked = true;
                            }

                            Pub1.AddTD(cb);

                            if (i == 3)
                            {
                                Pub1.AddTREnd();
                            }
                        }

                        mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                        switch (i)
                        {
                        case 1:
                            Pub1.AddTD();
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        case 2:
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        default:
                            break;
                        }
                    }

                    this.Pub1.AddTableEnd();
                }
                else
                {
                    /*BPM 模式*/
                    BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
                    tps.RetrieveAll();

                    BP.GPM.Stations sts = new BP.GPM.Stations();
                    sts.RetrieveAll();

                    string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    if (dt.Rows.Count != 0)
                    {
                        if (tps.Count == 0)
                        {
                            var stp = new BP.GPM.StationType {
                                No = "01", Name = "普通岗"
                            };
                            stp.Save();

                            tps.AddEntity(stp);
                        }

                        //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                        foreach (BP.GPM.Station st in sts)
                        {
                            st.FK_StationType = tps[0].No;
                            st.Update();
                        }
                    }

                    this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                    foreach (BP.GPM.StationType tp in tps)
                    {
                        this.Pub1.AddTR();
                        CheckBox mycb = new CheckBox();
                        mycb.Text = tp.Name;
                        mycb.ID   = "CB_ST_" + tp.No;
                        this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                        this.Pub1.AddTREnd();

                        i = 0;
                        string ctlIDs = "";

                        foreach (BP.GPM.Station st in sts)
                        {
                            if (st.FK_StationType != tp.No)
                            {
                                continue;
                            }

                            i++;

                            if (i == 4)
                            {
                                i = 1;
                            }

                            if (i == 1)
                            {
                                Pub1.AddTR();
                            }

                            cb      = new CheckBox();
                            cb.ID   = "CB_S_" + st.No;
                            ctlIDs += cb.ID + ",";
                            cb.Text = st.Name;

                            if (msg.PushDoc.Contains("@" + st.No + "@"))
                            {
                                cb.Checked = true;
                            }

                            this.Pub1.AddTD(cb);

                            if (i == 3)
                            {
                                Pub1.AddTREnd();
                            }
                        }

                        mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                        switch (i)
                        {
                        case 1:
                            Pub1.AddTD();
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        case 2:
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        default:
                            break;
                        }
                    }

                    this.Pub1.AddTableEnd();
                }

                #region 原逻辑,只考虑了一种模式,停用
                //Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                //SysEnums ses = new SysEnums("StaGrade");
                //Stations sts = new Stations();
                //NodeStations nsts = new NodeStations(int.Parse(this.NodeID));
                //sts.RetrieveAll();

                //foreach (SysEnum se in ses)
                //{
                //    this.Pub1.AddTR();
                //    var mycb = new CheckBox();
                //    mycb.Text = se.Lab;
                //    mycb.ID = "CB_SG_" + se.IntKey;
                //    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                //    this.Pub1.AddTREnd();

                //    i = 0;
                //    string ctlIDs = "";

                //    foreach (Station st in sts)
                //    {
                //        if (st.StaGrade != se.IntKey)
                //            continue;

                //        //排除非当前结点的岗位
                //        if (nsts.GetEntityByKey(NodeStationAttr.FK_Station, st.No) == null)
                //            continue;

                //        i++;

                //        if (i == 4)
                //            i = 1;

                //        if (i == 1)
                //            Pub1.AddTR();

                //        cb = new CheckBox();
                //        cb.ID = "CB_S_" + st.No;
                //        ctlIDs += cb.ID + ",";
                //        cb.Text = st.Name;
                //        if (msg.PushDoc.Contains("@" + st.No + "@"))
                //            cb.Checked = true;

                //        Pub1.AddTD(cb);

                //        if (i == 3)
                //            Pub1.AddTREnd();
                //    }

                //    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                //    switch (i)
                //    {
                //        case 1:
                //            Pub1.AddTD();
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        case 2:
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        default:
                //            break;
                //    }
                //}
                //Pub1.AddTableEnd();
                #endregion

                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;
            }

            Pub1.AddTableEnd();

            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Click);
            Pub1.Add(btn);

            if (!string.IsNullOrWhiteSpace(msg.MyPK))
            {
                Pub1.AddSpace(1);
                btn        = new LinkBtn(false, NamesOfBtn.Delete, "删除");
                btn.Click += new EventHandler(btn_Delete_Click);
                btn.Attributes["onclick"] = "return confirm('你确定要删除此消息推送设置吗?');";
                Pub1.Add(btn);
            }
        }
コード例 #7
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            Cond cond = new Cond();

            cond.MyPK = this.MyPK;
            if (cond.RetrieveFromDBSources() == 0)
            {
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
                if (this.FK_MainNode != 0)
                {
                    cond.NodeID = this.FK_MainNode;
                }
                if (this.FK_Node != 0)
                {
                    cond.FK_Node = this.FK_Node;
                }
                if (this.FK_Flow != null)
                {
                    cond.FK_Flow = this.FK_Flow;
                }
            }
            //this.AddTable("border=0 widht='500px'");
            this.AddTable("class='Table' cellpadding='2' cellspacing='2' style='width:100%;'");
            this.AddTR();
            this.AddTD("class='GroupTitle' style='width:80px'", "项目");
            this.AddTD("class='GroupTitle' style='width:200px'", "采集");
            this.AddTD("class='GroupTitle'", "描述");
            this.AddTREnd();

            this.AddTR();
            this.AddTD("节点");
            Nodes nds  = new Nodes(cond.FK_Flow);
            Nodes ndsN = new Nodes();

            foreach (BP.WF.Node mynd in nds)
            {
                ndsN.AddEntity(mynd);
            }
            DDL ddl = new DDL();

            ddl.ID = "DDL_Node";
            ddl.BindEntities(ndsN, "NodeID", "Name");
            ddl.SetSelectItem(cond.FK_Node);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.AddTD(ddl);
            this.AddTD("节点");
            this.AddTREnd();

            // 属性/字段
            MapAttrs attrs = new MapAttrs();

            attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + ddl.SelectedItemStringVal);

            MapAttrs attrNs = new MapAttrs();

            foreach (MapAttr attr in attrs)
            {
                if (attr.IsBigDoc)
                {
                    continue;
                }

                switch (attr.KeyOfEn)
                {
                case "Title":
                //case "RDT":
                //case "CDT":
                case "FK_Emp":
                case "MyNum":
                case "FK_NY":
                case WorkAttr.Emps:
                case WorkAttr.OID:
                case StartWorkAttr.Rec:
                case StartWorkAttr.FID:
                    continue;

                default:
                    break;
                }
                attrNs.AddEntity(attr);
            }
            ddl    = new DDL();
            ddl.ID = "DDL_Attr";
            if (attrNs.Count == 0)
            {
                BP.WF.Node nd = new BP.WF.Node(cond.FK_Node);
                nd.RepareMap();
                this.AddTR();
                this.AddTD("");
                this.AddTD("colspan=2", "节点没有找到合适的条件");
                this.AddTREnd();
                this.AddTableEnd();
                return;
            }
            else
            {
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                ddl.SetSelectItem(cond.FK_Attr);
            }

            this.AddTR();
            this.AddTD("属性/字段");
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.AddTR();
            this.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                ddl.Items.Add(new ListItem("<>", "<>"));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;
                }
                break;

            default:
                break;
            }

            if (cond != null)
            {
                try
                {
                    ddl.SetSelectItem(cond.OperatorValueInt);
                }
                catch
                {
                }
            }
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.AddTR();
                this.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.UIBindKey);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.AddTR();
                this.AddTD("值");

                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.AddTR();
                    this.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.AddTD(ddl);
                    this.AddTD();
                    this.AddTREnd();
                }
                else
                {
                    this.AddTR();
                    this.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.AddTD(tb);
                    this.AddTD();
                    this.AddTREnd();
                }
                break;
            }


            Conds       conds = new Conds();
            QueryObject qo    = new QueryObject(conds);

            qo.AddWhere(CondAttr.NodeID, this.FK_MainNode);
            qo.addAnd();
            qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.Form);
            qo.addAnd();
            qo.AddWhere(CondAttr.CondType, (int)this.HisCondType);

            if (this.ToNodeID != 0)
            {
                qo.addAnd();
                qo.AddWhere(CondAttr.ToNodeID, this.ToNodeID);
            }
            int num = qo.DoQuery();

            this.AddTableEnd();
            this.AddBR();
            this.AddSpace(1);

            var btn = new LinkBtn(false, "Btn_SaveAnd", "保存为And条件");

            btn.SetDataOption("iconCls", "'icon-save'");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);
            this.AddSpace(1);

            btn = new LinkBtn(false, "Btn_SaveOr", "保存为Or条件");
            btn.SetDataOption("iconCls", "'icon-save'");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);
            this.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);

            this.AddBR();
            this.AddBR();

            if (num == 0)
            {
                return;
            }

            #region 条件
            this.AddTable("class='Table' cellpadding='2' cellspacing='2' style='width:100%;'");
            this.AddTR();
            this.AddTDTitleGroup("序");
            this.AddTDTitleGroup("节点");
            this.AddTDTitleGroup("字段的英文名");
            this.AddTDTitleGroup("字段的中文名");
            this.AddTDTitleGroup("操作符");
            this.AddTDTitleGroup("值");
            this.AddTDTitleGroup("标签");
            this.AddTDTitleGroup("运算关系");
            this.AddTDTitleGroup("操作");
            this.AddTREnd();

            int i = 0;
            foreach (Cond mync in conds)
            {
                if (mync.HisDataFrom != ConnDataFrom.Form)
                {
                    continue;
                }

                i++;

                this.AddTR();
                this.AddTDIdx(i);
                //  this.AddTD(mync.HisDataFrom.ToString());
                this.AddTD(mync.FK_NodeT);
                this.AddTD(mync.AttrKey);
                this.AddTD(mync.AttrName);
                this.AddTDCenter(mync.FK_Operator);
                this.AddTD(mync.OperatorValueStr);
                this.AddTD(mync.OperatorValueT);

                if (mync.CondOrAnd == CondOrAnd.ByAnd)
                {
                    this.AddTD("AND");
                }
                else
                {
                    this.AddTD("OR");
                }

                //if (num > 1)
                //    this.AddTD(mync.HisConnJudgeWayT);
                this.AddTD("<a href='Cond.aspx?MyPK=" + mync.MyPK + "&CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_Attr=" + mync.FK_Attr + "&FK_MainNode=" + mync.NodeID + "&OperatorValue=" + mync.OperatorValueStr + "&FK_Node=" + mync.FK_Node + "&DoType=Del&ToNodeID=" + mync.ToNodeID + "' class='easyui-linkbutton' data-options=\"iconCls:'icon-remove'\" onclick=\"return confirm('确定删除此条件吗?')\">删除</a>");
                this.AddTREnd();
            }
            this.AddTableEnd();
            this.AddBR();

            AddEasyUiPanelInfo("说明", "在上面的条件集合中ccflow仅仅支持要么是And,要么是OR的两种情形,高级的开发就需要事件来支持条件转向,或者采用其他的方式。");

            #endregion
        }
コード例 #8
0
        /// <summary>
        /// 编辑权限与顺序
        /// </summary>
        public void BindEditPowerOrder()
        {
            this.Pub1.AddH2("表单权限与显示顺序");
            this.Pub1.AddHR();

            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("显示方式");
            this.Pub1.AddTDTitle("是否可编辑?");
            this.Pub1.AddTDTitle("是否可打印");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTREnd();

            FrmNodes fns = new FrmNodes(this.FK_Node);
            int      idx = 1;

            foreach (FrmNode fn in fns)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD(fn.FK_Frm);

                MapData md = new MapData(fn.FK_Frm);
                md = new MapData(fn.FK_Frm);
                // this.Pub1.AddTD(md.Name);
                this.Pub1.AddTDA("FlowFrms.aspx?ShowType=Frm&FK_MapData=" + md.No + "&FK_Node=" + this.FK_Node, md.Name);

                DDL ddl = new DDL();
                ddl.ID = "DDL_FrmType_" + fn.FK_Frm;
                ddl.BindSysEnum("FrmType", fn.FrmType);
                this.Pub1.AddTD(ddl);

                CheckBox cb = new CheckBox();
                cb.ID      = "CB_IsEdit_" + md.No;
                cb.Text    = "是否可编辑?";
                cb.Checked = fn.IsEdit;
                this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsPrint_" + md.No;
                cb.Text    = "是否可打印";
                cb.Checked = fn.IsPrint;
                this.Pub1.AddTD(cb);

                this.Pub1.AddTDA("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&MyPK=" + fn.MyPK + "&DoType=Up", "上移");
                this.Pub1.AddTDA("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&MyPK=" + fn.MyPK + "&DoType=Down", "下移");

                //  this.Pub1.AddTD("<a href='../MapDef/CCForm/Frm.aspx?FK_MapData=" + fn.FK_Frm + "'><img src='/WF/Img/Btn/View.gif' border=0 />启动自由表单设计器</a>");
                // this.Pub1.AddTD("<a href='../MapDef/MapDef.aspx?PK=" + fn.FK_Frm + "'><img src='/WF/Img/Btn/View.gif' border=0 />启动傻瓜表单设计器</a>");

                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTR();
            Button btn = new Button();

            btn.ID       = "Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);
            this.Pub1.AddTD("colspan=8", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
コード例 #9
0
        public void BindEnum(MapAttr mapAttr)
        {
            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("说明");
            this.Pub1.AddTREnd();

            bool isItem = false;

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字段中文名");
            TB tb = new TB();

            tb.ID   = "TB_Name";
            tb.Text = mapAttr.Name;
            tb.Attributes["width"] = "100%";
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字段英文名");
            tb = new TB();
            if (this.RefNo != null)
            {
                this.Pub1.AddTD(mapAttr.KeyOfEn);
            }
            else
            {
                tb      = new TB();
                tb.ID   = "TB_KeyOfEn";
                tb.Text = mapAttr.KeyOfEn;
                this.Pub1.AddTD(tb);
            }

            if (string.IsNullOrEmpty(mapAttr.KeyOfEn))
            {
                this.Pub1.AddTD("字母/数字/下划线组合");
            }
            else
            {
                this.Pub1.AddTD("<a href=\"javascript:clipboardData.setData('Text','" + mapAttr.KeyOfEn + "');alert('已经copy到粘帖版上');\" ><img src='../Img/Btn/Copy.gif' class='ICON' />复制字段名</a></TD>");
            }

            // this.Pub1.AddTDTitle("&nbsp;");
            //this.Pub1.AddTD("不要以数字开头、不要中文。");
            this.Pub1.AddTREnd();



            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("默认值");

            DDL ddl = new DDL();

            ddl.ID = "DDL";
            ddl.BindSysEnum(mapAttr.UIBindKey);
            ddl.SetSelectItem(mapAttr.DefVal);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("<a href='SysEnum.aspx?RefNo=" + mapAttr.UIBindKey + "'>编辑</a>");
            this.Pub1.AddTREnd();


            #region 是否可编辑
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("是否可编辑");
            this.Pub1.AddTDBegin();
            RadioButton rb = new RadioButton();
            rb.ID        = "RB_UIIsEnable_0";
            rb.Text      = "不可编辑";
            rb.GroupName = "s";
            if (mapAttr.UIIsEnable)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }

            this.Pub1.Add(rb);
            rb           = new RadioButton();
            rb.ID        = "RB_UIIsEnable_1";
            rb.Text      = "可编辑";
            rb.GroupName = "s";

            if (mapAttr.UIIsEnable)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();

            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            #endregion 是否可编辑


            #region 展示控件
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("控件类型");
            this.Pub1.AddTDBegin();
            rb           = new RadioButton();
            rb.ID        = "RB_Ctrl_0";
            rb.Text      = "下拉框";
            rb.GroupName = "Ctrl";
            if (mapAttr.UIContralType == UIContralType.DDL)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }
            rb.Enabled = false;
            this.Pub1.Add(rb);
            rb           = new RadioButton();
            rb.ID        = "RB_Ctrl_1";
            rb.Text      = "单选按钮";
            rb.GroupName = "Ctrl";

            if (mapAttr.UIContralType == UIContralType.DDL)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }
            rb.Enabled = false;
            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();

            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            #endregion 展示控件


            #region 是否可界面可见
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("是否界面可见"); //是否界面可见
            this.Pub1.AddTDBegin();
            rb           = new RadioButton();
            rb.ID        = "RB_UIVisible_0";
            rb.Text      = "不可见"; // 界面不可见
            rb.GroupName = "sa3";
            if (mapAttr.UIVisible)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }

            this.Pub1.Add(rb);
            if (mapAttr.IsTableAttr)
            {
                rb.Enabled = false;
            }

            rb           = new RadioButton();
            rb.ID        = "RB_UIVisible_1";
            rb.Text      = "界面可见"; // 界面可见;
            rb.GroupName = "sa3";

            if (mapAttr.UIVisible)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            if (mapAttr.IsTableAttr)
            {
                rb.Enabled = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();

            this.Pub1.AddTD("不可见则为隐藏字段.");
            this.Pub1.AddTREnd();
            #endregion 是否可界面可见


            #region 合并单元格数
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("合并单元格数");
            ddl    = new DDL();
            ddl.ID = "DDL_ColSpan";
            for (int i = 1; i < 12; i++)
            {
                ddl.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
            ddl.SetSelectItem(mapAttr.ColSpan.ToString());
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("对傻瓜表单有效");
            this.Pub1.AddTREnd();
            #endregion 合并单元格数


            #region 字段分组
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字段分组");
            DDL ddlGroup = new DDL();
            ddlGroup.ID = "DDL_GroupID";
            GroupFields gfs = new GroupFields(mapAttr.FK_MapData);
            ddlGroup.Bind(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab);
            if (mapAttr.GroupID == 0)
            {
                mapAttr.GroupID = this.GroupField;
            }

            ddlGroup.SetSelectItem(mapAttr.GroupID);
            this.Pub1.AddTD(ddlGroup);
            this.Pub1.AddTD("修改隶属分组");
            this.Pub1.AddTREnd();
            #endregion 字段分组

            #region 扩展设置.
            if (this.RefNo != null)
            {
                isItem = this.Pub1.AddTR(isItem);
                this.Pub1.AddTDIdx(idx++);
                string html = "<a href=\"javascript:WinOpen('./MapExt/DDLFullCtrl.aspx?FK_MapData=" + mapAttr.FK_MapData + "&RefNo=" + mapAttr.KeyOfEn + "&MyPK=" + mapAttr.FK_MapData + "_" + MapExtXmlList.DDLFullCtrl + "_" + mapAttr.KeyOfEn + "')\">下拉框自动完成</a>";
                html += " - <a href=\"javascript:WinOpen('./MapExt/ActiveDDL.aspx?FK_MapData=" + mapAttr.FK_MapData + "&RefNo=" + mapAttr.KeyOfEn + "&MyPK=" + MapExtXmlList.ActiveDDL + "_" + mapAttr.MyPK + "')\">设置级联动(如:省份,城市联动)</a>";
                html += " - <a href=\"javascript:WinOpen('./MapExt/RadioBtns.aspx?FK_MapData=" + mapAttr.FK_MapData + "&KeyOfEn=" + mapAttr.KeyOfEn + "&MyPK=" + mapAttr.FK_MapData + "_" + MapExtXmlList.DDLFullCtrl + "_" + mapAttr.KeyOfEn + "')\">高级JS设置</a>";
                this.Pub1.AddTD(html);
                this.Pub1.AddTD("&nbsp;");

                this.Pub1.AddTREnd();
            }
            #endregion 扩展设置.

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD colspan=4 >");
            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose";
            btn.CssClass = "Btn";
            btn.Text     = "保存并关闭";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndNew";
            btn.CssClass = "Btn";
            btn.Text     = "保存并新建";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            if (this.RefNo != null)
            {
                btn          = new Button();
                btn.ID       = "Btn_AutoFull";
                btn.CssClass = "Btn";
                btn.Text     = "扩展设置";
                //  btn.Click += new EventHandler(btn_Save_Click);
                btn.Attributes["onclick"] = "javascript:WinOpen('./MapExt/AutoFull.aspx?RefNo=" + this.RefNo + "&FK_MapData=" + mapAttr.FK_MapData + "',''); return false;";
                this.Pub1.Add(btn);

                if (mapAttr.HisEditType == EditType.Edit)
                {
                    btn          = new Button();
                    btn.ID       = "Btn_Del";
                    btn.CssClass = "Btn";
                    btn.Text     = "删除";
                    btn.Click   += new EventHandler(btn_Save_Click);
                    btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                    this.Pub1.Add(btn);
                }

                string myUrl = "EleBatch.aspx?KeyOfEn=" + mapAttr.KeyOfEn + "&FK_MapData=" + mapAttr.FK_MapData + "&EleType=MapAttr";
                this.Pub1.Add("<a href='" + myUrl + "' target='M" + mapAttr.KeyOfEn + "' ><img src='../Img/Btn/Apply.gif' border=0>批处理</a>");
            }

            string url = "Do.aspx?DoType=AddF&MyPK=" + mapAttr.FK_MapData + "&IDX=" + mapAttr.Idx;
            this.Pub1.Add("<a href='" + url + "'><img src='../Img/Btn/New.gif' border=0>新建</a></TD>");


            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithBR();
        }
コード例 #10
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            BP.WF.Cond cond = new Cond();
            cond.MyPK = this.MyPK;
            if (cond.RetrieveFromDBSources() == 0)
            {
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
                if (this.FK_MainNode != 0)
                {
                    cond.NodeID = this.FK_MainNode;
                }
                if (this.FK_Node != 0)
                {
                    cond.FK_Node = this.FK_Node;
                }
                if (this.FK_Flow != null)
                {
                    cond.FK_Flow = this.FK_Flow;
                }
            }
            this.AddTable("border=0 widht='500px'");
            //this.AddCaptionLeft("");
            this.AddTR();
            this.AddTDTitle("项目");
            this.AddTDTitle("采集");
            this.AddTDTitle("描述");
            this.AddTREnd();

            this.AddTR();
            this.AddTD("节点");
            Nodes nds  = new Nodes(cond.FK_Flow);
            Nodes ndsN = new Nodes();

            foreach (BP.WF.Node mynd in nds)
            {
                ndsN.AddEntity(mynd);
            }
            DDL ddl = new DDL();

            ddl.ID = "DDL_Node";
            ddl.BindEntities(ndsN, "NodeID", "Name");
            ddl.SetSelectItem(cond.FK_Node);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.AddTD(ddl);
            this.AddTD("节点");
            this.AddTREnd();

            // 属性/字段
            MapAttrs attrs = new MapAttrs();

            attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + ddl.SelectedItemStringVal);

            MapAttrs attrNs = new MapAttrs();

            foreach (MapAttr attr in attrs)
            {
                if (attr.IsBigDoc)
                {
                    continue;
                }

                switch (attr.KeyOfEn)
                {
                case "Title":
                //case "RDT":
                //case "CDT":
                case "FK_Emp":
                case "MyNum":
                case "FK_NY":
                case WorkAttr.Emps:
                case WorkAttr.OID:
                case StartWorkAttr.Rec:
                case StartWorkAttr.FID:
                    continue;

                default:
                    break;
                }
                attrNs.AddEntity(attr);
            }
            ddl    = new DDL();
            ddl.ID = "DDL_Attr";
            if (attrNs.Count == 0)
            {
                BP.WF.Node nd = new BP.WF.Node(cond.FK_Node);
                nd.RepareMap();
                this.AddTR();
                this.AddTD("");
                this.AddTD("colspan=2", "节点没有找到合适的条件");
                this.AddTREnd();
                this.AddTableEnd();
                return;
            }
            else
            {
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                ddl.SetSelectItem(cond.FK_Attr);
            }

            this.AddTR();
            this.AddTD("属性/字段");
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.AddTR();
            this.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                ddl.Items.Add(new ListItem("<>", "<>"));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;
                }
                break;

            default:
                break;
            }

            if (cond != null)
            {
                try
                {
                    ddl.SetSelectItem(cond.OperatorValueInt);
                }
                catch
                {
                }
            }
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.AddTR();
                this.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.UIBindKey);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.AddTR();
                this.AddTD("值");

                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.AddTR();
                    this.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.AddTD(ddl);
                    this.AddTD();
                    this.AddTREnd();
                }
                else
                {
                    this.AddTR();
                    this.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.AddTD(tb);
                    this.AddTD();
                    this.AddTREnd();
                }
                break;
            }


            Conds       conds = new Conds();
            QueryObject qo    = new QueryObject(conds);

            qo.AddWhere(CondAttr.NodeID, this.FK_MainNode);
            qo.addAnd();
            qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.Form);
            qo.addAnd();
            qo.AddWhere(CondAttr.CondType, (int)this.HisCondType);

            if (this.ToNodeID != 0)
            {
                qo.addAnd();
                qo.AddWhere(CondAttr.ToNodeID, this.ToNodeID);
            }
            int num = qo.DoQuery();


            this.AddTRSum();
            this.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " Save ";

            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "Clear";
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);

            this.Add(btn);

            this.Add("</TD>");
            this.AddTREnd();

            this.AddTableEnd();

            if (num == 0)
            {
                return;
            }


            #region 条件
            this.AddTable("border=0 widht='500px'");
            this.AddCaptionLeft("说明:同时满足如下条件转向成立,只能删除不能编辑.");
            this.AddTR();
            this.AddTDTitle("IDX");
            this.AddTDTitle("节点");
            this.AddTDTitle("字段的英文名");
            this.AddTDTitle("字段的中文名");
            this.AddTDTitle("操作符");
            this.AddTDTitle("值");
            this.AddTDTitle("标签");
            this.AddTDTitle("操作");
            this.AddTREnd();

            int i = 0;
            foreach (Cond mync in conds)
            {
                if (mync.HisDataFrom != ConnDataFrom.Form)
                {
                    continue;
                }

                i++;

                this.AddTR();
                this.AddTDIdx(i);
                //  this.AddTD(mync.HisDataFrom.ToString());
                this.AddTD(mync.FK_NodeT);
                this.AddTD(mync.AttrKey);
                this.AddTD(mync.AttrName);

                this.AddTDCenter(mync.FK_Operator);
                this.AddTD(mync.OperatorValueStr);
                this.AddTD(mync.OperatorValueT);
                //if (num > 1)
                //    this.AddTD(mync.HisConnJudgeWayT);
                this.AddTD("<a href='Cond.aspx?MyPK=" + mync.MyPK + "&CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_Attr=" + mync.FK_Attr + "&FK_MainNode=" + mync.NodeID + "&OperatorValue=" + mync.OperatorValueStr + "&FK_Node=" + mync.FK_Node + "&DoType=Del&ToNodeID=" + mync.ToNodeID + "' >删除</a>");
                this.AddTREnd();
            }
            this.AddTableEnd();
            #endregion
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "Del")
            {
                FrmEvent delFE = new FrmEvent();
                delFE.MyPK = this.FK_MapData + "_" + this.Request.QueryString["RefXml"];
                delFE.Delete();
            }

            this.Pub3.AddCaptionLeft("节点表单/节点/流程:事件");

            FrmEvents ndevs = new FrmEvents();

            ndevs.Retrieve(FrmEventAttr.FK_MapData, this.FK_MapData);

            EventLists xmls = new EventLists();

            xmls.RetrieveAll();

            BP.WF.XML.EventSources ess = new EventSources();
            ess.RetrieveAll();

            string myEvent = this.Event;

            BP.WF.XML.EventList myEnentXml = null;
            foreach (EventSource item in ess)
            {
                this.Pub1.AddFieldSet(item.Name);
                this.Pub1.AddUL();
                foreach (BP.WF.XML.EventList xml in xmls)
                {
                    if (xml.EventType != item.No)
                    {
                        continue;
                    }

                    FrmEvent nde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, xml.No) as FrmEvent;
                    if (nde == null)
                    {
                        if (myEvent == xml.No)
                        {
                            myEnentXml = xml;
                            this.Pub1.AddLi("<font color=green><b>" + xml.Name + "</b></font>");
                        }
                        else
                        {
                            this.Pub1.AddLi("Action.aspx?NodeID=" + this.NodeID + "&Event=" + xml.No + "&FK_Flow=" + this.FK_Flow, xml.Name);
                        }
                    }
                    else
                    {
                        if (myEvent == xml.No)
                        {
                            myEnentXml = xml;
                            this.Pub1.AddLi("<font color=green><b>" + xml.Name + "</b></font>");
                        }
                        else
                        {
                            this.Pub1.AddLi("Action.aspx?NodeID=" + this.NodeID + "&Event=" + xml.No + "&MyPK=" + nde.MyPK + "&FK_Flow=" + this.FK_Flow, "<b>" + xml.Name + "</b>");
                        }
                    }
                }
                this.Pub1.AddULEnd();
                this.Pub1.AddFieldSetEnd();
            }

            if (myEnentXml == null)
            {
                this.Pub2.AddFieldSet("帮助");
                this.Pub2.AddH2("事件是ccflow与您的应用程序接口,");
                this.Pub2.AddFieldSetEnd();
                return;
            }

            FrmEvent mynde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, myEvent) as FrmEvent;

            if (mynde == null)
            {
                mynde = new FrmEvent();
            }


            this.Title = "设置:事件接口=》" + myEnentXml.Name;

            this.Pub2.AddFieldSet(myEnentXml.Name);
            int col = 80;

            this.Pub2.Add("内容类型:");
            DDL ddl = new DDL();

            ddl.BindSysEnum("EventDoType");
            ddl.ID = "DDL_EventDoType";
            ddl.SetSelectItem((int)mynde.HisDoType);
            this.Pub2.Add(ddl);

            this.Pub2.Add("&nbsp;要执行的内容<br>");
            TextBox tb = new TextBox();

            tb.ID       = "TB_Doc";
            tb.Columns  = col;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 10;
            tb.Text     = mynde.DoDoc;
            this.Pub2.Add(tb);
            this.Pub2.AddBR();

            tb          = new TextBox();
            tb.ID       = "TB_MsgOK";
            tb.Columns  = col;
            tb.Text     = mynde.MsgOKString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 4;

            this.Pub2.Add("执行成功信息提示(可为空)<br>");
            this.Pub2.Add(tb);
            this.Pub2.AddBR();

            this.Pub2.Add("执行失败信息提示(可为空)<br>");
            tb          = new TextBox();
            tb.ID       = "TB_MsgErr";
            tb.Columns  = col;
            tb.Text     = mynde.MsgErrorString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 4;
            this.Pub2.Add(tb);
            this.Pub2.AddBR();

            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";

            btn.Click += new EventHandler(btn_Click);
            this.Pub2.Add("&nbsp;&nbsp;");
            this.Pub2.Add(btn);
            if (this.MyPK != null)
            {
                this.Pub2.Add("&nbsp;&nbsp;<a href=\"javascript:DoDel('" + this.NodeID + "','" + this.Event + "')\"><img src='/WF/Img/Btn/Delete.gif' />删除</a>");
            }
            this.Pub2.AddFieldSetEnd();
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FrmEvents ndevs = new FrmEvents();

            ndevs.Retrieve(FrmEventAttr.FK_MapData, this.FK_MapData);

            FrmEvent mynde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, this.Event) as FrmEvent;

            if (mynde == null)
            {
                mynde          = new FrmEvent();
                mynde.FK_Event = this.Event;
            }

            if (!string.IsNullOrWhiteSpace(this.EventDoType))
            {
                mynde.HisDoType = (EventDoType)Enum.Parse(typeof(EventDoType), this.EventDoType);
            }

            this.Pub1.AddTable("class='Table' cellspacing='1' cellpadding='1' border='1' style='width:100%'");

            //删除旧类型.
            BP.DA.DBAccess.RunSQL("delete from sys_enum where enumkey='EventDoType'");

            this.Pub1.AddTR();
            this.Pub1.AddTD("width='200'", "内容类型:");
            DDL ddl = new DDL();

            ddl.BindSysEnum("EventDoType");
            ddl.ID = "DDL_EventDoType";
            ddl.SetSelectItem((int)mynde.HisDoType);
            ddl.Attributes["onchange"] = string.Format("location.href='ActionEvent.aspx?NodeID={0}&MyPK={1}&Event={2}&FK_MapData={3}&EventDoType=' + this.options[this.selectedIndex].value + '&tk=' + Math.random()", this.NodeID, this.MyPK, this.Event, this.FK_MapData);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            TextBox tb = null;

            #region //执行DLL类方法设置, edited by liuxc,2016-01-17
            if (mynde.HisDoType == BP.Sys.EventDoType.SpecClass)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTD("选择一个DLL文件:");
                //绑定 DLL 文件.
                ddl    = new DDL();
                ddl.ID = "DDL_MonthedDLL";
                string[] fs = System.IO.Directory.GetFiles(BP.Sys.SystemConfig.PathOfWebApp + "\\Bin\\", "*.dll");
                foreach (string str in fs)
                {
                    string mystr = str.Replace(BP.Sys.SystemConfig.PathOfWebApp + "\\Bin\\", "");
                    switch (mystr)
                    {
                    case "BitmapCutter.Core.dll":
                    case "BP.Demo.dll":
                    //   case "BP.En30.dll":
                    case "BP.GPM.dll":
                    case "BP.GPMClient.dll":
                    case "BP.Web.Controls.dll":
                    //  case "BP.WF.dll":
                    case "CCFlow.dll":
                    case "ChineseConverter.dll":
                    case "FtpSupport.dll":
                    case "FusionCharts.dll":
                    case "IBM.Data.Informix.dll":
                    case "ICSharpCode.SharpZipLib.dll":
                    case "Interop.Excel.dll":
                    case "Interop.VBIDE.dll":
                    case "Microsoft.Expression.Interactions.dll":
                    case "Microsoft.Web.UI.WebControls.dll":
                    case "Newtonsoft.Json.dll":
                    case "NPOI.dll":
                    case "NPOI.OOXML.dll":
                    case "NPOI.OpenXml4Net.dll":
                    case "NPOI.OpenXmlFormats.dll":
                    case "office.dll":
                    case "Silverlight.DataSetConnector.dll":
                    case "System.Windows.Interactivity.dll":
                        continue;

                    default:
                        break;
                    }

                    ddl.Items.Add(new ListItem(mystr, str));
                    //ddl.Items.Add(new ListItem(str, str));
                }
                ddl.SetSelectItem(mynde.MonthedDLL);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();


                //获得类名.
                this.Pub1.AddTR();
                this.Pub1.AddTD("选择一个类名:");

                Assembly abl   = Assembly.LoadFrom(ddl.SelectedItemStringVal); // 载入程序集
                Type[]   types = abl.GetTypes();
                ddl    = new DDL();
                ddl.ID = "DDL_MonthedClass";

                //绑定类名称.
                Type mytype = this.InitClassName(ddl, types, mynde.MonthedClass);
                ddl.SetSelectItem(mynde.MonthedClass);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_Class_SelectedIndexChanged);
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTD("选择一个方法:");

                ddl    = new DDL();
                ddl.ID = "DDL_MonthedName";
                //绑定方法.
                ParameterInfo[] myPI = this.InitMethodName(ddl, mytype.GetMethods(), mynde.MonthedName);
                ddl.SetSelectItem(mynde.MonthedName);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_Monthed_SelectedIndexChanged);
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();

                #region 参数与参数格式.

                this.Pub1.AddTR();
                this.Pub1.AddTD("执行方法的参数");
                //参数.
                tb         = new TextBox();
                tb.ID      = "TB_MonthedParas";
                tb.Text    = mynde.MonthedParas.Replace("~", "@");
                tb.Columns = 80;
                this.Pub1.AddTD(tb);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTD("参数格式:");

                Label lab = new Label();
                lab.ID   = "Lab_Note";
                lab.Text = this.GenerParas(myPI);
                this.Pub1.AddTD(lab);
                this.Pub1.AddTREnd();

                #endregion 参数与参数格式.
            }
            #endregion

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan=2");
            this.Pub1.Add("&nbsp;要执行的内容<br>");
            tb         = new TextBox();
            tb.ID      = "TB_Doc";
            tb.Columns = 50;
            tb.Style.Add("width", "99%");
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 5;
            tb.Text     = mynde.DoDoc;
            this.Pub1.Add(tb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan=2");
            tb    = new TextBox();
            tb.ID = "TB_MsgOK";
            tb.Style.Add("width", "99%");
            tb.Text = mynde.MsgOKString;
            this.Pub1.Add("执行成功信息提示(可为空)<br>");
            this.Pub1.Add(tb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan=2");
            this.Pub1.Add("执行失败信息提示(可为空)<br>");
            tb    = new TextBox();
            tb.ID = "TB_MsgErr";
            tb.Style.Add("width", "99%");
            tb.Text = mynde.MsgErrorString;
            this.Pub1.Add(tb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Click);
            Pub1.Add(btn);

            if (!string.IsNullOrWhiteSpace(this.MyPK))
            {
                Pub1.AddSpace(1);
                Pub1.Add(
                    string.Format(
                        "<a href='javascript:void(0)' onclick=\"DoDel('{2}','{0}','{1}')\" class='easyui-linkbutton' data-options=\"iconCls:'icon-delete'\">删除</a>",
                        NodeID, Event, FK_Flow));
            }
        }
コード例 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (BP.WF.Dev2Interface.Flow_IsCanStartThisFlow(this.FK_Flow, WebUser.No) == false)
            {
            }

            Flow fl = new Flow(this.FK_Flow);

            this.Page.Title = fl.Name;
            MapAttrs attrs = new MapAttrs(this.FK_MapData);

            if (fl.BatchStartFields.Length == 0)
            {
                this.Pub1.AddFieldSet("流程属性设置错误");
                this.Pub1.Add("您需要在流程属性里设置批量发起需要填写的字段。");
                this.Pub1.AddFieldSetEnd();
            }

            MapExts mes = new MapExts(this.FK_MapData);

            BP.WF.Node nd = new BP.WF.Node(int.Parse(this.FK_Flow + "01"));
            Work       wk = nd.HisWork;

            wk.ResetDefaultVal();

            this.Pub1.AddTable();
            this.Pub1.AddCaptionMsg("批量发起:" + fl.Name);

            #region 输出标题.
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序");

            string str1 = "<INPUT id='checkedAll' onclick=\"SelectAllBS(this);\" value='选择' type='checkbox' name='checkedAll' >全部选择";
            this.Pub1.AddTDTitle("align='left'", str1);

            //this.Pub1.AddTDTitle("align='left'", "");

            string[] strs = fl.BatchStartFields.Split(',');
            foreach (string str in strs)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                foreach (MapAttr attr in attrs)
                {
                    if (str != attr.KeyOfEn)
                    {
                        continue;
                    }
                    this.Pub1.AddTDTitle(attr.Name);
                }
            }
            this.Pub1.AddTREnd();
            #endregion 输出标题.

            #region 输出标题.
            for (int i = 1; i <= this.RowNum; i++)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(i);
                CheckBox cbIdx = new CheckBox();
                cbIdx.Checked = false;
                cbIdx.Text    = "发起否?";
                cbIdx.ID      = "CB_IDX_" + i;
                this.Pub1.AddTD(cbIdx);

                foreach (string str in strs)
                {
                    if (string.IsNullOrEmpty(str))
                    {
                        continue;
                    }
                    foreach (MapAttr attr in attrs)
                    {
                        if (str != attr.KeyOfEn)
                        {
                            continue;
                        }

                        TB tb = new TB();
                        tb.ID = "TB_" + attr.KeyOfEn + "_" + i;
                        switch (attr.LGType)
                        {
                        case FieldTypeS.Normal:
                            switch (attr.MyDataType)
                            {
                            case BP.DA.DataType.AppString:
                                if (attr.UIRows == 1)
                                {
                                    tb.Text = attr.DefVal;
                                    tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 15px;padding: 0px;margin: 0px;";
                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TB";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }
                                    this.Pub1.AddTD(tb);
                                }
                                else
                                {
                                    tb.TextMode = TextBoxMode.MultiLine;
                                    tb.Text     = attr.DefVal;

                                    tb.Attributes["style"]     = "width: " + attr.UIWidth + "px; text-align: left;padding: 0px;margin: 0px;";
                                    tb.Attributes["maxlength"] = attr.MaxLen.ToString();
                                    tb.Rows = attr.UIRows;

                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TBDoc";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }

                                    this.Pub1.AddTD(tb);
                                }
                                break;

                            case BP.DA.DataType.AppDate:
                                tb.ShowType = TBType.Date;
                                tb.Text     = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker();";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TB";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppDateTime:
                                tb.ShowType = TBType.DateTime;
                                tb.Text     = attr.DefVal;     // en.GetValStrByKey(attr.KeyOfEn);

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBcalendar";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                                }
                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppBoolean:
                                CheckBox cb = new CheckBox();
                                //cb.Width = 350;
                                cb.Text    = attr.Name;
                                cb.ID      = "CB_" + attr.KeyOfEn + "_" + i;
                                cb.Checked = attr.DefValOfBool;
                                cb.Enabled = attr.UIIsEnable;
                                cb.Checked = attr.DefValOfBool;

                                if (cb.Enabled == false)
                                {
                                    cb.Enabled = false;
                                }
                                else
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    // cb.Attributes["onmousedown"] = "Change('" + attr.FK_MapData + "')";
                                    cb.Enabled = true;
                                }
                                this.Pub1.AddTD(cb);
                                break;

                            case BP.DA.DataType.AppDouble:
                            case BP.DA.DataType.AppFloat:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppInt:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'int');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppMoney:
                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,'0.00');");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }
                                //  tb.ShowType = TBType.Moneny;
                                tb.Text = attr.DefVal;

                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppRate:
                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }
                                tb.ShowType            = TBType.Moneny;
                                tb.Text                = attr.DefVal;
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            default:
                                break;
                            }
                            break;

                        case FieldTypeS.Enum:
                            if (attr.UIContralType == UIContralType.DDL)
                            {
                                DDL ddle = new DDL();
                                ddle.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                                ddle.BindSysEnum(attr.UIBindKey);
                                ddle.SetSelectItem(attr.DefVal);
                                ddle.Enabled = attr.UIIsEnable;
                                ddle.Attributes["tabindex"] = attr.Idx.ToString();
                                if (attr.UIIsEnable)
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    //   ddle.Attributes["onchange"] = "Change('" + attr.FK_MapData + "')";
                                }
                                //    ddle.Enabled = false;
                                this.Pub1.AddTD(ddle);
                            }
                            else
                            {
                            }
                            break;

                        case FieldTypeS.FK:
                            DDL ddl1 = new DDL();
                            ddl1.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                            ddl1.Attributes["tabindex"] = attr.Idx.ToString();
                            if (ddl1.Enabled)
                            {
                                EntitiesNoName ens = attr.HisEntitiesNoName;
                                ens.RetrieveAll();
                                ddl1.BindEntities(ens);
                                ddl1.SetSelectItem(attr.DefVal);
                                //add by dgq 2013-4-9,添加内容修改后的事件
                                //  ddl1.Attributes["onchange"] = "Change('" + attr.FK_MapData + "')";
                            }
                            else
                            {
                                ddl1.Attributes["style"] = "width: " + attr.UIWidth + "px;height: 19px;";
                                if (ddl1.Enabled == true)
                                {
                                    ddl1.Enabled = false;
                                }
                                ddl1.Attributes["Width"] = attr.UIWidth.ToString();
                                ddl1.Items.Add(new ListItem(attr.DefVal, attr.DefVal));
                            }
                            ddl1.Enabled = attr.UIIsEnable;
                            this.Pub1.AddTD(ddl1);
                            break;

                        default:
                            break;
                        }
                    }
                }
                this.Pub1.AddTREnd();
            }
            #endregion 输出标题.

            this.Pub1.AddTableEnd();

            #region 处理扩展属性.
            if (mes.Count != 0)
            {
                this.Page.RegisterClientScriptBlock("s81",
                                                    "<script language='JavaScript' src='/WF/Scripts/jquery-1.4.1.min.js' ></script>");
                this.Page.RegisterClientScriptBlock("b81",
                                                    "<script language='JavaScript' src='/WF/CCForm/MapExt.js' defer='defer' type='text/javascript' ></script>");
                this.Pub1.Add("<div id='divinfo' style='width: 155px; position: absolute; color: Lime; display: none;cursor: pointer;align:left'></div>");
                this.Page.RegisterClientScriptBlock("dCd",
                                                    "<script language='JavaScript' src='/DataUser/JSLibData/" + this.FK_MapData + ".js' ></script>");

                for (int i = 1; i <= this.RowNum; i++)
                {
                    foreach (MapExt me in mes)
                    {
                        switch (me.ExtType)
                        {
                        case MapExtXmlList.DDLFullCtrl:     // 自动填充.
                            DDL ddlOper = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                            if (ddlOper == null)
                            {
                                continue;
                            }
                            ddlOper.Attributes["onchange"] = "DDLFullCtrl(this.value,\'" + ddlOper.ClientID + "\', \'" + me.MyPK + "\')";
                            break;

                        case MapExtXmlList.ActiveDDL:
                            DDL       ddlPerant = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                            string    val, valC;
                            DataTable dt;
                            if (ddlPerant == null)
                            {
                                continue;
                            }
#warning 此处需要优化
                            string ddlC = "ContentPlaceHolder1_BatchStart1_DDL_" + me.AttrsOfActive + "_" + i;
                            //  ddlPerant.Attributes["onchange"] = " isChange=true; DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";
                            ddlPerant.Attributes["onchange"] = "DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";

                            DDL ddlChild = this.Pub1.GetDDLByID("DDL_" + me.AttrsOfActive + "_" + i);
                            val = ddlPerant.SelectedItemStringVal;
                            if (ddlChild.Items.Count == 0)
                            {
                                valC = wk.GetValStrByKey(me.AttrsOfActive);
                            }
                            else
                            {
                                valC = ddlChild.SelectedItemStringVal;
                            }

                            string mysql = me.Doc.Replace("@Key", val);
                            if (mysql.Contains("@") && i >= 100)
                            {
                                mysql = BP.WF.Glo.DealExp(mysql, wk, null);
                            }
                            else
                            {
                                continue;
                            }

                            dt = DBAccess.RunSQLReturnTable(mysql);

                            ddlChild.Bind(dt, "No", "Name");
                            if (ddlChild.SetSelectItem(valC) == false)
                            {
                                ddlChild.Items.Insert(0, new ListItem("请选择" + valC, valC));
                                ddlChild.SelectedIndex = 0;
                            }
                            //  ddlChild.Attributes["onchange"] = " isChange=true;";

                            break;

                        case MapExtXmlList.AutoFullDLL:     //自动填充下拉框的范围.
                            DDL ddlFull = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                            if (ddlFull == null)
                            {
                                continue;
                            }

                            string valOld = wk.GetValStrByKey(me.AttrOfOper);
                            //string valOld =ddlFull.SelectedItemStringVal;

                            string fullSQL = me.Doc.Replace("@WebUser.No", WebUser.No);
                            fullSQL = fullSQL.Replace("@WebUser.Name", WebUser.Name);
                            fullSQL = fullSQL.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                            fullSQL = fullSQL.Replace("@WebUser.FK_DeptName", WebUser.FK_DeptName);
                            fullSQL = fullSQL.Replace("@Key", this.Request.QueryString["Key"]);

                            if (fullSQL.Contains("@"))
                            {
                                Attrs attrsFull = wk.EnMap.Attrs;
                                foreach (Attr attr in attrsFull)
                                {
                                    if (fullSQL.Contains("@") == false)
                                    {
                                        break;
                                    }
                                    fullSQL = fullSQL.Replace("@" + attr.Key, wk.GetValStrByKey(attr.Key));
                                }
                            }

                            //if (fullSQL.Contains("@"))
                            //{
                            //    /*从主表中取数据*/
                            //    Attrs attrsFull = this.MainEn.EnMap.Attrs;
                            //    foreach (Attr attr in attrsFull)
                            //    {
                            //        if (fullSQL.Contains("@") == false)
                            //            break;

                            //        if (fullSQL.Contains("@" + attr.Key) == false)
                            //            continue;

                            //        fullSQL = fullSQL.Replace("@" + attr.Key, this.MainEn.GetValStrByKey(attr.Key));
                            //    }
                            //}

                            ddlFull.Items.Clear();
                            ddlFull.Bind(DBAccess.RunSQLReturnTable(fullSQL), "No", "Name");
                            if (ddlFull.SetSelectItem(valOld) == false)
                            {
                                ddlFull.Items.Insert(0, new ListItem("请选择" + valOld, valOld));
                                ddlFull.SelectedIndex = 0;
                            }
                            // ddlFull.Attributes["onchange"] = " isChange=true;";
                            break;

                        case MapExtXmlList.TBFullCtrl:     // 自动填充.
                            TextBox tbAuto = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                            if (tbAuto == null)
                            {
                                continue;
                            }
                            // tbAuto.Attributes["onkeyup"] = " isChange=true; DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                            tbAuto.Attributes["onkeyup"] = " DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";

                            tbAuto.Attributes["AUTOCOMPLETE"] = "OFF";
                            if (me.Tag != "")
                            {
                                /* 处理下拉框的选择范围的问题 */
                                string[] strsTmp = me.Tag.Split('$');
                                foreach (string str in strsTmp)
                                {
                                    string[] myCtl = str.Split(':');
                                    string   ctlID = myCtl[0];
                                    DDL      ddlC1 = this.Pub1.GetDDLByID("DDL_" + ctlID + "_" + i);
                                    if (ddlC1 == null)
                                    {
                                        //me.Tag = "";
                                        // me.Update();
                                        continue;
                                    }

                                    string sql = myCtl[1].Replace("~", "'");
                                    sql = sql.Replace("@WebUser.No", WebUser.No);
                                    sql = sql.Replace("@WebUser.Name", WebUser.Name);
                                    sql = sql.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                                    sql = sql.Replace("@Key", tbAuto.Text.Trim());
                                    dt  = DBAccess.RunSQLReturnTable(sql);
                                    string valC1 = ddlC1.SelectedItemStringVal;
                                    ddlC1.Items.Clear();
                                    foreach (DataRow dr in dt.Rows)
                                    {
                                        ddlC1.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                                    }
                                    ddlC1.SetSelectItem(valC1);
                                }
                            }
                            break;

                        case MapExtXmlList.InputCheck:
                            TextBox tbCheck = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                            if (tbCheck != null)
                            {
                                tbCheck.Attributes[me.Tag2] += " rowPK=" + i + "; " + me.Tag1 + "(this);";
                            }
                            break;

                        case MapExtXmlList.PopVal:     //弹出窗.
                            TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + i);
                            //  tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            tb.Attributes["ondblclick"] = " ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.Link:     // 超链接.
                            //TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + mydtl.OID);
                            //tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.RegularExpression:    //正则表达式,对数据控件处理
                            TextBox tbExp = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                            if (tbExp == null || me.Tag == "onsubmit")
                            {
                                continue;
                            }
                            //验证输入的正则格式
                            string regFilter = me.Doc;
                            if (regFilter.LastIndexOf("/g") < 0 && regFilter.LastIndexOf('/') < 0)
                            {
                                regFilter = "'" + regFilter + "'";
                            }
                            //处理事件
                            tbExp.Attributes.Add("" + me.Tag + "", "return txtTest_Onkeyup(this," + regFilter + ",'" + me.Tag1 + "')");    //[me.Tag] += "this.value=this.value.replace(" + regFilter + ",'')";
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            #endregion 拓展属性

            Button btn = new Button();
            btn.Text          = "执行发起";
            btn.ID            = "Btn_Start";
            btn.Click        += new EventHandler(btn_Send_Click);
            btn.OnClientClick = "return checkType()";
            this.Pub1.Add(btn);

            #region 文件上传.
            this.Pub1.AddFieldSet("通过Excel导入方式发起:<a href='/DataUser/BatchStartFlowTemplete/" + this.FK_Flow + ".xls'><img src='/WF/Img/FileType/xls.gif' />下载Excel模版</a>");
            this.Pub1.Add("文件名:");
            FileUpload fu = new FileUpload();
            fu.ID = "File1";
            this.Pub1.Add(fu);
            btn        = new Button();
            btn.Text   = "导入";
            btn.ID     = "Btn_Imp";
            btn.Click += new EventHandler(btn_Upload_Click);
            this.Pub1.Add(btn);
            this.Pub1.AddFieldSetEnd();
            #endregion 文件上传.
        }
コード例 #14
0
        public void BindList()
        {
            string text = "";

            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            FrmNodes   fns = new FrmNodes(this.FK_Flow, this.FK_Node);

            if (fns.Count == 0)
            {
                text = "当前没有任何流程表单绑定到该节点上,请您执行绑定表单:<input type=button onclick=\"javascript:BindFrms('" + this.FK_Node + "','" + this.FK_Flow + "');\" value='修改表单绑定'  class=Btn />";
                this.Pub1.AddFieldSet("提示", text);
                return;
            }


            this.Pub1.AddTable("width=100%");
            this.Pub1.AddCaption("设置节点:(" + nd.Name + ")绑定表单");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("显示方式");
            this.Pub1.AddTDTitle("可编辑否?");
            this.Pub1.AddTDTitle("可打印否?");
            this.Pub1.AddTDTitle("是否启用<br>装载填充事件");
            this.Pub1.AddTDTitle("权限控制<br>方案");
            this.Pub1.AddTDTitle("表单元素<br>自定义设置");
            this.Pub1.AddTDTitle("谁是主键?");
            this.Pub1.AddTDTitle("顺序");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTREnd();



            int idx = 1;

            foreach (FrmNode fn in fns)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD(fn.FK_Frm);

                MapData md = new MapData();
                md.No = fn.FK_Frm;
                try
                {
                    md.Retrieve();
                }
                catch
                {
                    //说明该表单不存在了,就需要把这个删除掉.
                    fn.Delete();
                }

                this.Pub1.AddTD("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>");


                DDL ddl = new DDL();
                ddl.ID = "DDL_FrmType_" + fn.FK_Frm;
                ddl.BindSysEnum("FrmType", (int)fn.HisFrmType);
                this.Pub1.AddTD(ddl);

                CheckBox cb = new CheckBox();
                cb.ID      = "CB_IsEdit_" + md.No;
                cb.Text    = "可编辑否?";
                cb.Checked = fn.IsEdit;
                this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsPrint_" + md.No;
                cb.Text    = "打印否?";
                cb.Checked = fn.IsPrint;
                this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsEnableLoadData_" + md.No;
                cb.Text    = "启用否?";
                cb.Checked = fn.IsEnableLoadData;
                this.Pub1.AddTD(cb);

                ddl    = new DDL();
                ddl.ID = "DDL_Sln_" + md.No;
                ddl.Items.Add(new ListItem("默认方案", "0"));
                ddl.Items.Add(new ListItem("自定义", this.FK_Node.ToString()));
                ddl.SetSelectItem(fn.FrmSln); //设置权限控制方案.
                this.Pub1.AddTD(ddl);

                this.Pub1.AddTDBegin();
                this.Pub1.Add("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >字段</a>");
                this.Pub1.Add("-<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >附件</a>");
                this.Pub1.Add("-<a href=\"javascript:WinDtl('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >从表</a>");

                if (md.HisFrmType == FrmType.ExcelFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarExcel('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarExcel</a>");
                }

                if (md.HisFrmType == FrmType.WordFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarWord('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarWord</a>");
                }

                this.Pub1.AddTDEnd();

                ddl    = new DDL();
                ddl.ID = "DDL_WhoIsPK_" + md.No;
                ddl.BindSysEnum("WhoIsPK");
                ddl.SetSelectItem((int)fn.WhoIsPK); //谁是主键?.
                this.Pub1.AddTD(ddl);

                TextBox tb = new TextBox();
                tb.ID      = "TB_Idx_" + md.No;
                tb.Text    = fn.Idx.ToString();
                tb.Columns = 5;
                this.Pub1.AddTD(tb);

                this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Up", "上移");
                this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Down", "下移");

                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();

            text = "<input type=button onclick=\"javascript:BindFrms('" + this.FK_Node + "','" + this.FK_Flow + "');\" value='修改表单绑定'  class=Btn />";
            this.Pub1.Add(text);

            Button btn = new Button();

            btn.ID       = "Save";
            btn.Text     = "保存设置";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);
            this.Pub1.Add(btn);

            text = "<input type=button onclick=\"javascript:window.close();\" value='关闭'  class=Btn />";
            this.Pub1.Add(text);
        }
コード例 #15
0
ファイル: ToolsWap.ascx.cs プロジェクト: zhaoyingju/ccflow
        public void BindProfile()
        {
            BP.WF.Port.WFEmp emp = new BP.WF.Port.WFEmp(WebUser.No);
            if (WebUser.IsWap)
            {
                this.AddFieldSet("<a href=Home.aspx ><img src='/WF/Img/Home.gif' border=0 >主页</a>-<a href='" + this.PageID + ".aspx'>设置</a>-" + "基本信息" + WebUser.Auth);
            }
            else
            {
                this.AddFieldSet("基本信息" + WebUser.Auth);
            }

            this.Add("<br><table border=0 width='80%' align=center >");
            this.AddTR();
            this.AddTD("手机");
            TextBox tb = new TextBox();

            tb.TextMode = TextBoxMode.SingleLine;
            tb.ID       = "TB_Tel";
            tb.Text     = emp.Tel;
            this.AddTD(tb);
            this.AddTREnd();

            this.AddTR();
            this.AddTD("Email");
            tb          = new TextBox();
            tb.TextMode = TextBoxMode.SingleLine;
            tb.ID       = "TB_Email";
            tb.Text     = emp.Email;
            this.AddTD(tb);
            this.AddTREnd();

            this.AddTR();
            this.AddTD("QQ/RTX/MSN");
            tb          = new TextBox();
            tb.TextMode = TextBoxMode.SingleLine;
            tb.ID       = "TB_TM";
            tb.Text     = emp.Email;
            this.AddTD(tb);
            this.AddTREnd();

            this.AddTR();
            this.AddTD("信息接收方式");
            DDL ddl = new DDL();

            ddl.ID = "DDL_Way";
            ddl.BindSysEnum("AlertWay");
            //ddl.Items.Add(new ListItem("不接收", "0"));
            //ddl.Items.Add(new ListItem("手机短信", "1"));
            //ddl.Items.Add(new ListItem("邮件", "2"));
            //ddl.Items.Add(new ListItem("手机短信+邮件", "3"));
            ddl.SetSelectItem((int)emp.HisAlertWay);
            this.AddTD(ddl);
            this.AddTREnd();

            this.AddTR();
            Btn btn = new Btn();

            btn.Text   = "保存";
            btn.Click += new EventHandler(btn_Profile_Click);
            this.AddTD("colspan=2 align=center", btn);
            this.AddTREnd();
            this.AddTableEnd();

            this.AddBR();


            this.AddFieldSetEnd();
        }
コード例 #16
0
        public void BindEdit(MapData md, MapDtl dtl)
        {
            bool isItem = false;

            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("colspan=3", "基本设置");
            this.Pub1.AddTREnd();

            int idx = 1;

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表英文名称");
            TB tb = new TB();

            tb.ID   = "TB_No";
            tb.Text = dtl.No;
            if (this.DoType == "Edit")
            {
                tb.Enabled = false;
            }

            tb.Columns = 40;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表中文名称");
            tb         = new TB();
            tb.ID      = "TB_Name";
            tb.Text    = dtl.Name;
            tb.Columns = 40;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("物理表名");
            tb         = new TB();
            tb.ID      = "TB_PTable";
            tb.Text    = dtl.PTable;
            tb.Columns = 40;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            DDL ddl = new DDL();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("工作模式");
            DDL workModelDDl = new DDL();

            workModelDDl.BindSysEnum(MapDtlAttr.Model, (int)dtl.DtlModel);
            workModelDDl.ID = "DDL_Model";
            this.Pub1.AddTD(workModelDDl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();


            if (dtl.DtlModel == DtlModel.FixRow)
            {
                tb         = new TB();
                tb.ID      = "TB_" + MapDtlAttr.ImpFixTreeSql;
                tb.Text    = dtl.ImpFixTreeSql;
                tb.Columns = 80;

                isItem = this.Pub1.AddTR(isItem);
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("树形结构数据源");
                this.Pub1.AddTD("colspan=2", tb);
                this.Pub1.AddTREnd();

                tb         = new TB();
                tb.ID      = "TB_" + MapDtlAttr.ImpFixDataSql;
                tb.Text    = dtl.ImpFixDataSql;
                tb.Columns = 80;

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("明细表数据源");
                this.Pub1.AddTD("colspan=2", tb);
                this.Pub1.AddTREnd();
            }

            #region 权限控制.
            CheckBox cb = new CheckBox();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb.ID      = "CB_IsView";
            cb.Text    = "是否可见";
            cb.Checked = dtl.IsView;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsUpdate";
            cb.Text    = "是否可以修改行"; // "是否可以修改行";
            cb.Checked = dtl.IsUpdate;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsInsert";
            cb.Text    = "是否可以新增行"; // "是否可以新增行";
            cb.Checked = dtl.IsInsert;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsDelete";
            cb.Text    = "是否可以删除行"; // "是否可以删除行";
            cb.Checked = dtl.IsDelete;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowIdx";
            cb.Text    = "是否显示序号列"; //"是否显示序号列";
            cb.Checked = dtl.IsShowIdx;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowSum";
            cb.Text    = "是否合计行";// "是否合计行";
            cb.Checked = dtl.IsShowSum;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsEnableAthM";
            cb.Text    = "是否启用多附件";
            cb.Checked = dtl.IsEnableAthM;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2M;
            cb.Text    = "是否启用一对多";
            cb.Checked = dtl.IsEnableM2M;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2MM;
            cb.Text    = "是否启用一对多多";
            cb.Checked = dtl.IsEnableM2MM;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsRowLock;
            cb.Text    = "是否启用锁定行(如果启用就需要增加IsRowLock一个隐藏的列,默认值为0。)?";// "是否合计行";
            cb.Checked = dtl.IsRowLock;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsShowTitle;
            cb.Text    = "是否显示标头(如果是多表表头的明细表,就不要显示表头了)?";;
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();
            #endregion 权限控制.


            //this.Pub1.AddTR();
            //this.Pub1.AddTDIdx(idx++);
            //cb = new CheckBox();
            //cb.ID = "CB_IsShowTitle";
            //cb.Text = "是否显示标头";// "是否显示标头";
            //cb.Checked = dtl.IsShowTitle;
            //this.Pub1.AddTD(cb);
            //this.Pub1.AddTREnd();


            //cb = new CheckBox();
            //cb.ID = "CB_IsEnableAth";
            //cb.Text = "是否启用单附件";
            //cb.Checked = dtl.IsEnablePass;
            //this.Pub1.AddTD(cb);
            //this.Pub1.AddTREnd();


            //为精英修改.
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("增加记录方式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlAddRecModel";
            ddl.BindSysEnum(MapDtlAttr.DtlAddRecModel, (int)dtl.DtlAddRecModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("满足不同的用户习惯");
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("初始化行数");
            tb    = new TB();
            tb.ID = "TB_RowsOfList";
            tb.Attributes["class"] = "TBNum";
            tb.TextExtInt          = dtl.RowsOfList;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示格式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlShowModel";
            ddl.BindSysEnum(MapDtlAttr.DtlShowModel, (int)dtl.HisDtlShowModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("越出处理");
            ddl    = new DDL();
            ddl.ID = "DDL_WhenOverSize";
            ddl.BindSysEnum(MapDtlAttr.WhenOverSize, (int)dtl.HisWhenOverSize);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("存盘方式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlSaveModel";
            ddl.BindSysEnum(MapDtlAttr.DtlSaveModel, (int)dtl.DtlSaveModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("用于设置在明细表自动存盘还是,手动存盘.");
            this.Pub1.AddTREnd();

            #region 与工作流相关设置.
            if (this.FK_Node != 0)
            {
                this.Pub1.AddTRSum();
                this.Pub1.AddTDTitle("colspan=4", "与工作流相关设置");
                this.Pub1.AddTREnd();

                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("操作权限");
                ddl = new DDL();
                ddl.BindSysEnum(MapDtlAttr.DtlOpenType, (int)dtl.DtlOpenType);
                ddl.ID = "DDL_DtlOpenType";
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD();
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsEnablePass";
                cb.Text    = "是否起用审核字段?";// "是否合计行";
                cb.Checked = dtl.IsEnablePass;
                this.Pub1.AddTD(cb);

                //   string sql = "SELECT KeyOfEn as No, Name FROM Sys_MapAttr WHERE FK_MapData='" + dtl.No + "' AND  ((MyDataType in (1,4,6) and UIVisible=1 ) or (UIContralType=1))";

                string    sql = "SELECT KeyOfEn as No, Name FROM Sys_MapAttr WHERE FK_MapData='" + dtl.No + "'";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count == 0)
                {
                    this.Pub1.AddTD();
                    this.Pub1.AddTD();
                }
                else
                {
                    this.Pub1.AddTDBegin("colspan=2");
                    cb         = new CheckBox();
                    cb.ID      = "CB_IsEnableGroupField";
                    cb.Text    = "是否起用分组字段?";// "是否合计行";
                    cb.Checked = dtl.IsEnableGroupField;
                    this.Pub1.Add(cb);

                    ddl    = new DDL();
                    ddl.ID = "DDL_GroupField";
                    ddl.BindSQL(sql, "No", "Name", dtl.GroupField);
                    this.Pub1.Add(ddl);
                    this.Pub1.AddTDEnd();
                }
                this.Pub1.AddTREnd();


                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsCopyNDData";
                cb.Text    = "是允许从上一个节点Copy数据";
                cb.Checked = dtl.IsCopyNDData;
                this.Pub1.AddTD("colspan=3", cb);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsHLDtl";
                cb.Text    = "是否是合流汇总从表(当前节点是合流节点有效)";
                cb.Checked = dtl.IsHLDtl;
                this.Pub1.AddTD("colspan=3", cb);
                this.Pub1.AddTREnd();


                #region 与分流点发送到子线程,处理子线程处理人相关的设置. for yangtai .
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsFLDtl";
                cb.Text    = "是否是分流点从表(当前节点是分流节点有效)";
                cb.Checked = dtl.IsFLDtl;
                this.Pub1.AddTD("colspan=3", cb);
                this.Pub1.AddTREnd();

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("子线程处理人字段");
                sql = "SELECT KeyOfEn as No, Name FROM Sys_MapAttr WHERE FK_MapData='" + dtl.No + "' AND  ( (MyDataType =1 and UIVisible=1 ) or (UIContralType=1))";
                dt  = DBAccess.RunSQLReturnTable(sql);

                ddl    = new DDL();
                ddl.ID = "DDL_SubThreadWorker";
                ddl.BindSQL(sql, "No", "Name", dtl.SubThreadWorker);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("子线程批次号字段");
                DataRow dr = dt.NewRow();
                dr[0] = "";
                dr[1] = "无";
                dt.Rows.Add(dr);

                ddl    = new DDL();
                ddl.ID = "DDL_SubThreadGroupMark";
                ddl.BindSQL(sql, "No", "Name", dtl.SubThreadGroupMark);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }
            #endregion 与分流点发送到子线程,处理子线程处理人相关的设置. for yangtai .


            #endregion 与工作流相关设置.

            #region 明细表的数据导入导出.
            this.Pub1.AddTRSum();
            this.Pub1.AddTDTitle("colspan=4", "数据导入导出");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsExp";
            cb.Text    = "是否可以导出?";// "是否可以导出";
            cb.Checked = dtl.IsExp;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsImp";
            cb.Text    = "是否可以导入?";// "是否可以导出";
            cb.Checked = dtl.IsImp;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableSelectImp;
            cb.Text    = "是否启用选择性导入(如果true就要配置数据源呈现的sql)?";
            cb.Checked = dtl.IsEnableSelectImp;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("初始化SQL");
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.ImpSQLInit;
            tb.Text    = dtl.ImpSQLInit;
            tb.Columns = 80;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("查询SQL");
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.ImpSQLSearch;
            tb.Text    = dtl.ImpSQLSearch;
            tb.Columns = 80;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("填充SQL");
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.ImpSQLFull;
            tb.Text    = dtl.ImpSQLFull;
            tb.Columns = 80;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            #endregion 明细表的数据导入导出.

            #region 超连接.
            this.Pub1.AddTRSum();
            this.Pub1.AddTDTitle("colspan=4", "表格右边列超连接配置");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableLink;
            cb.Text    = "是否启用超连接?";
            cb.Checked = dtl.IsEnableLink;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("超连接标签");

            tb      = new TB();
            tb.ID   = "TB_" + MapDtlAttr.LinkLabel;
            tb.Text = dtl.LinkLabel;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("colspan=3", "连接URL");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.LinkUrl;
            tb.Text    = dtl.LinkUrl;
            tb.Columns = 90;
            this.Pub1.AddTD("colspan=3", tb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("连接目标");
            tb      = new TB();
            tb.ID   = "TB_" + MapDtlAttr.LinkTarget;
            tb.Text = dtl.LinkTarget;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            #endregion 超连接.

            GroupFields gfs = new GroupFields(md.No);
            if (gfs.Count > 1)
            {
                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("显示在分组");
                ddl    = new DDL();
                ddl.ID = "DDL_GroupID";
                ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, AddAllLocation.None);
                ddl.SetSelectItem(dtl.GroupID);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();
            }
            if (gfs.Count > 1)
            {
                this.Pub1.AddTR();
            }
            else
            {
                this.Pub1.AddTR1();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD("");
            this.Pub1.AddTDBegin("colspan=3 align=center");

            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose";
            btn.CssClass = "Btn";
            btn.Text     = " 保存并关闭 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            if (this.FK_MapDtl != null)
            {
                //btn = new Button();
                //btn.ID = "Btn_D";
                //btn.Text = this.ToE("DesignSheet", "设计表单"); // "设计表单";
                //btn.Click += new EventHandler(btn_Go_Click);
                //this.Pub1.Add(btn);

                btn          = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";
                btn.Text     = "删除"; // "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.Add(btn);


                btn          = new Button();
                btn.ID       = "Btn_New";
                btn.CssClass = "Btn";
                btn.Text     = "新建"; // "删除";
                btn.Click   += new EventHandler(btn_New_Click);
                this.Pub1.Add(btn);

                //btn = new Button();
                //btn.ID = "Btn_MapExt";
                //btn.CssClass = "Btn";
                //btn.Text = "扩展设置"; // "删除";
                //btn.Click += new EventHandler(btn_MapExt_Click);
                //this.Pub1.Add(btn);

                if (dtl.IsEnableAthM)
                {
                    btn          = new Button();
                    btn.CssClass = "Btn";
                    btn.ID       = "Btn_IsEnableAthM";
                    btn.Text     = "附件属性"; // "删除";
                    btn.Click   += new EventHandler(btn_MapAth_Click);
                    this.Pub1.Add(btn);
                }

                // btn = new Button();
                // btn.ID = "Btn_DtlTR";
                // btn.Text = "多表头";
                // btn.Attributes["onclick"] = "javascript:WinOpen('')";
                //// btn.Click += new EventHandler(btn_DtlTR_Click);
                // this.Pub1.Add(btn);
            }
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
コード例 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FrmAttachment ath = new FrmAttachment();

            ath.FK_MapData = this.FK_MapData;
            ath.NoOfObj    = this.Ath;
            ath.FK_Node    = this.FK_Node;

            if (this.FK_Node == 0)
            {
                ath.MyPK = this.FK_MapData + "_" + this.Ath;
            }
            else
            {
                ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node;
            }

            int i = ath.RetrieveFromDBSources();

            if (i == 0 && this.FK_Node != 0)
            {
                /*这里处理 独立表单解决方案, 如果有FK_Node 就说明该节点需要单独控制该附件的属性. */
                MapData mapData = new MapData();
                mapData.RetrieveByAttr(MapDataAttr.No, this.FK_MapData);
                if (mapData.AppType == "0")
                {
                    FrmAttachment souceAthMent = new FrmAttachment();
                    // 查询出来原来的数据.
                    int rowCount = souceAthMent.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, this.Ath, FrmAttachmentAttr.FK_Node, "0");
                    if (rowCount > 0)
                    {
                        ath.Copy(souceAthMent);
                    }
                }
                if (this.FK_Node == 0)
                {
                    ath.MyPK = this.FK_MapData + "_" + this.Ath;
                }
                else
                {
                    ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node;
                }

                //插入一个新的.
                ath.FK_Node    = this.FK_Node;
                ath.FK_MapData = this.FK_MapData;
                ath.NoOfObj    = this.Ath;
                ath.DirectInsert();
            }

            #region 基本属性.
            this.Title = "附件属性设置";
            this.Pub1.AddTable();
            this.Pub1.AddCaption("附件属性设置");

            int idx = 0;
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "基本属性");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("编号");
            TextBox tb = new TextBox();
            tb.ID   = "TB_" + FrmAttachmentAttr.NoOfObj;
            tb.Text = ath.NoOfObj;
            if (this.Ath != null)
            {
                tb.Enabled = false;
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("标示号只能英文字母数字或下滑线.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("名称");
            tb      = new TextBox();
            tb.ID   = "TB_" + FrmAttachmentAttr.Name;
            tb.Text = ath.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("附件的中文名称.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("文件格式");
            tb      = new TextBox();
            tb.ID   = "TB_" + FrmAttachmentAttr.Exts;
            tb.Text = ath.Exts;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("实例:doc,docx,xls,多种格式用逗号分开.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("文件数据存储方式");

            DDL ddl = new DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.SaveWay;
            ddl.Items.Add(new ListItem("按文件方式保存", "0"));
            ddl.Items.Add(new ListItem("保存到数据库", "1"));
            ddl.SetSelectItem(ath.SaveWay);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("上传的附件如何保存?");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("保存到");
            tb         = new TextBox();
            tb.ID      = "TB_" + FrmAttachmentAttr.SaveTo;
            tb.Text    = ath.SaveTo;
            tb.Columns = 60;
            this.Pub1.AddTD("colspan=2", "文件存储格式才有意义", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("类别");
            tb         = new TextBox();
            tb.ID      = "TB_" + FrmAttachmentAttr.Sort;
            tb.Text    = ath.Sort;
            tb.Columns = 60;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("colspan=3", "帮助:类别可以为空,设置的格式为:列头显示名称@类别名1,类别名2,类别名3(列头显示名称@ :可以不写,默认为:类别)");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("完整性校验");

            //  BP.Web.Controls.DDL ddl=new DDL();
            ddl    = new DDL();
            ddl.ID = "DDL_UploadFileNumCheck";
            ddl.BindSysEnum("UploadFileCheck", (int)ath.UploadFileNumCheck);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("高度");
            BP.Web.Controls.TB mytb = new BP.Web.Controls.TB();
            mytb.ID       = "TB_" + FrmAttachmentAttr.H;
            mytb.Text     = ath.H.ToString();
            mytb.ShowType = BP.Web.Controls.TBType.Float;
            this.Pub1.AddTD("colspan=1", mytb);
            this.Pub1.AddTD("对傻瓜表单有效");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("宽度");
            mytb          = new BP.Web.Controls.TB();
            mytb.ID       = "TB_" + FrmAttachmentAttr.W;
            mytb.Text     = ath.W.ToString();
            mytb.ShowType = BP.Web.Controls.TBType.Float;
            mytb.Columns  = 60;
            this.Pub1.AddTD("colspan=1", mytb);
            this.Pub1.AddTD("对傻瓜表单有效");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("自动控制");
            CheckBox cb = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsAutoSize;
            cb.Text    = "自动控制高度与宽度(对傻瓜表单有效)";
            cb.Checked = ath.IsAutoSize;
            this.Pub1.AddTD("colspan=2", cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsNote;
            cb.Text    = "是否增加备注列";
            cb.Checked = ath.IsNote;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsShowTitle;
            cb.Text    = "是否显示标题列";
            cb.Checked = ath.IsShowTitle;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsVisable;
            cb.Text    = "是否可见(不打勾就隐藏,隐藏后就显示不到表单上,可以显示在组件里.)";
            cb.Checked = ath.IsVisable;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();


            GroupFields gfs = new GroupFields(ath.FK_MapData);

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示在分组");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_GroupField";
            ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, BP.Web.Controls.AddAllLocation.None);
            ddl.SetSelectItem(ath.GroupID);
            this.Pub1.AddTD("colspan=1", ddl);
            this.Pub1.AddTD("对傻瓜表单有效");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("展现方式");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.FileShowWay;
            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("Table方式", "0"));
            ddl.Items.Add(new ListItem("图片轮播方式", "1"));
            ddl.Items.Add(new ListItem("自由模式", "2"));

            ddl.SelectedValue = Convert.ToString((int)ath.FileShowWay);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();
            #endregion 基本属性.


            #region 权限控制.
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "权限控制" + BP.WF.Glo.GenerHelpCCForm("帮助", null, null));
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsDownload;
            cb.Text    = "是否可下载";
            cb.Checked = ath.IsDownload;
            this.Pub1.AddTD(cb);


            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.IsDelete;
            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("不能删除", "0"));
            ddl.Items.Add(new ListItem("删除所有", "1"));
            ddl.Items.Add(new ListItem("只能删除自己上传的", "2"));
            ddl.SetSelectItem(ath.IsDeleteInt);
            this.Pub1.AddTD(ddl);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsUpload;
            cb.Text    = "是否可上传";
            cb.Checked = ath.IsUpload;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsOrder;
            cb.Text    = "是否可以排序";
            cb.Checked = ath.IsOrder;
            this.Pub1.AddTD(cb);

            this.Pub1.AddTD("使用上传控件方式");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.UploadCtrl;
            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("批量上传", "0"));
            ddl.Items.Add(new ListItem("普通上传", "1"));
            ddl.SetSelectItem(ath.UploadCtrl);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            if (ath.IsNodeSheet == true)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("数据显示控制方式");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_CtrlWay";
                ddl.Items.Clear();
                ddl.Items.Add(new ListItem("按主键", "0"));
                ddl.Items.Add(new ListItem("FID", "1"));
                ddl.Items.Add(new ListItem("ParentWorkID", "2"));
                ddl.Items.Add(new ListItem("仅可以查看自己上传数据", "3"));
                ddl.SetSelectItem((int)ath.HisCtrlWay);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("子线程节点控制(对节点表单有效)");
                cb         = new CheckBox();
                cb.ID      = "CB_" + FrmAttachmentAttr.IsToHeLiuHZ;
                cb.Text    = "该附件是否要汇总到合流节点上去?(对子线程节点有效)";
                cb.Checked = ath.IsToHeLiuHZ;
                this.Pub1.AddTD("colspan=2", cb);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("合流节点控制(对节点表单有效)");
                cb         = new CheckBox();
                cb.ID      = "CB_" + FrmAttachmentAttr.IsHeLiuHuiZong;
                cb.Text    = "是否是合流节点的汇总附件组件?(对合流节点有效)";
                cb.Checked = ath.IsHeLiuHuiZong;
                this.Pub1.AddTD("colspan=2", cb);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("数据上传控制方式");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_AthUploadWay";
                ddl.Items.Clear();
                ddl.Items.Add(new ListItem("继承模式", "0"));
                ddl.Items.Add(new ListItem("协作模式", "1"));
                ddl.SetSelectItem((int)ath.AthUploadWay);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();
                this.Pub1.AddTREnd();
            }
            #endregion 权限控制.



            #region WebOffice控制方式.

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "WebOffice控制方式(如果上传的是excel word附件,在打开的时候对其的控制).");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableWF;
            cb.Text    = "是否启用weboffice?";
            cb.Checked = ath.IsWoEnableWF;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSave;
            cb.Text    = "是否启用保存?";
            cb.Checked = ath.IsWoEnableSave;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableReadonly;
            cb.Text    = "是否只读?";
            cb.Checked = ath.IsWoEnableReadonly;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();



            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableRevise;
            cb.Text    = "是否启用修订?";
            cb.Checked = ath.IsWoEnableRevise;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableViewKeepMark;
            cb.Text    = "是否查看用户留痕?";
            cb.Checked = ath.IsWoEnableViewKeepMark;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnablePrint;
            cb.Text    = "是否打印?";
            cb.Checked = ath.IsWoEnablePrint;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableOver;
            cb.Text    = "是否启用套红?";
            cb.Checked = ath.IsWoEnableOver;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSeal;
            cb.Text    = "是否启用签章?";
            cb.Checked = ath.IsWoEnableSeal;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableTemplete;
            cb.Text    = "是否启用模板文件?";
            cb.Checked = ath.IsWoEnableTemplete;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableCheck;
            cb.Text    = "是否记录节点信息?";
            cb.Checked = ath.IsWoEnableCheck;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFlow;
            cb.Text    = "是否启用插入流程?";
            cb.Checked = ath.IsWoEnableInsertFlow;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFengXian;
            cb.Text    = "是否启用插入风险点?";
            cb.Checked = ath.IsWoEnableInsertFengXian;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableMarks;
            cb.Text    = "是否进入留痕模式?";
            cb.Checked = ath.IsWoEnableMarks;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableDown;
            cb.Text    = "是否启用下载?";
            cb.Checked = ath.IsWoEnableDown;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            this.Pub1.AddTREnd();
            #endregion WebOffice控制方式.

            #region 快捷键生成规则.
            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "快捷键生成规则.");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.FastKeyIsEnable;
            cb.Text    = "是否启用生成快捷键?(启用就会按照规则生成放在附件的同一个目录里面)";
            cb.Checked = ath.FastKeyIsEnable;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            tb         = new BP.Web.Controls.TB();
            tb.ID      = "TB_" + FrmAttachmentAttr.FastKeyGenerRole;
            tb.Text    = ath.FastKeyGenerRole;
            tb.Columns = 30;
            this.Pub1.AddTD("colspan=3", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("colspan=3", "格式:*FiledName.*OID");
            this.Pub1.AddTREnd();
            #endregion 快捷键生成规则.

            #region 保存按钮.
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("");
            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.Text     = "  Save  ";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.AddTD(btn);

            if (this.Ath != null)
            {
                btn          = new Button();
                btn.ID       = "Btn_Delete";
                btn.Text     = "  Delete  ";
                btn.CssClass = "Btn";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Click);
                this.Pub1.AddTD(btn);
            }
            else
            {
                this.Pub1.AddTD();
            }
            this.Pub1.AddTREnd();
            #endregion 保存按钮.

            this.Pub1.AddTableEnd();
        }
コード例 #18
0
        /// <summary>
        /// 绑定节点
        /// </summary>
        public void BindNode()
        {
            if (this.DoType == "Del")
            {
                TurnTo condDel = new TurnTo();
                condDel.MyPK = this.MyPK;
                condDel.Delete();
                this.Response.Redirect("TurnTo.aspx?FK_Node=" + this.FK_Node, true);
                return;
            }

            BP.WF.Node nd    = new BP.WF.Node(this.FK_NodeInt);
            TurnTos    conds = new TurnTos();

            conds.Retrieve(TurnToAttr.FK_Node, this.FK_Node);

            TurnTo cond = new TurnTo();

            if (this.MyPK != null)
            {
                cond.MyPK = this.MyPK;
                cond.RetrieveFromDBSources();
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
            }
            if (this.FK_Attr != null)
            {
                cond.FK_Attr = this.FK_Attr;
            }

            this.Title = "节点完成后转向条件";
            this.Pub1.AddTable("align=center");
            this.Pub1.AddCaptionLeft("节点完成后转向条件" + nd.Name);
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("描述");
            this.Pub1.AddTREnd();

            // 属性/字段
            MapAttrs attrs  = new MapAttrs("ND" + this.FK_Node);
            MapAttrs attrNs = new MapAttrs();

            foreach (MapAttr attr in attrs)
            {
                if (attr.IsBigDoc)
                {
                    continue;
                }

                switch (attr.KeyOfEn)
                {
                case "Title":
                case "FK_Emp":
                case "MyNum":
                case "FK_NY":
                case WorkAttr.Emps:
                case WorkAttr.OID:
                case StartWorkAttr.Rec:
                case StartWorkAttr.FID:
                    continue;

                default:
                    break;
                }
                attrNs.AddEntity(attr);
            }

            DDL ddl = new DDL();

            ddl.ID = "DDL_Attr";
            ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_Node_SelectedIndexChanged);
            ddl.SetSelectItem(cond.FK_Attr);
            if (attrNs.Count == 0)
            {
                BP.WF.Node tempND = new BP.WF.Node(cond.FK_Node);
                nd.CreateMap();
                this.Pub1.AddTR();
                this.Pub1.AddTD("");
                this.Pub1.AddTD("colspan=2", "节点没有找到合适的条件");
                this.Pub1.AddTREnd();
                return;
            }
            this.Pub1.AddTR();
            this.Pub1.AddTD("属性/字段");
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("请选择节点表单字段。");
            this.Pub1.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.Pub1.AddTR();
            this.Pub1.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    break;
                }
                break;

            default:
                break;
            }
            ddl.SetSelectItem(cond.FK_Operator.ToString());
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("操作符号");
            this.Pub1.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.Pub1.AddTR();
                this.Pub1.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.KeyOfEn);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD("");
                this.Pub1.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.Pub1.AddTR();
                this.Pub1.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD("");
                this.Pub1.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.Pub1.AddTR();
                    this.Pub1.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.Pub1.AddTD(ddl);
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                else
                {
                    this.Pub1.AddTR();
                    this.Pub1.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.Pub1.AddTD(tb);
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                break;
            }

            this.Pub1.AddTR();
            this.Pub1.AddTD("转向Url");
            TextBox mytb = new TextBox();

            mytb.ID      = "TB_TurnToUrl";
            mytb.Text    = cond.TurnToURL;
            mytb.Columns = 90;
            this.Pub1.AddTD("colspan=3", mytb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保 存 ";
            btn.Click   += new EventHandler(btn_Save_Node_Click);
            this.Pub1.Add(btn);

            if (cond.IsExits == true)
            {
                Btn btnN = new Btn();
                btnN.ShowType = BP.Web.Controls.BtnType.Confirm;
                btnN.ID       = "Btn_Del";
                btnN.Text     = " 删 除 ";
                btnN.Click   += new EventHandler(btn_Del_Node_Click);
                this.Pub1.Add(btnN);
            }

            this.Pub1.AddBR();
            this.Pub1.AddBR("提示:Url中除系统的参数(FromFlow,FromNode,SID,WebUser.No)外,您还可以增加约定的变量。");
            this.Pub1.AddBR("&nbsp;&nbsp;&nbsp;例如: ../EIP/aaa.aspx?Jiner=@jiner,@jiner为表单字段");
            this.Pub1.AddBR("&nbsp;&nbsp;&nbsp;系统处理后的转向url为: <br>../EIP/aaa.aspx?Jiner=123&UserNo=abc&SID=xxxx&FromFlow=010&FromNode=108。");

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithHR();

            if (conds.Count > 0)
            {
                this.Pub1.AddTable();
                this.Pub1.AddCaption("方向条件列表");

                this.Pub1.AddTR();
                this.Pub1.AddTDTitle("IDX");
                this.Pub1.AddTDTitle("属性键");
                this.Pub1.AddTDTitle("名称");
                this.Pub1.AddTDTitle("操作符号");
                this.Pub1.AddTDTitle("值");
                this.Pub1.AddTDTitle("值描述");
                this.Pub1.AddTDTitle("Url");
                this.Pub1.AddTDTitle("编辑");
                this.Pub1.AddTDTitle("删除");
                this.Pub1.AddTREnd();

                int idx = 0;
                foreach (TurnTo tt in conds)
                {
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(tt.AttrKey);
                    this.Pub1.AddTD(tt.AttrT);

                    this.Pub1.AddTD(tt.FK_Operator);
                    this.Pub1.AddTD(tt.OperatorValueStr);
                    this.Pub1.AddTD(tt.OperatorValueT);
                    this.Pub1.AddTDBigDoc(tt.TurnToURL);

                    this.Pub1.AddTDA("TurnTo.aspx?MyPK=" + tt.MyPK + "&FK_Node=" + tt.FK_Node, "<img src='../Img/Btn/Edit.gif' />");
                    this.Pub1.AddTDA("TurnTo.aspx?MyPK=" + tt.MyPK + "&FK_Node=" + tt.FK_Node + "&DoType=Del", "<img src='../Img/Btn/Delete.gif' />");

                    this.Pub1.AddTREnd();
                }
                this.Pub1.AddTableEnd();
            }
        }
コード例 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Request.QueryString["FK_Node"] == null)
            {
                // 如果没有接收到节点ID参数,就绑定当前人员可以执行批量审核的待办工作.
                int num = this.BindNodeList();
                return;
            }

            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            Flow       fl  = nd.HisFlow;
            string     sql = "";

            if (nd.HisRunModel == RunModel.SubThread)
            {
                sql = "SELECT a.*, b.Starter,b.ADT,b.WorkID FROM " + fl.PTable
                      + " a , WF_EmpWorks b WHERE a.OID=B.FID AND b.WFState Not IN (7) AND b.FK_Node=" + nd.NodeID
                      + " AND b.FK_Emp='" + WebUser.No + "'";
            }
            else
            {
                sql = "SELECT a.*, b.Starter,b.ADT,b.WorkID FROM " + fl.PTable
                      + " a , WF_EmpWorks b WHERE a.OID=B.WorkID AND b.WFState Not IN (7) AND b.FK_Node=" + nd.NodeID
                      + " AND b.FK_Emp='" + WebUser.No + "'";
            }


            // string sql = "SELECT Title,RDT,ADT,SDT,FID,WorkID,Starter FROM WF_EmpWorks WHERE FK_Emp='" + WebUser.No + "'";
            DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);

            if (nd.HisBatchRole == BatchRole.None)
            {
                this.Pub1.AddFieldSetRed("错误", "节点(" + nd.Name + ")不能执行批量处理操作.");
                return;
            }

            string inSQL = "SELECT WorkID FROM WF_EmpWorks WHERE FK_Emp='" + WebUser.No + "' AND WFState!=7 AND FK_Node=" + this.FK_Node;
            Works  wks   = nd.HisWorks;

            wks.RetrieveInSQL(inSQL);

            BtnLab btnLab = new BtnLab(this.FK_Node);

            this.Pub1.AddTable("width='100%'");

            //移动按钮位置
            if (nd.HisBatchRole == BatchRole.Group)
            {
                this.Pub1.AddCaptionMsgLong("<a href='Batch.aspx'>返回</a>&nbsp;&nbsp;<input  ID=\"btnGroup\" type=\"button\" value=\"合卷批复\" CssClass=\"Btn\" onclick=\"BatchGroup()\" />");
            }
            else
            {
                this.Pub1.AddCaptionMsgLong(nd.FlowName + " - <a href='Batch.aspx'>返回</a>");
            }

            #region 生成标题.
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序号");
            string str1 = "<INPUT id='checkedAll' onclick='SelectAll()'  text='选择' value='选择' type='checkbox' name='checkedAll'>";
            this.Pub1.AddTDTitle("align='left'", str1 + "选择");
            this.Pub1.AddTDTitle("标题");
            this.Pub1.AddTDTitle("发起人");
            this.Pub1.AddTDTitle("接受日期");

            // 显示出来字段. BatchParas 的规则为 @字段中文名=fieldName@字段中文名1=fieldName1
            MapAttrs attrs = new MapAttrs(this.FK_MapData);
            string[] strs  = nd.BatchParas.Split(',');
            foreach (string str in strs)
            {
                if (string.IsNullOrEmpty(str) ||
                    str.Contains("@PFlowNo") == true)
                {
                    continue;
                }

                foreach (MapAttr attr in attrs)
                {
                    if (str != attr.KeyOfEn)
                    {
                        continue;
                    }
                    this.Pub1.AddTDTitle(attr.Name);
                }
            }
            this.Pub1.AddTREnd();
            #endregion 生成标题.

            GERpt rpt = nd.HisFlow.HisGERpt;
            bool  is1 = false;
            int   idx = 0;
            foreach (Work wk in wks)
            {
                idx++;
                if (idx == nd.BatchListCount)
                {
                    break;
                }

                #region 显示必要的列.
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(idx);
                CheckBox cb = new CheckBox();
                cb.ID = "CB_" + wk.OID.ToString();
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["WorkID"].ToString() != wk.OID.ToString())
                    {
                        continue;
                    }
                    cb.Text = "选择";
                    this.Pub1.AddTD(cb);

                    //this.Pub1.AddTD("<a href=\"javascript:WinOpen('MyFlow.aspx?WorkID=" + wk.OID + "&FK_Node=" + this.FK_Node + "&FK_Flow="+nd.FK_Flow+"','s')\" >" + dr["Title"].ToString() + "</a>");
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('FlowFormTree/Default.aspx?WorkID=" + wk.OID + "&FK_Node=" + this.FK_Node + "&IsSend=0&FK_Flow=" + nd.FK_Flow + "','s')\" >" + dr["Title"].ToString() + "</a>");
                    this.Pub1.AddTD(dr["Starter"].ToString());
                    this.Pub1.AddTD(dr["ADT"].ToString());
                    break;
                }
                #endregion 显示必要的列.

                #region 显示出来自定义的字段数据..
                foreach (string str in strs)
                {
                    if (string.IsNullOrEmpty(str) || str.Contains("@PFlowNo") == true)
                    {
                        continue;
                    }
                    foreach (MapAttr attr in attrs)
                    {
                        if (str != attr.KeyOfEn)
                        {
                            continue;
                        }

                        TB tb = new TB();
                        tb.ID = "TB_" + attr.KeyOfEn + "_" + wk.OID;
                        switch (attr.LGType)
                        {
                        case FieldTypeS.Normal:
                            switch (attr.MyDataType)
                            {
                            case BP.DA.DataType.AppString:
                                if (attr.UIRows == 1)
                                {
                                    tb.Text = wk.GetValStringByKey(attr.KeyOfEn);
                                    tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 15px;padding: 0px;margin: 0px;";
                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TB";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }
                                    this.Pub1.AddTD(tb);
                                }
                                else
                                {
                                    tb.TextMode                = TextBoxMode.MultiLine;
                                    tb.Text                    = wk.GetValStringByKey(attr.KeyOfEn);
                                    tb.Attributes["style"]     = "width: " + attr.UIWidth + "px; text-align: left;padding: 0px;margin: 0px;";
                                    tb.Attributes["maxlength"] = attr.MaxLen.ToString();
                                    tb.Rows                    = attr.UIRows;
                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TBDoc";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }
                                    this.Pub1.AddTD(tb);
                                }
                                break;

                            case BP.DA.DataType.AppDate:
                                tb.ShowType = TBType.Date;
                                tb.Text     = wk.GetValStrByKey(attr.KeyOfEn);

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker();";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TB";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppDateTime:
                                tb.ShowType = TBType.DateTime;
                                tb.Text     = wk.GetValStrByKey(attr.KeyOfEn);     // en.GetValStrByKey(attr.KeyOfEn);

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBcalendar";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                                }
                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppBoolean:
                                cb = new CheckBox();
                                //cb.Width = 350;
                                cb.Text    = attr.Name;
                                cb.ID      = "CB_" + attr.KeyOfEn + "_" + wk.OID;
                                cb.Checked = attr.DefValOfBool;
                                cb.Enabled = attr.UIIsEnable;
                                cb.Checked = wk.GetValBooleanByKey(attr.KeyOfEn);

                                if (cb.Enabled == false)
                                {
                                    cb.Enabled = false;
                                }
                                else
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    // cb.Attributes["onmousedown"] = "Change('" + attr.FK_MapData + "')";
                                    cb.Enabled = true;
                                }
                                this.Pub1.AddTD(cb);
                                break;

                            case BP.DA.DataType.AppDouble:
                            case BP.DA.DataType.AppFloat:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppInt:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'int');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppMoney:
                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,'0.00');");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                //  tb.ShowType = TBType.Moneny;
                                tb.Text = wk.GetValIntByKey(attr.KeyOfEn).ToString("0.00");

                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppRate:
                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }
                                tb.ShowType            = TBType.Moneny;
                                tb.Text                = wk.GetValMoneyByKey(attr.KeyOfEn).ToString("0.00");
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            default:
                                break;
                            }
                            break;

                        case FieldTypeS.Enum:
                            if (attr.UIContralType == UIContralType.DDL)
                            {
                                DDL ddle = new DDL();
                                ddle.ID = "DDL_" + attr.KeyOfEn + "_" + wk.OID;
                                ddle.BindSysEnum(attr.UIBindKey);
                                ddle.SetSelectItem(wk.GetValIntByKey(attr.KeyOfEn));
                                ddle.Enabled = attr.UIIsEnable;
                                ddle.Attributes["tabindex"] = attr.Idx.ToString();
                                if (attr.UIIsEnable)
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    ddle.Attributes["onchange"] = "Change('" + attr.FK_MapData + "')";
                                }
                                //    ddle.Enabled = false;
                                this.Pub1.AddTD(ddle);
                            }
                            else
                            {
                            }
                            break;

                        case FieldTypeS.FK:
                            DDL ddl1 = new DDL();
                            ddl1.ID = "DDL_" + attr.KeyOfEn + "_" + wk.OID;
                            ddl1.Attributes["tabindex"] = attr.Idx.ToString();
                            if (ddl1.Enabled)
                            {
                                EntitiesNoName ens = attr.HisEntitiesNoName;
                                ens.RetrieveAll();
                                ddl1.BindEntities(ens);
                                ddl1.SetSelectItem(wk.GetValStrByKey(attr.KeyOfEn));
                            }
                            else
                            {
                                ddl1.Attributes["style"] = "width: " + attr.UIWidth + "px;height: 19px;";
                                if (ddl1.Enabled == true)
                                {
                                    ddl1.Enabled = false;
                                }
                                ddl1.Attributes["Width"] = attr.UIWidth.ToString();
                                ddl1.Items.Add(new ListItem(wk.GetValRefTextByKey(attr.KeyOfEn), wk.GetValStrByKey(attr.KeyOfEn)));
                            }
                            ddl1.Enabled = attr.UIIsEnable;
                            this.Pub1.AddTD(ddl1);
                            break;

                        default:
                            break;
                        }
                    }
                }
                #endregion 显示出来自定义的字段数据..

                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEndWithHR();

            MapExts mes = new MapExts(this.FK_MapData);

            #region 处理扩展属性.
            if (mes.Count != 0)
            {
                this.Page.RegisterClientScriptBlock("s81",
                                                    "<script language='JavaScript' src='/WF/Scripts/jquery-1.4.1.min.js' ></script>");
                this.Page.RegisterClientScriptBlock("b81",
                                                    "<script language='JavaScript' src='/WF/CCForm/MapExt.js' defer='defer' type='text/javascript' ></script>");
                this.Pub1.Add("<div id='divinfo' style='width: 155px; position: absolute; color: Lime; display: none;cursor: pointer;align:left'></div>");
                this.Page.RegisterClientScriptBlock("dCd",
                                                    "<script language='JavaScript' src='/DataUser/JSLibData/" + this.FK_MapData + ".js' ></script>");

                foreach (Work wk in wks)
                {
                    foreach (MapExt me in mes)
                    {
                        switch (me.ExtType)
                        {
                        case MapExtXmlList.DDLFullCtrl:     // 自动填充.
                            DDL ddlOper = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + wk.OID);
                            if (ddlOper == null)
                            {
                                continue;
                            }
                            ddlOper.Attributes["onchange"] = "DDLFullCtrl(this.value,\'" + ddlOper.ClientID + "\', \'" + me.MyPK + "\')";
                            break;

                        case MapExtXmlList.ActiveDDL:
                            DDL    ddlPerant = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + wk.OID);
                            string val, valC;
                            if (ddlPerant == null || wk.OID < 100)
                            {
                                continue;
                            }

#warning 此处需要优化
                            string ddlC = "ContentPlaceHolder1_Batch1_DDL_" + me.AttrsOfActive + "_" + wk.OID;
                            //  ddlPerant.Attributes["onchange"] = " isChange=true; DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";
                            ddlPerant.Attributes["onchange"] = "DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";

                            DDL ddlChild = this.Pub1.GetDDLByID("DDL_" + me.AttrsOfActive + "_" + wk.OID);
                            val = ddlPerant.SelectedItemStringVal;
                            if (ddlChild.Items.Count == 0)
                            {
                                valC = wk.GetValStrByKey(me.AttrsOfActive);
                            }
                            else
                            {
                                valC = ddlChild.SelectedItemStringVal;
                            }

                            string mysql = me.Doc.Replace("@Key", val);
                            if (mysql.Contains("@"))
                            {
                                mysql = BP.WF.Glo.DealExp(mysql, wk, null);
                            }

                            ddlChild.Bind(DBAccess.RunSQLReturnTable(mysql), "No", "Name");
                            if (ddlChild.SetSelectItem(valC) == false)
                            {
                                ddlChild.Items.Insert(0, new ListItem("请选择" + valC, valC));
                                ddlChild.SelectedIndex = 0;
                            }
                            break;

                        case MapExtXmlList.AutoFullDLL:     //自动填充下拉框的范围.
                            DDL ddlFull = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + wk.OID);
                            if (ddlFull == null)
                            {
                                continue;
                            }

                            string valOld = wk.GetValStrByKey(me.AttrOfOper);

                            string fullSQL = me.Doc.Replace("@WebUser.No", WebUser.No);
                            fullSQL = fullSQL.Replace("@WebUser.Name", WebUser.Name);
                            fullSQL = fullSQL.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                            fullSQL = fullSQL.Replace("@WebUser.FK_DeptName", WebUser.FK_DeptName);
                            fullSQL = fullSQL.Replace("@Key", this.Request.QueryString["Key"]);

                            if (fullSQL.Contains("@"))
                            {
                                Attrs attrsFull = wk.EnMap.Attrs;
                                foreach (Attr attr in attrsFull)
                                {
                                    if (fullSQL.Contains("@") == false)
                                    {
                                        break;
                                    }
                                    fullSQL = fullSQL.Replace("@" + attr.Key, wk.GetValStrByKey(attr.Key));
                                }
                            }

                            ddlFull.Items.Clear();
                            ddlFull.Bind(DBAccess.RunSQLReturnTable(fullSQL), "No", "Name");
                            if (ddlFull.SetSelectItem(valOld) == false)
                            {
                                ddlFull.Items.Insert(0, new ListItem("请选择" + valOld, valOld));
                                ddlFull.SelectedIndex = 0;
                            }
                            // ddlFull.Attributes["onchange"] = " isChange=true;";
                            break;

                        case MapExtXmlList.TBFullCtrl:     // 自动填充.
                            TextBox tbAuto = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            if (tbAuto == null)
                            {
                                continue;
                            }
                            // tbAuto.Attributes["onkeyup"] = " isChange=true; DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                            tbAuto.Attributes["onkeyup"]      = " DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                            tbAuto.Attributes["AUTOCOMPLETE"] = "OFF";
                            if (me.Tag != "")
                            {
                                /* 处理下拉框的选择范围的问题 */
                                string[] strsTmp = me.Tag.Split('$');
                                foreach (string str in strsTmp)
                                {
                                    string[] myCtl = str.Split(':');
                                    string   ctlID = myCtl[0];
                                    DDL      ddlC1 = this.Pub1.GetDDLByID("DDL_" + ctlID + "_" + wk.OID);
                                    if (ddlC1 == null)
                                    {
                                        //me.Tag = "";
                                        // me.Update();
                                        continue;
                                    }
                                    sql = myCtl[1].Replace("~", "'");
                                    sql = sql.Replace("@WebUser.No", WebUser.No);
                                    sql = sql.Replace("@WebUser.Name", WebUser.Name);
                                    sql = sql.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                                    sql = sql.Replace("@Key", tbAuto.Text.Trim());
                                    dt  = DBAccess.RunSQLReturnTable(sql);
                                    string valC1 = ddlC1.SelectedItemStringVal;
                                    ddlC1.Items.Clear();
                                    foreach (DataRow dr in dt.Rows)
                                    {
                                        ddlC1.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                                    }
                                    ddlC1.SetSelectItem(valC1);
                                }
                            }
                            break;

                        case MapExtXmlList.InputCheck:
                            TextBox tbCheck = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            if (tbCheck != null)
                            {
                                tbCheck.Attributes[me.Tag2] += " rowPK=" + wk.OID + "; " + me.Tag1 + "(this);";
                            }
                            break;

                        case MapExtXmlList.PopVal:     //弹出窗.
                            TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            //  tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            tb.Attributes["ondblclick"] = " ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.Link:     // 超链接.
                            //TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + mydtl.OID);
                            //tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.RegularExpression:    //正则表达式,对数据控件处理
                            TextBox tbExp = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            if (tbExp == null || me.Tag == "onsubmit")
                            {
                                continue;
                            }
                            //验证输入的正则格式
                            string regFilter = me.Doc;
                            if (regFilter.LastIndexOf("/g") < 0 && regFilter.LastIndexOf('/') < 0)
                            {
                                regFilter = "'" + regFilter + "'";
                            }
                            //处理事件
                            tbExp.Attributes.Add("" + me.Tag + "", "return txtTest_Onkeyup(this," + regFilter + ",'" + me.Tag1 + "')");    //[me.Tag] += "this.value=this.value.replace(" + regFilter + ",'')";
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            #endregion 拓展属性

            Button btn = new Button();
            if (nd.HisBatchRole == BatchRole.Ordinary)
            {
                /*如果普通的批处理.*/
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Send";
                if (nd.BatchParas_IsSelfUrl == true)
                {
                    btn.Text = "选择要批量处理的工作";
                }
                else
                {
                    btn.Text = "批量处理:" + btnLab.SendLab;
                }
                btn.Click += new EventHandler(btn_Send_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
                if (btnLab.ReturnEnable == false)
                {
                    btn          = new Button();
                    btn.CssClass = "Btn";
                    btn.ID       = "Btn_Return";
                    btn.Text     = "批量处理:" + btnLab.ReturnEnable;
                    btn.Click   += new EventHandler(btnDelete_Return_Click);
                    btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                    this.Pub1.Add(btn);
                }
            }

            if (nd.HisBatchRole == BatchRole.Group)
            {
                /*如果分组审核?*/
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Group";
                //btn.Text = btnLab.SendLab;
                btn.Text   = "合卷批复";
                btn.Click += new EventHandler(btn_Group_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
            }

            if (btnLab.ReturnEnable == false)
            {
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Return";
                btn.Text     = "批量处理:" + btnLab.ReturnEnable;
                btn.Click   += new EventHandler(btnDelete_Return_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
            }

            if (btnLab.DeleteEnable != 0)
            {
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Del";
                btn.Text     = "批量处理:" + btnLab.DeleteLab;
                btn.Click   += new EventHandler(btnDelete_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
            }
        }
コード例 #20
0
ファイル: EditEnum.aspx.cs プロジェクト: zhaoyingju/ccflow
        public void BindEnum(MapAttr mapAttr)
        {
            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("说明");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字段英文名称");
            TB tb = new TB();

            if (this.RefNo != null)
            {
                this.Pub1.AddTD(mapAttr.KeyOfEn);
            }
            else
            {
                tb      = new TB();
                tb.ID   = "TB_KeyOfEn";
                tb.Text = mapAttr.KeyOfEn;
                this.Pub1.AddTD(tb);
            }
            // this.Pub1.AddTDTitle("&nbsp;");
            //this.Pub1.AddTD("不要以数字开头、不要中文。");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字段中文名称");
            tb      = new TB();
            tb.ID   = "TB_Name";
            tb.Text = mapAttr.Name;
            tb.Attributes["width"] = "100%";
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("默认值");

            DDL ddl = new DDL();

            ddl.ID = "DDL";
            ddl.BindSysEnum(mapAttr.UIBindKey);
            ddl.SetSelectItem(mapAttr.DefVal);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("<a href='SysEnum.aspx?RefNo=" + mapAttr.UIBindKey + "'>编辑</a>");
            this.Pub1.AddTREnd();


            #region 是否可编辑
            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("是否可编辑");
            this.Pub1.AddTDBegin();
            RadioButton rb = new RadioButton();
            rb.ID        = "RB_UIIsEnable_0";
            rb.Text      = "不可编辑";
            rb.GroupName = "s";
            if (mapAttr.UIIsEnable)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }

            this.Pub1.Add(rb);
            rb           = new RadioButton();
            rb.ID        = "RB_UIIsEnable_1";
            rb.Text      = "可编辑";
            rb.GroupName = "s";

            if (mapAttr.UIIsEnable)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();

            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            #endregion 是否可编辑


            #region 展示控件
            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("控件类型");
            this.Pub1.AddTDBegin();
            rb           = new RadioButton();
            rb.ID        = "RB_Ctrl_0";
            rb.Text      = "下拉框";
            rb.GroupName = "Ctrl";
            if (mapAttr.UIContralType == UIContralType.DDL)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            this.Pub1.Add(rb);
            rb           = new RadioButton();
            rb.ID        = "RB_Ctrl_1";
            rb.Text      = "单选按钮";
            rb.GroupName = "Ctrl";

            if (mapAttr.UIContralType == UIContralType.DDL)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }
            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();

            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            #endregion 展示控件


            #region 是否可界面可见
            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("是否界面可见"); //是否界面可见
            this.Pub1.AddTDBegin();
            rb           = new RadioButton();
            rb.ID        = "RB_UIVisible_0";
            rb.Text      = "不可见"; // 界面不可见
            rb.GroupName = "sa3";
            if (mapAttr.UIVisible)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }

            this.Pub1.Add(rb);
            if (mapAttr.IsTableAttr)
            {
                rb.Enabled = false;
            }

            rb           = new RadioButton();
            rb.ID        = "RB_UIVisible_1";
            rb.Text      = "界面可见"; // 界面可见;
            rb.GroupName = "sa3";

            if (mapAttr.UIVisible)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            if (mapAttr.IsTableAttr)
            {
                rb.Enabled = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();

            this.Pub1.AddTD("不可见则为隐藏字段.");
            this.Pub1.AddTREnd();
            #endregion 是否可界面可见


            #region 是否可单独行显示
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("呈现方式"); //呈现方式;
            this.Pub1.AddTDBegin();
            rb           = new RadioButton();
            rb.ID        = "RB_UIIsLine_0";
            rb.Text      = "两列显示"; // 两行
            rb.GroupName = "sa";
            if (mapAttr.UIIsLine)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }

            this.Pub1.Add(rb);
            rb           = new RadioButton();
            rb.ID        = "RB_UIIsLine_1";
            rb.Text      = "整行显示"; // "一行";
            rb.GroupName = "sa";

            if (mapAttr.UIIsLine)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTD("对傻瓜表单有效");

            //  this.Pub1.AddTD("控制该它在表单的显示方式");
            this.Pub1.AddTREnd();
            #endregion 是否可编辑


            #region 字段分组
            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字段分组");
            DDL ddlGroup = new DDL();
            ddlGroup.ID = "DDL_GroupID";
            GroupFields gfs = new GroupFields(mapAttr.FK_MapData);
            ddlGroup.Bind(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab);
            if (mapAttr.GroupID == 0)
            {
                mapAttr.GroupID = this.GroupField;
            }

            ddlGroup.SetSelectItem(mapAttr.GroupID);
            this.Pub1.AddTD(ddlGroup);
            this.Pub1.AddTD("修改隶属分组");
            this.Pub1.AddTREnd();
            #endregion 字段分组



            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD colspan=4 >");
            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose";
            btn.CssClass = "Btn";
            btn.Text     = "保存并关闭";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndNew";
            btn.CssClass = "Btn";
            btn.Text     = "保存并新建";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            if (this.RefNo != null)
            {
                btn          = new Button();
                btn.ID       = "Btn_AutoFull";
                btn.CssClass = "Btn";
                btn.Text     = "扩展设置";
                //  btn.Click += new EventHandler(btn_Save_Click);
                btn.Attributes["onclick"] = "javascript:WinOpen('AutoFull.aspx?RefNo=" + this.RefNo + "&FK_MapData=" + mapAttr.FK_MapData + "',''); return false;";
                this.Pub1.Add(btn);

                if (mapAttr.HisEditType == EditType.Edit)
                {
                    btn          = new Button();
                    btn.ID       = "Btn_Del";
                    btn.CssClass = "Btn";
                    btn.Text     = "删除";
                    btn.Click   += new EventHandler(btn_Save_Click);
                    btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                    this.Pub1.Add(btn);
                }
            }

            string url = "Do.aspx?DoType=AddF&MyPK=" + mapAttr.FK_MapData + "&IDX=" + mapAttr.IDX;
            this.Pub1.Add("<a href='" + url + "'><img src='/WF/Img/Btn/New.gif' border=0>新建</a></TD>");
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithBR();
        }
コード例 #21
0
        public void BindList()
        {
            string text = "";

            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            FrmNodes   fns = new FrmNodes(this.FK_Flow, this.FK_Node);

            #region 如果没有ndFrm 就增加上.
            bool isHaveNDFrm = false;
            foreach (FrmNode fn in fns)
            {
                if (fn.FK_Frm == "ND" + this.FK_Node)
                {
                    isHaveNDFrm = true;
                    break;
                }
            }
            if (isHaveNDFrm == false)
            {
                FrmNode fn = new FrmNode();
                fn.FK_Flow = this.FK_Flow;
                fn.FK_Frm  = "ND" + this.FK_Node;
                fn.FK_Node = this.FK_Node;

                fn.FrmEnableRole = FrmEnableRole.Disable; //就是默认不启用.
                fn.FrmSln        = 0;
                //  fn.IsEdit = true;
                fn.IsEnableLoadData = true;
                fn.Insert();
                fns.AddEntity(fn);
            }
            #endregion 如果没有ndFrm 就增加上.

            string tfModel = SystemConfig.AppSettings["TreeFrmModel"];
            this.Pub1.AddTable("width=100%");
            this.Pub1.AddCaption("设置节点:(" + nd.Name + ")绑定表单");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            if (tfModel == "1")
            {
                this.Pub1.AddTDTitle("关键字段");
            }

            this.Pub1.AddTDTitle("启用规则");
            // this.Pub1.AddTDTitle("可编辑否?");
            this.Pub1.AddTDTitle("可打印否?");
            this.Pub1.AddTDTitle("是否启用<br>装载填充事件");
            this.Pub1.AddTDTitle("权限控制<br>方案");
            this.Pub1.AddTDTitle("表单元素<br>自定义设置");
            this.Pub1.AddTDTitle("谁是主键?");
            this.Pub1.AddTDTitle("文件模版");

            if (nd.HisRunModel == RunModel.FL || nd.HisRunModel == RunModel.FHL)
            {
                this.Pub1.AddTDTitle("是否1变N"); //add by zhoupeng 2016.03.25 for hainan.
            }
            if (nd.HisRunModel == RunModel.SubThread)
            {
                this.Pub1.AddTDTitle("数据汇总"); //add by zhoupeng 2016.03.25 for hainan.
            }
            this.Pub1.AddTDTitle("顺序");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTREnd();

            int idx = 1;
            foreach (FrmNode fn in fns)
            {
                MapData md = new MapData();
                md.No = fn.FK_Frm;
                if (md.RetrieveFromDBSources() == 0)
                {
                    fn.Delete();  //说明该表单不存在了,就需要把这个删除掉.
                    continue;
                }

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD(fn.FK_Frm);

                if (fn.FK_Frm == "ND" + this.FK_Node)
                {
                    this.Pub1.AddTDB("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>");
                }
                else
                {
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>");
                }

                DDL ddl = new DDL();
                //获取当前独立表单中的所有字段  add by 海南  zqp
                if (tfModel == "1")
                {
                    //获取它的字段集合
                    MapAttrs attrs = new MapAttrs();
                    attrs.Retrieve(MapAttrAttr.FK_MapData, md.No);

                    MapAttrs attrNs = new MapAttrs();
                    //去掉一些基础字段
                    foreach (MapAttr attr in attrs)
                    {
                        switch (attr.KeyOfEn)
                        {
                        case "Title":
                        case "FK_Emp":
                        case "MyNum":
                        case "FK_NY":
                        case WorkAttr.Emps:
                        case WorkAttr.OID:
                        case StartWorkAttr.Rec:
                        case StartWorkAttr.FID:
                            continue;

                        default:
                            break;
                        }
                        attrNs.AddEntity(attr);
                    }
                    //添加到页面中
                    DDL myddl = new DDL();
                    myddl.ID = "DDL_Attr_" + md.No;
                    myddl.BindEntities(attrNs, MapAttrAttr.KeyOfEn, MapAttrAttr.Name);
                    myddl.SetSelectItem(fn.GuanJianZiDuan);
                    this.Pub1.AddTD(myddl);
                }

                //为了扩充的需要,把下拉框的模式去掉了.
                //ddl = new DDL();
                //ddl.ID = "DDL_FrmEnableRole_" + md.No;
                //ddl.Items.Add(new ListItem("始终启用", "0"));
                //ddl.Items.Add(new ListItem("有数据时启用", "1"));
                //ddl.Items.Add(new ListItem("有参数时启用", "2"));
                //ddl.Items.Add(new ListItem("按表单字段条件", "3"));
                //ddl.Items.Add(new ListItem("按SQL表达式", "4"));
                //ddl.SetSelectItem(fn.FrmEnableRoleInt); //设置权限控制方案.
                //this.Pub1.AddTD(ddl);

                this.Pub1.AddTD("<a href=\"javascript:WinOpen('./FlowFrm/FrmEnableRole.aspx?FK_Node=" + fn.FK_Node + "&FK_MapData=" + fn.FK_Frm + "')\">设置(" + fn.FrmEnableRoleText + ")</a>");

                CheckBox cb = new CheckBox();
                //cb.ID = "CB_IsEdit_" + md.No;
                //cb.Text = "可编辑否?";
                //cb.Checked = fn.IsEdit;
                //this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsPrint_" + md.No;
                cb.Text    = "打印否?";
                cb.Checked = fn.IsPrint;
                this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsEnableLoadData_" + md.No;
                cb.Text    = "启用否?";
                cb.Checked = fn.IsEnableLoadData;
                this.Pub1.AddTD(cb);

                ddl    = new DDL();
                ddl.ID = "DDL_Sln_" + md.No;
                ddl.Items.Add(new ListItem("默认方案", "0"));
                ddl.Items.Add(new ListItem("自定义", this.FK_Node.ToString()));
                ddl.Items.Add(new ListItem("不可编辑", "1")); //让其不可编辑.

                ddl.SetSelectItem(fn.FrmSln);             //设置权限控制方案.
                this.Pub1.AddTD(ddl);

                this.Pub1.AddTDBegin();
                this.Pub1.Add("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >字段</a>");
                this.Pub1.Add("-<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >附件</a>");
                this.Pub1.Add("-<a href=\"javascript:WinDtl('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >从表</a>");

                if (md.HisFrmType == FrmType.ExcelFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarExcel('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarExcel</a>");
                }

                if (md.HisFrmType == FrmType.WordFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarWord('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarWord</a>");
                }

                this.Pub1.AddTDEnd();

                ddl    = new DDL();
                ddl.ID = "DDL_WhoIsPK_" + md.No;
                ddl.BindSysEnum("WhoIsPK");
                ddl.SetSelectItem((int)fn.WhoIsPK); //谁是主键?.
                this.Pub1.AddTD(ddl);

                if (md.HisFrmType == FrmType.ExcelFrm || md.HisFrmType == FrmType.WordFrm)
                {
                    ddl    = new DDL();
                    ddl.ID = "DDL_File_" + md.No;
                    string[] files = System.IO.Directory.GetFiles(BP.Sys.SystemConfig.PathOfDataUser + "\\FrmOfficeTemplate\\", md.No + "*.xls");
                    foreach (string str in files)
                    {
                        //System.IO.FileInfo info=new System.IO.FileInfo(
                        ddl.Items.Add(new ListItem(str.Substring(str.LastIndexOf(md.No)), str));
                    }
                    this.Pub1.AddTD(ddl);
                }
                else
                {
                    this.Pub1.AddTD("无效");
                }

                if (nd.HisRunModel == RunModel.FL || nd.HisRunModel == RunModel.FHL)
                {
                    cb         = new CheckBox();
                    cb.ID      = "CB_Is1ToN_" + md.No;
                    cb.Text    = "是否1变N?";
                    cb.Checked = fn.Is1ToN;
                    this.Pub1.AddTD(cb);//add by zhoupeng 2016.03.25 for hainan.
                }

                if (nd.HisRunModel == RunModel.SubThread)
                {
                    ddl    = new DDL();
                    ddl.ID = "DDL_HuiZong_" + md.No;
                    ddl.Items.Add(new ListItem("不汇总数据", "0"));

                    BP.WF.Template.FrmNodes myfns = new FrmNodes();
                    myfns.Retrieve(FrmNodeAttr.FK_Flow, nd.FK_Flow);

                    //组合这个字符串.
                    string strs = ";" + fn.FK_Frm + ";";
                    foreach (BP.WF.Template.FrmNode myfrn in myfns)
                    {
                        if (strs.Contains(";" + myfrn.FK_Frm + ";") == true)
                        {
                            continue;
                        }

                        strs += ";" + myfrn.FK_Frm + ";";

                        //检查该frm 是否有dtl.
                        MapDtls dtls = new MapDtls(myfrn.FK_Frm);
                        if (dtls.Count == 0)
                        {
                            continue;
                        }

                        foreach (MapDtl dtl in dtls)
                        {
                            ddl.Items.Add(new ListItem("汇总到:" + myfrn.HisFrm.Name + "-" + dtl.Name, myfrn.HisFrm.No + "@" + dtl.No));
                        }
                    }
                    ddl.SetSelectItem(fn.HuiZong); //设置汇总..
                    this.Pub1.AddTD(ddl);
                }

                TextBox tb = new TextBox();
                tb.ID      = "TB_Idx_" + md.No;
                tb.Text    = fn.Idx.ToString();
                tb.Columns = 5;
                this.Pub1.AddTD(tb);

                this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Up", "上移");
                this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Down", "下移");

                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();

            text = "<input type=button onclick=\"javascript:BindFrms('" + this.FK_Node + "','" + this.FK_Flow + "');\" value='修改表单绑定'  class=Btn />";
            this.Pub1.Add(text);

            Button btn = new Button();
            btn.ID       = "Save";
            btn.Text     = "保存";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);
            this.Pub1.Add(btn);

            text = "<input type=button onclick=\"javascript:window.close();\" value='关闭'  class=Btn />";
            this.Pub1.Add(text);
        }
コード例 #22
0
        /// <summary>
        /// 编辑权限与顺序
        /// </summary>
        public void BindEditPowerOrder()
        {
            this.Pub1.AddH2("表单权限与显示顺序");
            this.Pub1.AddHR();
            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("显示方式");
            this.Pub1.AddTDTitle("是否可编辑?");
            this.Pub1.AddTDTitle("是否可打印");
            // this.Pub1.AddTDTitle("表单元素权限控制方案");
            this.Pub1.AddTDTitle("权限控制方案");

            this.Pub1.AddTDTitle("自定义方案设置");
            this.Pub1.AddTDTitle("谁是主键?");
            this.Pub1.AddTDTitle("顺序");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTREnd();

            FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);
            int      idx = 1;

            foreach (FrmNode fn in fns)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD(fn.FK_Frm);

                MapData md = new MapData(fn.FK_Frm);
                md = new MapData(fn.FK_Frm);
                // this.Pub1.AddTD(md.Name);
                this.Pub1.AddTDA("FlowFrms.aspx?ShowType=Frm&FK_MapData=" + md.No + "&FK_Node=" + this.FK_Node, md.Name);

                DDL ddl = new DDL();
                ddl.ID = "DDL_FrmType_" + fn.FK_Frm;
                ddl.BindSysEnum("FrmType", (int)fn.HisFrmType);
                //  ddl.Enabled = false;
                this.Pub1.AddTD(ddl);


                //if (md.HisFrmType == FrmType.ExcelFrm || md.HisFrmType == FrmType.WordFrm)
                //{
                //    /* 如果是 office 表单,就让其选择 toolbar 的控制方案.
                //     */
                //    ddl = new DDL();
                //    ddl.ID = "DDL_ToolbarSln_" + md.No;
                //    ddl.Items.Add(new ListItem("默认方案", "0"));
                //    ddl.Items.Add(new ListItem("自定义", this.FK_Node.ToString()));
                //    ddl.SetSelectItem(fn.FrmSln); //设置权限控制方案.
                //    this.Pub1.AddTD(ddl);
                //    this.Pub1.AddTD("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >字段</a>|<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >附件</a>");

                //}
                //else
                //{
                CheckBox cb = new CheckBox();
                cb.ID      = "CB_IsEdit_" + md.No;
                cb.Text    = "是否可编辑?";
                cb.Checked = fn.IsEdit;
                this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsPrint_" + md.No;
                cb.Text    = "是否可打印";
                cb.Checked = fn.IsPrint;
                this.Pub1.AddTD(cb);
                //  }


                ddl    = new DDL();
                ddl.ID = "DDL_Sln_" + md.No;
                //   ddl.BindAtParas(md.Slns);
                ddl.Items.Add(new ListItem("默认方案", "0"));
                ddl.Items.Add(new ListItem("自定义", this.FK_Node.ToString()));
                ddl.SetSelectItem(fn.FrmSln); //设置权限控制方案.
                this.Pub1.AddTD(ddl);

                this.Pub1.AddTDBegin();
                this.Pub1.Add("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >字段</a>");
                this.Pub1.Add("-<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >附件</a>");

                if (md.HisFrmType == FrmType.ExcelFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarExcel('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarExcel</a>");
                }

                if (md.HisFrmType == FrmType.WordFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarWord('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarWord</a>");
                }

                this.Pub1.AddTDEnd();

                ddl    = new DDL();
                ddl.ID = "DDL_WhoIsPK_" + md.No;
                ddl.BindSysEnum("WhoIsPK");
                ddl.SetSelectItem((int)fn.WhoIsPK);   //谁是主键?.
                this.Pub1.AddTD(ddl);

                TextBox tb = new TextBox();
                tb.ID      = "TB_Idx_" + md.No;
                tb.Text    = fn.Idx.ToString();
                tb.Columns = 5;
                this.Pub1.AddTD(tb);

                this.Pub1.AddTDA("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Up", "上移");
                this.Pub1.AddTDA("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Down", "下移");

                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTR();
            Button btn = new Button();

            btn.ID       = "Save";
            btn.Text     = "  Save  ";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);
            this.Pub1.AddTD("colspan=12", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
コード例 #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "从表设计";

            MapData.IsEditDtlModel = true;
            MapData md  = new MapData(this.FK_MapData);
            MapDtl  dtl = new MapDtl(this.FK_MapDtl);

            if (dtl.IsView == false)
            {
                return;
            }

            MapAttrs attrs      = new MapAttrs(this.MyPK);
            MapAttrs attrs2     = new MapAttrs();
            MapExts  mes        = new MapExts(this.MyPK);
            string   LinkFields = ",";

            if (mes.Count != 0)
            {
                foreach (MapExt me in mes)
                {
                    switch (me.ExtType)
                    {
                    case MapExtXmlList.Link:
                        LinkFields += me.AttrOfOper + ",";
                        break;

                    default:
                        break;
                    }
                }

                this.Page.RegisterClientScriptBlock("s8",
                                                    "<script language='JavaScript' src='../Scripts/jquery-1.4.1.min.js' ></script>");

                this.Page.RegisterClientScriptBlock("b8",
                                                    "<script language='JavaScript' src='../CCForm/MapExt.js' ></script>");

                this.Page.RegisterClientScriptBlock("dCd",
                                                    "<script language='JavaScript' src='/DataUser/JSLibData/" + this.FK_MapDtl + ".js' ></script>");

                this.Pub1.Add("<div id='divinfo' style='width: 155px; position: absolute; color: Lime; display: none;cursor: pointer;align:left'></div>");
            }

            string t = DateTime.Now.ToString("MM-dd-hh:mm:ss");

            if (attrs.Count == 0)
            {
                dtl.IntMapAttrs();
            }


            this.Title = md.Name + " - 设计明细";
            this.Pub1.AddTable("class='Table' border='0' ID='Tab' cellspacing='0' cellpadding='0' ");
            //     this.Pub1.AddCaptionLeftTX("<a href='MapDef.aspx?MyPK=" + md.No + "' ><img src='../Img/Btn/Back.gif' border=0/>" + this.ToE("Back","返回") + ":" + md.Name + "</a> - <img src='../Img/Btn/Table.gif' border=0/>" + dtl.Name + " - <a href=\"javascript:AddF('" + this.MyPK + "');\" ><img src='../Img/Btn/New.gif' border=0/>" + "新建字段" + "</a> ");
            this.Pub1.Add(dtl.MTR);

            #region 输出标题.
            this.Pub1.AddTR();
            if (dtl.IsShowIdx)
            {
                this.Pub1.AddTDTitle("");
            }

            foreach (MapAttr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                this.Pub1.Add("<TH style='width:" + attr.UIWidthInt + "px'>");
                this.Pub1.Add("<a href=\"javascript:Up('" + this.MyPK + "','" + attr.MyPK + "','" + t + "');\" ><img src='../Img/Btn/Left.gif' class=Arrow alt='向左移动' border=0/></a>");
                if (attr.HisEditType == EditType.UnDel || attr.HisEditType == EditType.Edit)
                {
                    switch (attr.LGType)
                    {
                    case FieldTypeS.Normal:
                        this.Pub1.Add("<a href=\"javascript:Edit('" + this.MyPK + "','" + attr.MyPK + "','" + attr.MyDataType + "');\"  alt='" + attr.KeyOfEn + "'>" + attr.Name + "</a>");
                        break;

                    case FieldTypeS.Enum:
                        this.Pub1.Add("<a href=\"javascript:EditEnum('" + this.MyPK + "','" + attr.MyPK + "');\" alt='" + attr.KeyOfEn + "' >" + attr.Name + "</a>");
                        break;

                    case FieldTypeS.FK:
                        this.Pub1.Add("<a href=\"javascript:EditTable('" + this.MyPK + "','" + attr.MyPK + "','" + attr.MyDataTypeS + "');\"  alt='" + attr.KeyOfEn + "'>" + attr.Name + "</a>");
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    this.Pub1.Add(attr.Name);
                }
                //  this.Pub1.Add("[<a href=\"javascript:Insert('" + this.MyPK + "','" + attr.Idx + "');\" ><img src='../Img/Btn/Insert.gif' border=0/>插入</a>]");
                this.Pub1.Add("<a href=\"javascript:Down('" + this.MyPK + "','" + attr.MyPK + "','" + t + "');\" ><img src='../Img/Btn/Right.gif' class=Arrow alt='向右移动' border=0/></a>");
                this.Pub1.Add("</TH>");
            }

            if (dtl.IsEnableAthM)
            {
                this.Pub1.AddTDTitle("<a href=\"javascript:Attachment('" + dtl.No + "');\"><img src='./../Img/set.gif' border=0 width='16px' /></a>");
            }

            if (dtl.IsEnableM2M)
            {
                this.Pub1.AddTDTitle("<a href=\"javascript:MapM2M('" + dtl.No + "');\"><img src='./../Img/set.gif' border=0 width='16px' /></a>");
            }

            if (dtl.IsEnableM2MM)
            {
                this.Pub1.AddTDTitle("<a href=\"javascript:window.showModalDialog('MapM2MM.aspx?NoOfObj=M2MM&FK_MapData=" + this.FK_MapDtl + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='./../Img/set.gif' border=0 width='16px' /></a>");
            }

            if (dtl.IsEnableLink)
            {
                this.Pub1.AddTDTitle(dtl.LinkLabel);
            }

            //Pub1.AddTDTitle("&nbsp;");

            this.Pub1.AddTREnd();
            #endregion 输出标题.

            #region 输出行.
            for (int i = 1; i <= dtl.RowsOfList; i++)
            {
                this.Pub1.AddTR();
                if (dtl.IsShowIdx)
                {
                    this.Pub1.AddTDIdx(i);
                }
                foreach (MapAttr attr in attrs)
                {
                    if (attr.UIVisible == false)
                    {
                        continue;
                    }

                    #region 是否输出超连接.
                    if (attr.UIIsEnable == false && LinkFields.Contains("," + attr.KeyOfEn + ","))
                    {
                        MapExt meLink = mes.GetEntityByKey(MapExtAttr.ExtType, MapExtXmlList.Link) as MapExt;
                        string url    = meLink.Tag;
                        if (url.Contains("?") == false)
                        {
                            url = url + "?a3=2";
                        }
                        url = url + "&WebUserNo=" + WebUser.No + "&SID=" + WebUser.SID + "&EnName=" + this.FK_MapDtl;
                        if (url.Contains("@AppPath"))
                        {
                            url = url.Replace("@AppPath", "http://" + this.Request.Url.Host + this.Request.ApplicationPath);
                        }
                        if (url.Contains("@"))
                        {
                            if (attrs2.Count == 0)
                            {
                                attrs2 = new MapAttrs(this.FK_MapDtl);
                            }
                            foreach (MapAttr item in attrs2)
                            {
                                url = url.Replace("@" + item.KeyOfEn, item.DefVal);
                                if (url.Contains("@") == false)
                                {
                                    break;
                                }
                            }
                        }
                        this.Pub1.AddTD("<a href='" + url + "' target='" + meLink.Tag1 + "' >" + attr.DefVal + "</a>");
                        continue;
                    }
                    #endregion 是否输出超连接.

                    #region 输出字段.
                    switch (attr.LGType)
                    {
                    case FieldTypeS.Normal:
                        if (attr.MyDataType == BP.DA.DataType.AppBoolean)
                        {
                            CheckBox cb = new CheckBox();
                            cb.Checked = attr.DefValOfBool;
                            cb.Enabled = attr.UIIsEnable;
                            cb.Text    = attr.Name;
                            this.Pub1.AddTD(cb);
                            break;
                        }
                        TextBox tb = new TextBox();
                        tb.ID       = "TB_" + attr.KeyOfEn + "_" + i;
                        tb.Text     = attr.DefVal;
                        tb.ReadOnly = !attr.UIIsEnable;
                        this.Pub1.AddTD(tb);
                        switch (attr.MyDataType)
                        {
                        case BP.DA.DataType.AppString:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (attr.UIHeight > 25)
                            {
                                tb.TextMode             = TextBoxMode.MultiLine;
                                tb.Attributes["Height"] = attr.UIHeight + "px";
                                tb.Rows = attr.UIHeightInt / 25;
                            }
                            break;

                        case BP.DA.DataType.AppDateTime:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (attr.UIIsEnable)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                                //tb.Attributes["class"] = "TBcalendar";
                            }
                            break;

                        case BP.DA.DataType.AppDate:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (attr.UIIsEnable)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker();";
                                //  tb.Attributes["class"] = "TBcalendar";
                            }
                            break;

                        default:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (tb.ReadOnly == false)
                            {
                                // OnKeyPress="javascript:return VirtyNum(this);"
                                //tb.Attributes["OnKeyDown"] = "javascript:return VirtyNum(this);";

                                if (attr.MyDataType == DataType.AppInt)
                                {
                                    tb.Attributes["OnKeyDown"] = "javascript:return VirtyInt(this);";
                                }
                                else
                                {
                                    tb.Attributes["OnKeyDown"] = "javascript:return VirtyNum(this);";
                                }

                                tb.Attributes["onkeyup"] += "javascript:C" + i + "();C" + attr.KeyOfEn + "();";
                                tb.Attributes["class"]    = "TBNum";
                            }
                            else
                            {
                                // tb.Attributes["onpropertychange"] += "C" + attr.KeyOfEn + "();";
                                tb.Attributes["class"] = "TBNumReadonly";
                            }
                            break;
                        }
                        break;

                    case FieldTypeS.Enum:
                        DDL ddl = new DDL();
                        ddl.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                        try
                        {
                            ddl.BindSysEnum(attr.KeyOfEn);
                            ddl.SetSelectItem(attr.DefVal);
                        }
                        catch (Exception ex)
                        {
                            BP.Sys.PubClass.Alert(ex.Message);
                        }
                        ddl.Enabled = attr.UIIsEnable;
                        this.Pub1.AddTDCenter(ddl);
                        break;

                    case FieldTypeS.FK:
                        DDL ddl1 = new DDL();
                        ddl1.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                        try
                        {
                            EntitiesNoName ens = attr.HisEntitiesNoName;
                            ens.RetrieveAll();
                            ddl1.BindEntities(ens);
                            if (ddl1.SetSelectItem(attr.DefVal) == false)
                            {
                                ddl1.Items.Insert(0, new ListItem("请选择", attr.DefVal));
                                ddl1.SelectedIndex = 0;
                            }
                        }
                        catch
                        {
                        }
                        ddl1.Enabled = attr.UIIsEnable;
                        this.Pub1.AddTDCenter(ddl1);
                        break;

                    default:
                        break;
                    }
                    #endregion s输出字段.
                }

                #region 输出附件,m2m
                if (dtl.IsEnableAthM)
                {
                    this.Pub1.AddTD("<a href=\"javascript:EnableAthM('" + this.FK_MapDtl + "');\" ><img src='../Img/AttachmentM.png' border=0 width='16px' /></a>");
                }

                if (dtl.IsEnableM2M)
                {
                    this.Pub1.AddTD("<a href=\"javascript:window.showModalDialog('../CCForm/M2M.aspx?NoOfObj=M2M&IsTest=1&OID=0&FK_MapData=" + this.FK_MapDtl + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='./../Img/M2M.png' border=0 width='16px' /></a>");
                }

                if (dtl.IsEnableM2MM)
                {
                    this.Pub1.AddTD("<a href=\"javascript:window.showModalDialog('../CCForm/M2MM.aspx?NoOfObj=M2MM&IsTest=1&OID=0&FK_MapData=" + this.FK_MapDtl + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='./../Img/M2MM.png' border=0 width='16px' /></a>");
                }

                if (dtl.IsEnableLink)
                {
                    this.Pub1.AddTD("<a href='" + dtl.LinkUrl + "' target='" + dtl.LinkTarget + "' >" + dtl.LinkLabel + "</a>");
                }
                #endregion 输出附件,m2m

                //Pub1.AddTD("&nbsp;");
                this.Pub1.AddTREnd();
            }
            #endregion 输出行.

            #region 合计.
            if (dtl.IsShowSum)
            {
                this.Pub1.AddTRSum();
                if (dtl.IsShowIdx)
                {
                    this.Pub1.AddTD("合计");
                }

                foreach (MapAttr attr in attrs)
                {
                    if (attr.UIVisible == false)
                    {
                        continue;
                    }
                    if (attr.IsNum && attr.LGType == FieldTypeS.Normal)
                    {
                        TB tb = new TB();
                        tb.ID                  = "TB_" + attr.KeyOfEn;
                        tb.Text                = attr.DefVal;
                        tb.ShowType            = attr.HisTBType;
                        tb.ReadOnly            = true;
                        tb.Font.Bold           = true;
                        tb.BackColor           = System.Drawing.Color.FromName("#FFFFFF");
                        tb.Attributes["class"] = "TBNumReadonly";
                        this.Pub1.AddTD(tb);
                    }
                    else
                    {
                        this.Pub1.AddTD();
                    }
                }
                if (dtl.IsEnableAthM)
                {
                    this.Pub1.AddTD();
                }

                if (dtl.IsEnableM2M)
                {
                    this.Pub1.AddTD();
                }

                if (dtl.IsEnableM2MM)
                {
                    this.Pub1.AddTD();
                }

                if (dtl.IsEnableLink)
                {
                    this.Pub1.AddTD();
                }

                //    Pub1.AddTD("&nbsp;");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
            #endregion 合计.

            #region 处理设计时自动填充从表.
            if (this.Key != null)
            {
                MapExt   me   = new MapExt(this.FK_MapExt);
                string[] strs = me.Tag1.Split('$');
                foreach (string str in strs)
                {
                    if (str.Contains(this.FK_MapDtl) == false)
                    {
                        continue;
                    }

                    string[] ss = str.Split(':');

                    string sql = ss[1];
                    sql = sql.Replace("@Key", this.Key);
                    sql = sql.Replace("@key", this.Key);
                    sql = sql.Replace("@val", this.Key);
                    sql = sql.Replace("@Val", this.Key);

                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    int       idx = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        idx++;
                        foreach (DataColumn dc in dt.Columns)
                        {
                            string val = dr[dc.ColumnName].ToString();
                            try
                            {
                                this.Pub1.GetTextBoxByID("TB_" + dc.ColumnName + "_" + idx).Text = val;
                            }
                            catch
                            {
                            }

                            try
                            {
                                this.Pub1.GetDDLByID("DDL_" + dc.ColumnName + "_" + idx).SetSelectItem(val);
                            }
                            catch
                            {
                            }
                        }
                    }
                }
            }
            #endregion 处理设计时自动填充从表.

            #region 处理拓展属性.
            for (int i = 1; i <= dtl.RowsOfList; i++)
            {
                foreach (MapExt me in mes)
                {
                    switch (me.ExtType)
                    {
                    case MapExtXmlList.DDLFullCtrl:     // 自动填充.
                        DDL ddlOper = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper);
                        if (ddlOper == null)
                        {
                            continue;
                        }
                        ddlOper.Attributes["onchange"] = "DDLFullCtrl(this.value,\'" + ddlOper.ClientID + "\', \'" + me.MyPK + "\')";
                        break;

                    case MapExtXmlList.ActiveDDL:
                        DDL ddlPerant = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                        if (ddlPerant == null)
                        {
                            me.Delete();
                            continue;
                        }

                        DDL ddlChild = this.Pub1.GetDDLByID("DDL_" + me.AttrsOfActive + "_" + i);
                        if (ddlChild == null)
                        {
                            me.Delete();
                            continue;
                        }

                        ddlPerant.Attributes["onchange"] = "DDLAnsc(this.value,\'" + ddlChild.ClientID + "\', \'" + me.MyPK + "\')";
                        if (ddlPerant.Items.Count == 0)
                        {
                            continue;
                        }

                        string val = ddlPerant.SelectedItemStringVal;

                        string valC1 = ddlChild.SelectedItemStringVal;


                        DataTable dt = DBAccess.RunSQLReturnTable(me.Doc.Replace("@Key", val));

                        ddlChild.Items.Clear();
                        foreach (DataRow dr in dt.Rows)
                        {
                            ddlChild.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                        }
                        ddlChild.SetSelectItem(valC1);
                        break;

                    case MapExtXmlList.AutoFullDLL:     //自动填充下拉框的范围.
                        DDL ddlFull = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                        if (ddlFull == null)
                        {
                            me.Delete();
                            continue;
                        }

                        string valOld = ddlFull.SelectedItemStringVal;
                        ddlFull.Items.Clear();
                        string fullSQL = me.Doc.Replace("@WebUser.No", WebUser.No);
                        fullSQL = fullSQL.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                        fullSQL = fullSQL.Replace("@WebUser.Name", WebUser.Name);

                        if (fullSQL.Contains("@"))
                        {
                            //Attrs attrsFull = mydtl.EnMap.Attrs;
                            //foreach (Attr attr in attrsFull)
                            //{
                            //    if (fullSQL.Contains("@") == false)
                            //        break;
                            //    fullSQL = fullSQL.Replace("@" + attr.Key, mydtl.GetValStrByKey(attr.Key));
                            //}
                        }
                        ddlFull.Bind(DBAccess.RunSQLReturnTable(fullSQL), "No", "Name");
                        ddlFull.SetSelectItem(valOld);
                        break;

                    case MapExtXmlList.TBFullCtrl:     // 自动填充.
                        TextBox tbAuto = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                        if (tbAuto == null)
                        {
                            me.Delete();
                            continue;
                        }
                        tbAuto.Attributes["onkeyup"]      = "DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                        tbAuto.Attributes["AUTOCOMPLETE"] = "OFF";
                        if (me.Tag != "")
                        {
                            /* 处理下拉框的选择范围的问题 */
                            string[] strs = me.Tag.Split('$');
                            foreach (string str in strs)
                            {
                                string[] myCtl = str.Split(':');
                                string   ctlID = myCtl[0];
                                DDL      ddlC  = this.Pub1.GetDDLByID("DDL_" + ctlID + "_" + i);
                                if (ddlC == null)
                                {
                                    continue;
                                }

                                string sql = myCtl[1].Replace("~", "'");
                                sql = sql.Replace("@WebUser.No", WebUser.No);
                                sql = sql.Replace("@WebUser.Name", WebUser.Name);
                                sql = sql.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                                sql = sql.Replace("@Key", tbAuto.Text.Trim());
                                dt  = DBAccess.RunSQLReturnTable(sql);
                                string valC = ddlC.SelectedItemStringVal;
                                ddlC.Items.Clear();
                                foreach (DataRow dr in dt.Rows)
                                {
                                    ddlC.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                                }
                                ddlC.SetSelectItem(valC);
                            }
                        }
                        // tbAuto.Attributes["onkeyup"] = "DoAnscToFillDiv(this,this.value);";
                        // tbAuto.Attributes["onkeyup"] = "DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                        break;

                    case MapExtXmlList.InputCheck:
                        TextBox tbCheck = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                        if (tbCheck != null)
                        {
                            tbCheck.Attributes[me.Tag2] += " rowPK=" + i + ";" + me.Tag1 + "(this);";
                        }
                        else
                        {
                            me.Delete();
                        }
                        break;

                    case MapExtXmlList.PopVal:     //弹出窗.
                        TextBox tb = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                        if (tb == null)
                        {
                            continue;
                        }
                        //tb.Attributes["ondblclick"] = "return ReturnValCCFormPopVal(this,'" + me.MyPK + "','33');";
                        tb.Attributes["ondblclick"] = "ReturnValCCFormPopVal(this,'" + me.MyPK + "','33');";
                        //    throw new Exception("ssssrrrss");
                        break;

                    default:
                        break;
                    }
                }
            }
            #endregion 处理拓展属性.

            #region 输出自动计算公式
            this.Pub1.Add("\n <script language='JavaScript'>");
            MapExts exts = new MapExts(dtl.No);
            foreach (MapExt ext in exts)
            {
                if (ext.ExtType != MapExtXmlList.AutoFull)
                {
                    continue;
                }

                for (int i = 1; i <= dtl.RowsOfList; i++)
                {
                    string top    = "\n function C" + i + "() { \n ";
                    string script = "";
                    foreach (MapAttr attr in attrs)
                    {
                        if (attr.UIVisible == false)
                        {
                            continue;
                        }
                        if (attr.IsNum == false)
                        {
                            continue;
                        }

                        if (attr.LGType != FieldTypeS.Normal)
                        {
                            continue;
                        }

                        if (ext.Tag == "1" && ext.Doc != "")
                        {
                            script += this.GenerAutoFull(i.ToString(), attrs, ext);
                        }
                    }
                    string end = " \n  } ";
                    this.Pub1.Add(top + script + end);
                }
            }
            this.Pub1.Add("\n</script>");

            // 输出合计算计公式
            foreach (MapAttr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                if (attr.LGType != FieldTypeS.Normal)
                {
                    continue;
                }

                if (attr.IsNum == false)
                {
                    continue;
                }

                if (attr.MyDataType == DataType.AppBoolean)
                {
                    continue;
                }

                string top = "\n<script language='JavaScript'> function C" + attr.KeyOfEn + "() { \n ";
                string end = "\n } </script>";
                this.Pub1.Add(top + this.GenerSum(attr, dtl) + " ; \t\n" + end);
            }
            #endregion 输出自动计算公式
        }
コード例 #24
0
        public void BindFrm()
        {
            MapData md = new MapData();

            if (string.IsNullOrEmpty(this.FK_MapData) == false)
            {
                md.No = this.FK_MapData;
                md.RetrieveFromDBSources();
                this.Pub1.AddH2("表单属性" + md.Name);
                this.Pub1.AddHR();
            }
            else
            {
                this.Pub1.AddH2("新建表单");
                this.Pub1.AddHR();
            }

            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("属性");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("描述");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单名称");
            TextBox tb = new TextBox();

            tb.ID   = "TB_Name";
            tb.Text = md.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("描述");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单编号");
            tb      = new TextBox();
            tb.ID   = "TB_No";
            tb.Text = md.No;
            if (string.IsNullOrEmpty(md.No) == false)
            {
                tb.Attributes["readonly"] = "true";
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("也是表单ID.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单类型");
            DDL ddl = new DDL();

            ddl.ID = "DDL_FrmType";
            ddl.BindSysEnum(MapDataAttr.FrmType, (int)md.HisFrmType);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("物理表/视图");
            tb      = new TextBox();
            tb.ID   = "TB_PTable";
            tb.Text = md.No;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("多个表单可以对应同一个表或视图<br>如果表不存在,ccflow会自动创建.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("类别");
            ddl    = new DDL();
            ddl.ID = "DDL_FK_FrmSort";
            SysFormTrees fss = new SysFormTrees();

            fss.RetrieveAll();

            ddl.Bind(fss, md.FK_FrmSort);

            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            //this.Pub1.AddTR();
            //this.Pub1.AddTD("设计单位");
            //tb = new TextBox();
            //tb.ID = "TB_" + MapDataAttr.DesignerUnit;
            //tb.Text = md.DesignerUnit;
            //if (string.IsNullOrEmpty(tb.Text))
            //    tb.Text = BP.Sys.SystemConfig.DeveloperName;

            //tb.Columns = 60;
            //this.Pub1.AddTD("colspan=2", tb);
            //this.Pub1.AddTREnd();

            //this.Pub1.AddTR();
            //this.Pub1.AddTD("联系方式");
            //tb = new TextBox();
            //tb.ID = "TB_" + MapDataAttr.DesignerContact;
            //tb.Text = md.DesignerContact;
            //if (string.IsNullOrEmpty(tb.Text))
            //    tb.Text = BP.Sys.SystemConfig.ServiceTel + "," + BP.Sys.SystemConfig.ServiceMail;
            //tb.Columns = 60;
            //this.Pub1.AddTD("colspan=2", tb);
            //this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            this.Pub1.AddTDBegin();
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFrm_Click);
            this.Pub1.Add(btn);

            if (string.IsNullOrEmpty(md.No) == false)
            {
                btn          = new Button();
                btn.ID       = "Btn_Delete";
                btn.Text     = "Delete";
                btn.CssClass = "Btn";
                btn.Attributes["onclick"] = "return window.confirm('您确定要删除吗?')";
                btn.Click += new EventHandler(btn_SaveFrm_Click);
                this.Pub1.Add(btn);
            }

            this.Pub1.AddTDEnd();
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            if (string.IsNullOrEmpty(md.No) == false)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDBegin("colspan=3");
                //// this.Pub1.Add("<a href='FlowFrms.aspx?ShowType=FrmLib&DoType=DelFrm&FK_Node=" + FK_Node + "&FK_MapData=" + md.No + "'  ><img src='./Img/Btn/Delete.gif' border=0 />删除</a>");
                //this.Pub1.Add("<a href='../MapDef/ViewFrm.aspx?DoType=Column4Frm&FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />傻瓜表单预览</a>");
                //this.Pub1.Add("<a href='../CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "&IsTest=1&WorkID=0' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />自由表单预览</a>");
                //this.Pub1.Add("<a href='../MapDef/ViewFrm.aspx?DoType=dd&FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />手机表单预览</a>");
                //this.Pub1.Add("<a href='../CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />启动自由表单设计器</a>");
                //this.Pub1.Add("<a href='../MapDef/MapDef.aspx?PK=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />启动傻瓜表单设计器</a>");
                this.Pub1.Add("<a href='../CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />启动自由表单设计器</a>");
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
コード例 #25
0
        public Entities SetDGData(int pageIdx, bool isSearch)
        {
            //  this.BPToolBar1.SaveSearchState(this.EnsName, this.Key);
            this.ToolBar1.SaveSearchState(this.EnsName, this.Key);

            Entities    ens = this.HisEns;
            Entity      en  = ens.GetNewEntity;
            QueryObject qo  = new QueryObject(ens);

            qo = this.ToolBar1.GetnQueryObject(ens, en);
            string url = this.Request.RawUrl;

            if (url.IndexOf("PageIdx") != -1)
            {
                url = url.Substring(0, url.IndexOf("PageIdx") - 1);
            }

            this.UCSys2.Clear();
            int maxPageNum = 0;

            try
            {
                maxPageNum = this.UCSys2.BindPageIdx(qo.GetCount(), SystemConfig.PageSize, pageIdx, "Batch.aspx?EnsName=" + this.EnsName);
            }
            catch (Exception ex)
            {
                en.CheckPhysicsTable();
                throw ex;
            }

            if (isSearch)
            {
                return(null);
            }


            if (maxPageNum > 1)
            {
                this.UCSys2.Add("翻页键:← → PageUp PageDown");
            }

            qo.DoQuery(en.PK, SystemConfig.PageSize, pageIdx);

            this.UCSys1.DataPanelDtlCheckBox(ens);

            //if (this.IsS == false)
            //    this.UCSys3.Add("[<a href='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + this.PageIdx + "&IsS=1'>选择全部</a>]&nbsp;&nbsp;");
            //else
            //    this.UCSys3.Add("[<a href='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + this.PageIdx + "&IsS=0'>全不选</a>]&nbsp;&nbsp;");

            RefMethods rms = en.EnMap.HisRefMethods;

            foreach (RefMethod rm in rms)
            {
                if (rm.IsCanBatch == false)
                {
                    continue;
                }

                Button btn = new Button();
                btn.ID       = "Btn_" + rm.Index;
                btn.Text     = rm.Title;
                btn.CssClass = "Btn";
                if (rm.Warning == null)
                {
                    btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                }
                else
                {
                    btn.Attributes["onclick"] = " return confirm('" + rm.Warning + "');";
                }

                this.UCSys3.Add(btn);
                btn.Click += new EventHandler(btn_Click);
            }

            UAC uac = en.HisUAC;

            if (uac.IsDelete)
            {
                Button btn = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";

                btn.Text = "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Attributes["class"]   = "Button";
                this.UCSys3.Add(btn);
                btn.Click += new EventHandler(btn_Click);
            }

            MoveToShowWay showWay = (MoveToShowWay)ens.GetEnsAppCfgByKeyInt("MoveToShowWay");

            // 执行移动.
            if (showWay != MoveToShowWay.None)
            {
                string MoveTo = en.GetCfgValStr("MoveTo");
                if (en.EnMap.Attrs.Contains(MoveTo) == false)
                {
                    this.Alert("Moveto 字段设置错误,实体不包含字段:" + MoveTo);
                    return(null);
                }


                Attr attr = en.EnMap.GetAttrByKey(MoveTo);
                if (showWay == MoveToShowWay.DDL)
                {
                    Button btnM = new Button();
                    btnM.ID       = "Btn_Move";
                    btnM.CssClass = "Btn";

                    btnM.Text = "移动到";
                    btnM.Attributes["onclick"] = "return confirm('您确实要移动吗?');";
                    this.UCSys3.Add("&nbsp;&nbsp;");
                    this.UCSys3.Add(btnM);

                    btnM.Click += new EventHandler(btn_Move_Click);

                    DDL ddl = new DDL();
                    ddl.ID = "DDL_MoveTo1";
                    if (attr.IsEnum)
                    {
                        ddl.BindSysEnum(attr.Key);
                        ddl.Items.Insert(0, new ListItem("选择" + "=>" + attr.Desc, "all"));
                    }
                    else
                    {
                        EntitiesNoName ens1 = attr.HisFKEns as EntitiesNoName;
                        ens1.RetrieveAll();
                        ddl.BindEntities(ens1);
                        ddl.Items.Insert(0, new ListItem("选择" + "=>" + attr.Desc, "all"));
                    }
                    this.UCSys3.Add(ddl);
                }

                if (showWay == MoveToShowWay.Panel)
                {
                    if (attr.IsEnum)
                    {
                        SysEnums ses = new SysEnums(attr.Key);
                        foreach (SysEnum se in ses)
                        {
                            Button btn = new Button();
                            btn.CssClass = "Btn";

                            btn.ID   = "Btn_Move_" + se.IntKey;
                            btn.Text = "设置" + ":" + se.Lab;
                            btn.Attributes["onclick"] = "return confirm('您确实要执行设置[" + se.Lab + "]吗?');";
                            btn.Click += new EventHandler(btn_Move_Click);
                            this.UCSys3.Add(btn);
                            this.UCSys3.Add("&nbsp;&nbsp;");
                        }
                    }
                    else
                    {
                        EntitiesNoName ens1 = attr.HisFKEns as EntitiesNoName;
                        ens1.RetrieveAll();
                        foreach (EntityNoName en1 in ens1)
                        {
                            Button btn = new Button();
                            btn.CssClass = "Btn";
                            btn.ID       = "Btn_Move_" + en1.No;
                            btn.Text     = "设置:" + en1.Name;
                            btn.Attributes["onclick"] = "return confirm('您确实要设置[" + en1.Name + "]吗?');";
                            btn.Click += new EventHandler(btn_Move_Click);
                            this.UCSys3.Add(btn);
                            this.UCSys3.Add("&nbsp;&nbsp;");
                        }
                    }
                }
            }

            int ToPageIdx = this.PageIdx + 1;
            int PPageIdx  = this.PageIdx - 1;

            this.UCSys3.Add("<SCRIPT language=javascript>");
            this.UCSys3.Add("\t\n document.onkeydown = chang_page;");
            this.UCSys3.Add("\t\n function chang_page() {");
            //  this.UCSys3.Add("\t\n  alert(event.keyCode); ");
            if (this.PageIdx == 1)
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 37 || event.keyCode == 33) alert('已经是第一页');");
            }
            else
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 37  || event.keyCode == 38 || event.keyCode == 33) ");
                this.UCSys3.Add("\t\n     location='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + PPageIdx + "';");
            }
            if (this.PageIdx == maxPageNum)
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) alert('已经是最后一页');");
            }
            else
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) ");
                this.UCSys3.Add("\t\n     location='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + ToPageIdx + "';");
            }

            this.UCSys3.Add("\t\n } ");
            this.UCSys3.Add("</SCRIPT>");
            return(ens);
        }
コード例 #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "流程报表定义";
        switch (this.DoType)
        {
        case "Reset":
            BP.WF.Flow fl = new BP.WF.Flow(this.FK_Flow);
            fl.CheckRptOfReset();
            this.Response.Redirect("WFRpt.aspx?FK_MapData=" + this.FK_MapData, true);
            return;

        default:
            break;
        }

        Cash.Map_Cash.Remove(this.FK_MapData);

        MapData  md     = new MapData(this.FK_MapData);
        MapAttrs mattrs = new MapAttrs(md.No);
        int      count  = mattrs.Count;

        if (mattrs.Count == 0)
        {
            BP.WF.Flow f = new BP.WF.Flow(this.FK_Flow);
            f.CheckRpt();
            this.Response.Redirect(this.Request.RawUrl, true);
            return;
        }

        if (gfs.Count == 1)
        {
            GroupField mygf = (GroupField)gfs[0];
            if (mygf.Lab != md.Name)
            {
                mygf.Lab = md.Name;
                mygf.Update();
            }
        }

        this.Pub1.AddB(this.Title + "&nbsp;&nbsp;<a href=\"javascript:GroupFieldNew('" + md.No + "')\">字段分组</a>");
        //  this.Pub1.AddB("-<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=" + this.MyPK + "')\">查询预览</a>");
        // this.Pub1.AddB("-<a href=\"javascript:WinOpen('/WF/Comm/Group.aspx?EnsName=" + this.MyPK + "')\">分析预览</a>");

        if (this.FK_MapData.Contains("RptDtl") == false)
        {
            this.Pub1.AddB("-<a href=\"javascript:DoReset('" + this.FK_Flow + "','" + this.FK_MapData + "')\">重设字段</a>");

            /* 说明是主表:判断它是否有从表。*/
            string sql = "SELECT COUNT(No) FROM Sys_MapDtl WHERE No LIKE 'ND" + int.Parse(this.FK_Flow) + "%'";
            if (BP.DA.DBAccess.RunSQLReturnValInt(sql) >= 1)
            {
                // this.Pub1.AddB("-<a href=\"javascript:AddDtl('" + md.No + "')\">插入从表</a>");
                //sql = "SELECT No FROM Sys_MapData WHERE No LIKE '" + this.MyPK + "Dtl%'";
                //DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);
                //switch (dt.Rows.Count)
                //{
                //    case 0:
                //        break;
                //    case 1:
                //        this.Pub1.AddB("-<a href='WFRpt.aspx?MyPK=" + dt.Rows[0][0].ToString() + "'>明细报表设计</a>");
                //        break;
                //    default:
                //        this.Pub1.AddB("-<a href='WFRpt.aspx?DoType=DeDtl&MyPK=" + this.MyPK + "'>明细报表设计</a>");
                //        break;
                //}
            }
        }
        else
        {
            this.Pub1.AddB("-<a href=\"WFRpt.aspx?MyPK=ND" + int.Parse(this.FK_Flow) + "Rpt\">" + "返回" + "</a>");
        }

        this.Pub1.AddHR();

        this.Pub1.AddTable("width='100%'");

        /*
         * 根据 GroupField 循环出现菜单。
         */
        foreach (GroupField gf in gfs)
        {
            string gfAttr = " onmouseover=GFOnMouseOver('" + gf.OID + "','" + rowIdx + "') onmouseout=GFOnMouseOut()";
            currGF = gf;
            this.Pub1.AddTR(gfAttr);
            if (gfs.Count == 1)
            {
                this.Pub1.AddTD("colspan=4 class=GroupField valign='top' align:left style='height: 24px;align:left' ", "<div style='text-align:left; float:left'>&nbsp;<a href=\"javascript:GroupField('" + this.FK_MapData + "','" + gf.OID + "')\" >" + gf.Lab + "</a></div><div style='text-align:right; float:right'></div>");
            }
            else
            {
                this.Pub1.AddTD("colspan=4 class=GroupField valign='top' align:left style='height: 24px;align:left' onclick=\"GroupBarClick('" + gf.Idx + "')\" ", "<div style='text-align:left; float:left'><img src='../Style/Min.gif' alert='Min' id='Img" + gf.Idx + "'   border=0 />&nbsp;<a href=\"javascript:GroupField('" + this.FK_MapData + "','" + gf.OID + "')\" >" + gf.Lab + "</a></div><div style='text-align:right; float:right'> <a href=\"javascript:GFDoUp('" + gf.OID + "')\" ><img src='./WF/Img/Btn/Up.gif' class='Arrow' border=0/></a> <a href=\"javascript:GFDoDown('" + gf.OID + "')\" ><img src='./WF/Img/Btn/Down.gif' class='Arrow' border=0/></a></div>");
            }

            this.Pub1.AddTREnd();
            int i   = -1;
            int idx = -1;
            isLeftNext = true;
            rowIdx     = 0;
            foreach (MapAttr attr in mattrs)
            {
                gfAttr = " onmouseover=GFOnMouseOver('" + gf.OID + "','" + rowIdx + "') onmouseout=GFOnMouseOut()";
                if (attr.GroupID == 0)
                {
                    attr.GroupID = gf.OID;
                    attr.Update();
                }

                if (attr.GroupID != gf.OID)
                {
                    if (gf.Idx == 0 && attr.GroupID == 0)
                    {
                    }
                    else
                    {
                        continue;
                    }
                }

                if (attr.HisAttr.IsRefAttr || attr.UIVisible == false)
                {
                    continue;
                }

                if (isLeftNext)
                {
                    if (gfs.Count == 0)
                    {
                        this.InsertObjects(false);
                    }
                    else
                    {
                        this.InsertObjects(true);
                    }
                }

                // 显示的顺序号.
                idx++;
                if (attr.IsBigDoc && attr.UIIsLine)
                {
                    if (isLeftNext == false)
                    {
                        this.Pub1.AddTD();
                        this.Pub1.AddTD();
                        this.Pub1.AddTREnd();
                    }
                    rowIdx++;
                    this.Pub1.AddTR(" ID='" + currGF.Idx + "_" + rowIdx + "'  " + gfAttr);
                    this.Pub1.Add("<TD class=FDesc colspan=4 width='100%' >");
                    this.Pub1.Add(this.GenerLab(attr, idx, 0, count));
                    TextBox mytbLine = new TextBox();
                    mytbLine.ID                  = "TB_" + attr.KeyOfEn;
                    mytbLine.TextMode            = TextBoxMode.MultiLine;
                    mytbLine.Rows                = 8;
                    mytbLine.Attributes["style"] = "width:100%;padding: 0px;margin: 0px;";
                    mytbLine.Enabled             = attr.UIIsEnable;
                    if (mytbLine.Enabled == false)
                    {
                        mytbLine.Attributes["class"] = "TBReadonly";
                    }
                    this.Pub1.Add(mytbLine);
                    this.Pub1.AddTDEnd();
                    this.Pub1.AddTREnd();
                    isLeftNext = true;
                    continue;
                }

                if (attr.IsBigDoc)
                {
                    if (isLeftNext)
                    {
                        rowIdx++;
                        this.Pub1.AddTR(" ID='" + currGF.Idx + "_" + rowIdx + "' " + gfAttr);
                    }
                    this.Pub1.Add("<TD class=FDesc colspan=2 width='50%' >");
                    this.Pub1.Add(this.GenerLab(attr, idx, 0, count));
                    TextBox mytbLine = new TextBox();
                    mytbLine.TextMode            = TextBoxMode.MultiLine;
                    mytbLine.Rows                = 8;
                    mytbLine.Attributes["style"] = "width:100%;padding: 0px;margin: 0px;";
                    mytbLine.ID = "TB_" + attr.KeyOfEn;

                    mytbLine.Enabled = attr.UIIsEnable;
                    if (mytbLine.Enabled == false)
                    {
                        mytbLine.Attributes["class"] = "TBReadonly";
                    }


                    this.Pub1.Add(mytbLine);
                    this.Pub1.AddTDEnd();
                    if (isLeftNext == false)
                    {
                        this.Pub1.AddTREnd();
                    }

                    isLeftNext = !isLeftNext;
                    continue;
                }

                //计算 colspanOfCtl .
                int colspanOfCtl = 1;
                if (attr.UIIsLine)
                {
                    colspanOfCtl = 3;
                }

                if (attr.UIIsLine)
                {
                    if (isLeftNext == false)
                    {
                        this.Pub1.AddTD();
                        this.Pub1.AddTD();
                        this.Pub1.AddTREnd();
                    }
                    isLeftNext = true;
                }

                if (isLeftNext)
                {
                    rowIdx++;
                    this.Pub1.AddTR(" ID='" + currGF.Idx + "_" + rowIdx + "' " + gfAttr);
                }

                TB tb = new TB();
                tb.Attributes["width"] = "100%";
                tb.Columns             = 60;
                tb.ID = "TB_" + attr.KeyOfEn;

                #region add contrals.
                switch (attr.LGType)
                {
                case FieldTypeS.Normal:

                    tb.Enabled = attr.UIIsEnable;
                    switch (attr.MyDataType)
                    {
                    case BP.DA.DataType.AppString:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.TB;
                        tb.Text     = attr.DefVal;
                        if (colspanOfCtl == 3)
                        {
                            this.Pub1.AddTD(" width=80% colspan=" + colspanOfCtl, tb);
                        }
                        else
                        {
                            if (attr.IsSigan)
                            {
                                this.Pub1.AddTD("colspan=" + colspanOfCtl, "<img src='/DataUser/Siganture/" + WebUser.No + ".jpg' border=0 onerror=\"this.src='/DataUser/Siganture/UnName.jpg'\"/>");
                            }
                            else
                            {
                                this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                            }
                        }
                        break;

                    case BP.DA.DataType.AppDate:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.Date;

                        tb.Text = attr.DefVal;

                        if (attr.UIIsEnable)
                        {
                            tb.Attributes["onfocus"] = "WdatePicker();";
                        }

                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    case BP.DA.DataType.AppDateTime:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.DateTime;
                        tb.Text     = attr.DefVal;
                        if (attr.UIIsEnable)
                        {
                            tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                        }

                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    case BP.DA.DataType.AppBoolean:
                        if (attr.UIIsLine)
                        {
                            this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        }
                        else
                        {
                            this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        }

                        CheckBox cb = new CheckBox();
                        cb.Text    = attr.Name;
                        cb.Checked = attr.DefValOfBool;
                        cb.Enabled = attr.UIIsEnable;
                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, cb);
                        break;

                    case BP.DA.DataType.AppDouble:
                    case BP.DA.DataType.AppFloat:
                    case BP.DA.DataType.AppInt:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.Num;
                        tb.Text     = attr.DefVal;
                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    case BP.DA.DataType.AppMoney:
                    case BP.DA.DataType.AppRate:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.Moneny;
                        tb.Text     = attr.DefVal;
                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    default:
                        break;
                    }

                    tb.Attributes["width"] = "100%";
                    switch (attr.MyDataType)
                    {
                    case BP.DA.DataType.AppString:
                    case BP.DA.DataType.AppDateTime:
                    case BP.DA.DataType.AppDate:
                        if (tb.Enabled)
                        {
                            tb.Attributes["class"] = "TB";
                        }
                        else
                        {
                            tb.Attributes["class"] = "TBReadonly";
                        }
                        break;

                    default:
                        if (tb.Enabled)
                        {
                            tb.Attributes["class"] = "TBNum";
                        }
                        else
                        {
                            tb.Attributes["class"] = "TBNumReadonly";
                        }
                        break;
                    }
                    break;

                case FieldTypeS.Enum:
                    this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                    DDL ddle = new DDL();
                    ddle.ID = "DDL_" + attr.KeyOfEn;
                    ddle.BindSysEnum(attr.KeyOfEn);
                    ddle.SetSelectItem(attr.DefVal);
                    ddle.Enabled = attr.UIIsEnable;
                    this.Pub1.AddTD("colspan=" + colspanOfCtl, ddle);
                    break;

                case FieldTypeS.FK:
                    this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                    DDL ddl1 = new DDL();
                    ddl1.ID = "DDL_" + attr.KeyOfEn;
                    try
                    {
                        EntitiesNoName ens = attr.HisEntitiesNoName;
                        ens.RetrieveAll();
                        ddl1.BindEntities(ens);
                        ddl1.SetSelectItem(attr.DefVal);
                    }
                    catch
                    {
                    }
                    ddl1.Enabled = attr.UIIsEnable;
                    this.Pub1.AddTD("colspan=" + colspanOfCtl, ddl1);
                    break;

                default:
                    break;
                }
                #endregion add contrals.

                if (colspanOfCtl == 3)
                {
                    isLeftNext = true;
                    this.Pub1.AddTREnd();
                    continue;
                }

                if (isLeftNext == false)
                {
                    isLeftNext = true;
                    this.Pub1.AddTREnd();
                    continue;
                }
                isLeftNext = false;
            }
            // 最后处理补充上它。
            if (isLeftNext == false)
            {
                this.Pub1.AddTD();
                this.Pub1.AddTD();
                this.Pub1.AddTREnd();
            }
            this.InsertObjects(false);
        }
        this.Pub1.AddTableEnd();


        #region 处理异常情况。
        foreach (MapDtl dtl in dtls)
        {
            if (dtl.IsUse == false)
            {
                dtl.RowIdx  = 0;
                dtl.GroupID = 0;
                dtl.Update();
                //    this.Response.Redirect(this.Request.RawUrl, true);
            }
        }
        #endregion 处理异常情况。


        #region 处理iFrom 的自适应的问题。
        string js = "\t\n<script type='text/javascript' >";
        foreach (MapDtl dtl in dtls)
        {
            js += "\t\n window.setInterval(\"ReinitIframe('F" + dtl.No + "','TD" + dtl.No + "')\", 200);";
        }

        js += "\t\n</script>";
        this.Pub1.Add(js);
        #endregion 处理iFrom 的自适应的问题。

        #region 处理隐藏字段。
        string msg = ""; // +++++++ 编辑隐藏字段 +++++++++ <br>";
        foreach (MapAttr attr in mattrs)
        {
            if (attr.UIVisible)
            {
                continue;
            }
            switch (attr.KeyOfEn)
            {
            case "OID":
            case "FID":
            case "FK_NY":
            case "Emps":
            case "FK_Dept":
            case "WFState":
            case "RDT":
            case "MyNum":
            case "Rec":
            case "CDT":
                continue;

            default:
                break;
            }
            msg += "<a href=\"javascript:Edit('" + this.FK_MapData + "','" + attr.MyPK + "','" + attr.MyDataType + "');\">" + attr.Name + "</a> ";
        }

        if (msg.Length > 10)
        {
            this.Pub1.AddFieldSet("编辑隐藏字段");
            this.Pub1.Add(msg);
            this.Pub1.Add("<br>说明:隐藏字段是不显示在表单里面,多用于属性的计算、方向条件的设置,报表的体现。");
            this.Pub1.AddFieldSetEnd();
        }
        #endregion 处理隐藏字段。

        #region 查询条件定义
        this.Pub1.AddFieldSet("查询条件定义" + " - <a href=\"javascript:WinOpen('../Rpt/Search.aspx?FK_Flow=" + this.FK_Flow + "')\">查询预览</a>-<a href=\"javascript:WinOpen('/WF/Comm/Group.aspx?EnsName=" + this.MyPK + "')\">分析预览</a>");
        foreach (MapAttr mattr in mattrs)
        {
            if (mattr.UIContralType != UIContralType.DDL)
            {
                continue;
            }

            CheckBox cb = new CheckBox();
            cb.ID = "CB_F_" + mattr.KeyOfEn;
            if (md.RptSearchKeys.Contains("@" + mattr.KeyOfEn))
            {
                cb.Checked = true;
            }

            cb.Text = mattr.Name;
            this.Pub1.Add(cb);
        }

        this.Pub1.AddHR();
        Button btn = new Button();
        btn.CssClass = "Btn";
        btn.Text     = "保存";
        btn.ID       = "Btn_Save";
        btn.Click   += new EventHandler(btn_Click);
        this.Pub1.Add(btn);

        this.Pub1.AddFieldSetEnd();
        #endregion
    }
コード例 #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData md = new MapData(this.FK_MapData);

            this.Title = md.Name + " - 设计一对多";
            MapM2M m2m = new MapM2M(this.FK_MapData, this.NoOfObj);

            if (m2m.HisM2MType == M2MType.M2MM)
            {
                this.Response.Redirect("MapM2MM.aspx?FK_MapData=" + this.FK_MapData + "&NoOfObj=" + this.NoOfObj, true);
                return;
            }

            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("一对多属性");
            int idx = 1;

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("编号");
            TB tb = new TB();

            tb.ID   = "TB_" + MapM2MAttr.NoOfObj;
            tb.Text = m2m.NoOfObj;
            if (m2m.IsExits)
            {
                tb.Enabled = false;
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("描述");
            tb         = new TB();
            tb.ID      = "TB_" + MapM2MAttr.Name;
            tb.Text    = m2m.Name;
            tb.Columns = 50;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("主体数据源<font color=red>*</font>");
            tb          = new TB();
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;
            tb.ID       = "TB_" + MapM2MAttr.DBOfObjs;
            tb.Text     = m2m.DBOfObjs;
            tb.Columns  = 50;

            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("分组数据源");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.DBOfGroups;
            tb.Text     = m2m.DBOfGroups;
            tb.Columns  = 50;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架宽度");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.W;
            tb.ShowType = TBType.Num;
            tb.Text     = m2m.W.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架高度");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.H;
            tb.ShowType = TBType.Num;
            tb.Text     = m2m.H.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("记录呈现列数");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.Cols;
            tb.ShowType = TBType.Num;
            tb.Text     = m2m.Cols.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示方式");
            DDL ddl = new DDL();

            ddl.ID = "DDL_" + MapM2MAttr.ShowWay;
            ddl.BindSysEnum("FrmUrlShowWay", (int)m2m.ShowWay);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("请参考手册");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("权限");
            this.Pub1.AddTDBegin("colspan=2");

            CheckBox cb = new CheckBox();

            cb.Checked = m2m.IsDelete;
            cb.Text    = "是否可以删除?";
            cb.ID      = "CB_IsDelete";
            this.Pub1.Add(cb);

            cb         = new CheckBox();
            cb.Checked = m2m.IsDelete;
            cb.Text    = "是否可以增加?";
            cb.ID      = "CB_IsInsert";
            this.Pub1.Add(cb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            GroupFields gfs = new GroupFields(md.No);

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示在分组");
            ddl    = new DDL();
            ddl.ID = "DDL_GroupField";
            ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, AddAllLocation.None);
            ddl.SetSelectItem(m2m.GroupID);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            this.Pub1.AddTDBegin("colspan=4 align=center");

            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.CssClass = "Btn";
            btn.ID       = "Btn_SaveAndClose";
            btn.Text     = " 保存并关闭 ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            if (m2m.IsExits)
            {
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Del";
                btn.Text     = "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.Add(btn);
            }

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();

            this.Pub1.AddFieldSet("SQL事例");
            this.Pub1.Add("主体数据源:");
            this.Pub1.AddBR("SELECT No,Name,FK_Dept FROM Port_Emp");
            this.Pub1.AddBR();
            this.Pub1.Add("分组数据源:");
            this.Pub1.AddBR("SELECT No,Name FROM Port_Dept ");
            this.Pub1.AddFieldSetEnd();
        }
コード例 #28
0
ファイル: ToolsWap.ascx.cs プロジェクト: zhaoyingju/ccflow
        /// <summary>
        /// 授权明细
        /// </summary>
        public void BindAutoDtl()
        {
            if (WebUser.IsWap)
            {
                this.AddFieldSet("<a href=Home.aspx ><img src='/WF/Img/Home.gif' border=0 >Home</a>-<a href='" + this.PageID + ".aspx'>设置</a>-授权详细信息");
            }
            else
            {
                this.AddFieldSet("授权详细信息");
            }

            BP.WF.Port.WFEmp emp   = new BP.WF.Port.WFEmp(WebUser.No);
            BP.WF.Port.WFEmp empAu = new BP.WF.Port.WFEmp(this.Request["FK_Emp"]);

            this.AddBR();
            this.AddTable();
            this.AddTR();
            this.AddTDTitle("项目");
            this.AddTDTitle("内容");
            this.AddTREnd();

            this.AddTR();
            this.AddTD("授权给:");
            this.AddTD(empAu.No + "    " + empAu.Name);
            this.AddTREnd();

            this.AddTR();
            this.AddTD("收回授权日期:");
            TB tb = new TB();

            tb.ID = "TB_DT";
            System.DateTime dtNow = System.DateTime.Now;
            dtNow       = dtNow.AddDays(14);
            tb.Text     = dtNow.ToString(DataType.SysDataTimeFormat);
            tb.ShowType = TBType.DateTime;
            tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
            this.AddTD(tb);
            this.AddTREnd();

            this.AddTR();
            this.AddTD("授权方式:");
            DDL ddl = new DDL();

            ddl.ID = "DDL_AuthorWay";
            ddl.BindSysEnum(BP.WF.Port.WFEmpAttr.AuthorWay);
            ddl.SetSelectItem(emp.AuthorWay);
            this.AddTD(ddl);
            this.AddTREnd();

            Button btnSaveIt = new Button();

            btnSaveIt.ID       = "Btn_Save";
            btnSaveIt.CssClass = "Btn";
            btnSaveIt.Text     = "Save";
            btnSaveIt.Click   += new EventHandler(btnSaveIt_Click);
            this.AddTR();
            this.AddTD("colspan=1", "<b><a href=\"javascript:WinShowModalDialog('ToolsSet.aspx?RefNo=AthFlows&d=" + DateTime.Now.ToString() + "')\" >设置要授权的流程范围</a></b>");
            this.AddTD("colspan=1", btnSaveIt);
            this.AddTREnd();

            this.AddTR();
            this.AddTDBigDoc("colspan=2", "说明:在您确定了收回授权日期后,被授权人不能再以您的身份登陆,<br>如果未到指定的日期您可以取回授权。");
            this.AddTREnd();
            this.AddTableEndWithBR();
            this.AddFieldSetEnd();
        }
コード例 #29
0
        public void DoNew(BillTemplate bill)
        {
            this.Ucsys1.Clear();
            BP.WF.Node nd = new BP.WF.Node(this.NodeID);
            this.Ucsys1.AddTable();
            this.Ucsys1.AddCaptionLeft("<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "' >" + "返回" + "</a> - <a href=Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=New ><img  border=0 src='../Img/Btn/New.gif' />新建</a>");
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("输入");
            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("单据类型"); // 单据/单据名称
            DDL ddl = new DDL();

            ddl.ID = "DDL_BillType";

            BP.WF.Data.BillTypes ens = new BillTypes();
            ens.RetrieveAllFromDBSource();

            if (ens.Count == 0)
            {
                BP.WF.Data.BillType enB = new BillType();
                enB.Name    = "新建类型" + "1";
                enB.FK_Flow = this.FK_Flow;
                enB.No      = "01";
                enB.Insert();
                ens.AddEntity(enB);
            }

            ddl.BindEntities(ens);
            ddl.SetSelectItem(bill.FK_BillType);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=EditType'><img src='../Img/Btn/Edit.gif' border=0/>类别维护</a>");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("编号");
            TB tb = new TB();

            tb.ID      = "TB_No";
            tb.Text    = bill.No;
            tb.Enabled = false;
            if (tb.Text == "")
            {
                tb.Text = "系统自动生成";
            }

            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("名称"); // 单据/单据名称
            tb         = new TB();
            tb.ID      = "TB_Name";
            tb.Text    = bill.Name;
            tb.Columns = 40;
            this.Ucsys1.AddTD("colspan=2", tb);
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("生成的文件类型"); // 单据/单据名称
            ddl    = new DDL();
            ddl.ID = "DDL_BillFileType";
            ddl.BindSysEnum("BillFileType");
            ddl.SetSelectItem((int)bill.HisBillFileType);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("目前不支持excel,html格式.");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("单据模板");
            HtmlInputFile file = new HtmlInputFile();

            file.ID = "f";
            file.Attributes["width"] = "100%";
            this.Ucsys1.AddTD("colspan=2", file);
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTRSum();
            this.Ucsys1.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.CssClass = "Btn";
            btn.ID       = "Btn_Save";
            btn.Text     = "保存";
            this.Ucsys1.Add(btn);
            btn.Click += new EventHandler(btn_Click);
            this.Ucsys1.Add(btn);
            if (bill.No.Length > 1)
            {
                btn          = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";
                btn.Text     = "删除"; // "删除单据";
                this.Ucsys1.Add(btn);
                btn.Attributes["onclick"] += " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
            }
            string url      = "";
            string fileType = "";

            if (bill.HisBillFileType == BillFileType.RuiLang)
            {
                fileType = "grf";
            }
            else
            {
                fileType = "rtf";
            }

            if (this.RefNo != null)
            {
                url = "<a href='../../DataUser/CyclostyleFile/" + bill.Url + "." + fileType + "'><img src='../Img/Btn/save.gif' border=0/> 模板下载</a>";
            }

            this.Ucsys1.Add(url + "</TD>");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTable();
        }
コード例 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FrmEvents ndevs = new FrmEvents();

            ndevs.Retrieve(FrmEventAttr.FK_MapData, this.FK_MapData);

            FrmEvent mynde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, this.Event) as FrmEvent;

            if (mynde == null)
            {
                mynde          = new FrmEvent();
                mynde.FK_Event = this.Event;
            }

            this.Pub1.AddTable("class='Table' cellspacing='1' cellpadding='1' border='1' style='width:100%'");

            this.Pub1.AddTR();
            this.Pub1.AddTD("内容类型:");
            DDL ddl = new DDL();

            ddl.BindSysEnum("EventDoType");
            ddl.ID = "DDL_EventDoType";
            ddl.SetSelectItem((int)mynde.HisDoType);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan=2");
            this.Pub1.Add("&nbsp;要执行的内容<br>");
            TextBox tb = new TextBox();

            tb.ID      = "TB_Doc";
            tb.Columns = 50;
            tb.Style.Add("width", "99%");
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 20;
            tb.Text     = mynde.DoDoc;
            this.Pub1.Add(tb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan=2");
            tb    = new TextBox();
            tb.ID = "TB_MsgOK";
            tb.Style.Add("width", "99%");
            tb.Text = mynde.MsgOKString;
            this.Pub1.Add("执行成功信息提示(可为空)<br>");
            this.Pub1.Add(tb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan=2");
            this.Pub1.Add("执行失败信息提示(可为空)<br>");
            tb    = new TextBox();
            tb.ID = "TB_MsgErr";
            tb.Style.Add("width", "99%");
            tb.Text = mynde.MsgErrorString;
            this.Pub1.Add(tb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Click);
            Pub1.Add(btn);

            if (!string.IsNullOrWhiteSpace(this.MyPK))
            {
                Pub1.AddSpace(1);
                Pub1.Add(
                    string.Format(
                        "<a href='javascript:void(0)' onclick=\"DoDel('{0}','{1}')\" class='easyui-linkbutton' data-options=\"iconCls:'icon-delete'\">删除</a>",
                        NodeID, Event));
            }
        }