Exemplo n.º 1
0
        void btnC_Click(object sender, EventArgs e)
        {
            BP.WF.Node  mynd = new BP.WF.Node(this.RefNo);
            BP.WF.Nodes nds  = new BP.WF.Nodes(mynd.FK_Flow);
            foreach (BP.WF.Node nd in nds)
            {
                if ("ND" + nd.NodeID == this.RefNo)
                {
                    continue;
                }

                GroupFields gfs = new GroupFields("ND" + nd.NodeID);
                foreach (GroupField gf in gfs)
                {
                    string id = "CB_" + gf.OID;
                    if (this.Pub1.GetCBByID(id).Checked == false)
                    {
                        continue;
                    }

                    MapAttrs attrs = new MapAttrs();
                    attrs.Retrieve(MapAttrAttr.GroupID, gf.OID);
                    if (attrs.Count == 0)
                    {
                        continue;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static string[] GetGroupFields(GroupFields fields)
        {
            var s =
                Enum.GetValues(typeof(GroupFields))
                .OfType <GroupFields>()
                .Where(a => a != GroupFields.Everything && a != GroupFields.None)
                .Where(a => (fields & a) == a)
                .Select(a => a.ToNCString().ToSnake())
                .ToArray();

            return(s);
        }
Exemplo n.º 3
0
        void btn_Click(object sender, EventArgs e)
        {
            FrmAttachment ath = new FrmAttachment();
            Button        btn = sender as Button;

            if (btn.ID == "Btn_Delete")
            {
                ath.MyPK = this.FK_MapData + "_" + this.Ath;
                ath.Delete();
                this.WinClose("删除成功.");
                return;
            }

            ath.MyPK = this.FK_MapData + "_" + this.Ath;
            if (this.Ath != null)
            {
                ath.RetrieveFromDBSources();
            }
            ath            = this.Pub1.Copy(ath) as FrmAttachment;
            ath.FK_MapData = this.FK_MapData;
            ath.MyPK       = this.FK_MapData + "_" + this.Ath;

            GroupFields gfs1 = new GroupFields(this.FK_MapData);

            if (gfs1.Count == 1)
            {
                GroupField gf = (GroupField)gfs1[0];
                ath.GroupID = gf.OID;
            }
            else
            {
                ath.GroupID = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemIntVal;
            }

            if (this.Ath == null)
            {
                ath.UploadType = (AttachmentUploadType)int.Parse(this.UploadType);
                ath.MyPK       = this.FK_MapData + "_" + this.Ath;
                if (ath.IsExits == true)
                {
                    this.Alert("附件编号(" + ath.NoOfObj + ")已经存在。");
                    return;
                }
                ath.Insert();
            }
            else
            {
                ath.NoOfObj = this.Ath;
                ath.Update();
            }
            this.WinCloseWithMsg("保存成功");
        }
 public override List <Sort> RequiredSortFields()
 {
     if (GroupFields == null)
     {
         return(null);
     }
     else
     {
         return(GroupFields.Select(c => new Sort {
             Column = c.SourceColumn, Direction = Sort.EDirection.Ascending
         }).ToList());
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 返回信息。
        /// </summary>
        /// <returns></returns>
        public string RadioBtns_Init()
        {
            DataSet ds = new DataSet();

            //放入表单字段.
            MapAttrs attrs = new MapAttrs(this.FK_MapData);

            ds.Tables.Add(attrs.ToDataTableField("Sys_MapAttr"));

            //属性.
            MapAttr attr = new MapAttr();

            attr.MyPK = this.FK_MapData + "_" + this.KeyOfEn;
            attr.Retrieve();

            //把分组加入里面.
            GroupFields gfs = new GroupFields(this.FK_MapData);

            ds.Tables.Add(gfs.ToDataTableField("Sys_GroupFields"));

            //字段值.
            FrmRBs rbs = new FrmRBs();

            rbs.Retrieve(FrmRBAttr.FK_MapData, this.FK_MapData, FrmRBAttr.KeyOfEn, this.KeyOfEn);
            if (rbs.Count == 0)
            {
                /*初始枚举值变化.
                 */
                SysEnums ses = new SysEnums(attr.UIBindKey);
                foreach (SysEnum se in ses)
                {
                    FrmRB rb = new FrmRB();
                    rb.FK_MapData = this.FK_MapData;
                    rb.KeyOfEn    = this.KeyOfEn;
                    rb.IntKey     = se.IntKey;
                    rb.Lab        = se.Lab;
                    rb.EnumKey    = attr.UIBindKey;
                    rb.Insert(); //插入数据.
                }

                rbs.Retrieve(FrmRBAttr.FK_MapData, this.FK_MapData, FrmRBAttr.KeyOfEn, this.KeyOfEn);
            }

            //加入单选按钮.
            ds.Tables.Add(rbs.ToDataTableField("Sys_FrmRB"));
            return(BP.Tools.Json.ToJson(ds));
        }
Exemplo n.º 6
0
        void btn_Save_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            try
            {
                MapM2M m2m = new MapM2M(this.FK_MapData, this.NoOfObj);
                m2m            = (MapM2M)this.Pub1.Copy(m2m);
                m2m.FK_MapData = this.FK_MapData;
                m2m.ShowWay    = (FrmShowWay)this.Pub1.GetDDLByID("DDL_ShowWay").SelectedItemIntVal;
                m2m.FK_MapData = this.FK_MapData;
                if (string.IsNullOrEmpty(m2m.NoOfObj))
                {
                    m2m.NoOfObj = this.NoOfObj;
                }

                if (string.IsNullOrEmpty(m2m.NoOfObj))
                {
                    m2m.NoOfObj = DataType.ParseStringToPinyin(m2m.Name);
                }

                GroupFields gfs = new GroupFields(m2m.FK_MapData);
                m2m.GroupID    = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemIntVal;
                m2m.HisM2MType = M2MType.M2M;
                m2m.Save();

                if (btn.ID.Contains("AndC"))
                {
                    this.WinClose();
                    return;
                }
                this.Response.Redirect("MapM2M.aspx?DoType=Edit&NoOfObj=" + m2m.NoOfObj + "&FK_MapData=" + this.FK_MapData, true);
            }
            catch (Exception ex)
            {
                this.Alert(ex.Message);
            }
        }
        public override object Do()
        {
            GroupFields gfs = new GroupFields();

            gfs.RetrieveAll();

            int delNum = 0;

            foreach (GroupField item in gfs)
            {
                int num = 0;
                num += DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM Sys_MapAttr WHERE GroupID='" + item.OID + "' and FK_MapData='" + item.FrmID + "'");
                //num += DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM Sys_FrmAttachment WHERE GroupID=" + item.OID + " and FK_MapData='" + item.EnName + "'");
                //num += DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM Sys_MapDtl WHERE GroupID=" + item.OID + " and FK_MapData='" + item.EnName + "'");
                //num += DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM Sys_MapFrame WHERE GroupID=" + item.OID + " and FK_MapData='" + item.EnName + "'");
                if (num == 0)
                {
                    delNum++;
                    item.Delete();
                }
            }
            return("执行成功,删除数量:" + delNum);
        }
        protected override DataSourceSelectArguments CreateDataSourceSelectArguments()
        {
            var arguments = base.CreateDataSourceSelectArguments();

            if (GroupFields != null && GroupFields.Count > 0)
            {
                var order = GroupFields.Aggregate(
                    string.Empty, (current, g) => (current == string.Empty ? string.Empty : current + ",")
                    + g.GroupField
                    + (g.Ascending ? string.Empty : " desc"));
                if (string.IsNullOrEmpty(arguments.SortExpression))
                {
                    arguments.SortExpression = order;
                }
                else
                {
                    arguments.SortExpression += "," + order;
                }
            }
            if (string.IsNullOrEmpty(arguments.SortExpression))
            {
                arguments.SortExpression = SortExpression ?? string.Empty;
            }
            else
            {
                arguments.SortExpression += "," + SortExpression;
            }

            if (!string.IsNullOrEmpty(DefaultSortExpression))
            {
                arguments.SortExpression = string.IsNullOrEmpty(arguments.SortExpression)
                                               ? DefaultSortExpression
                                               : arguments.SortExpression + "," + DefaultSortExpression;
            }

            return(arguments);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "字段复制";

            BP.WF.Node  nd  = new BP.WF.Node(this.FK_Node);
            BP.WF.Nodes nds = new BP.WF.Nodes(nd.FK_Flow);

            Node sNd = new Node(this.NodeOfSelect);

            MapAttrs attrs     = new MapAttrs(this.NodeOfSelect);
            MapAttrs attrsCopy = new MapAttrs(this.FK_Node);


            this.Pub1.AddFieldSet("选择节点");
            this.Pub1.AddUL("Main");
            foreach (BP.WF.Node en in nds)
            {
                if (this.NodeOfSelect == en.NodeID.ToString())
                {
                    this.Pub1.AddLiB("CopyFieldFromNode.aspx?FK_Node=" + this.FK_Node + "&NodeOfSelect=ND" + en.NodeID, "步骤:" + en.Step + ",名称:" + en.Name);
                }
                else
                {
                    this.Pub1.AddLi("CopyFieldFromNode.aspx?FK_Node=" + this.FK_Node + "&NodeOfSelect=ND" + en.NodeID, "步骤:" + en.Step + ",名称:" + en.Name);
                }
            }
            this.Pub1.AddULEnd();
            this.Pub1.AddFieldSetEnd();

            this.Pub2.AddTable("width='500px'");

            //this.Pub2.AddTR();
            //this.Pub2.AddTDTitle(this.ToE("Field", "字段"));
            ////this.Pub2.AddTDTitle("描述");
            ////this.Pub2.AddTDTitle("类型");
            ////this.Pub2.AddTDTitle(this.ToE("Show", "显示"));
            //this.Pub2.AddTREnd();

            GroupFields gfs  = new GroupFields(this.NodeOfSelect);
            MapDtls     dtls = new MapDtls(this.NodeOfSelect);
            MapM2Ms     m2ms = new MapM2Ms(this.NodeOfSelect);
            MapFrames   frms = new MapFrames(this.NodeOfSelect);

            bool isHave = false;

            foreach (GroupField gf in gfs)
            {
                this.Pub2.AddTRSum();
                CheckBox cb = new CheckBox();
                cb.ID   = "CB" + gf.OID;
                cb.Text = "<b>" + gf.Lab + "</b>";
                this.Pub2.AddTD(cb);
                this.Pub2.AddTREnd();

                foreach (MapDtl dtl in dtls)
                {
                    if (dtl.GroupID != gf.OID)
                    {
                        continue;
                    }

                    this.Pub2.AddTR();
                    cb      = new CheckBox();
                    cb.ID   = "CB" + dtl.No + "_" + dtl.GroupID;
                    cb.Text = "从表:" + dtl.Name;
                    this.Pub2.AddTD(cb);
                    this.Pub2.AddTREnd();
                }

                foreach (MapM2M m2m in m2ms)
                {
                    if (m2m.GroupID != gf.OID)
                    {
                        continue;
                    }
                    this.Pub2.AddTR();
                    cb      = new CheckBox();
                    cb.ID   = "CB" + m2m.MyPK + "_" + m2m.GroupID;
                    cb.Text = "多选" + ":" + m2m.Name;
                    this.Pub2.AddTD(cb);
                    this.Pub2.AddTREnd();
                }

                foreach (MapFrame frm in frms)
                {
                    if (frm.GroupID != gf.OID)
                    {
                        continue;
                    }
                    this.Pub2.AddTR();
                    cb      = new CheckBox();
                    cb.ID   = "CB" + frm.MyPK + "_" + frm.GroupID;
                    cb.Text = "框架" + ":" + frm.Name;
                    this.Pub2.AddTD(cb);
                    this.Pub2.AddTREnd();
                }


                this.Pub2.AddTR();
                this.Pub2.AddTDBigDocBegain();
                foreach (MapAttr attr in attrs)
                {
                    if (gf.OID != attr.GroupID)
                    {
                        continue;
                    }

                    switch (attr.KeyOfEn)
                    {
                    case BP.WF.GEStartWorkAttr.CDT:
                    case BP.WF.GEStartWorkAttr.Emps:
                    case BP.WF.GEStartWorkAttr.FID:
                    case BP.WF.GEStartWorkAttr.OID:
                    case BP.WF.GEStartWorkAttr.RDT:
                    case BP.WF.GEStartWorkAttr.Rec:
                    case BP.WF.GEStartWorkAttr.FK_NY:
                    case BP.WF.GEStartWorkAttr.WFState:
                    case BP.WF.GEStartWorkAttr.MyNum:
                    case BP.WF.GEStartWorkAttr.FK_Dept:
                    case BP.WF.GEStartWorkAttr.FK_DeptText:
                        continue;

                    default:
                        break;
                    }

                    cb      = new CheckBox();
                    cb.ID   = attr.KeyOfEn;
                    cb.Text = attr.KeyOfEn + " " + attr.Name;

                    if (attrsCopy.Contains(MapAttrAttr.KeyOfEn, attr.KeyOfEn))
                    {
                        cb.Enabled = false;
                    }
                    else
                    {
                        cb.Enabled = true;
                    }

                    isHave = true;
                    this.Pub2.Add(cb);
                }
                this.Pub2.AddTDEnd();
                this.Pub2.AddTREnd();
            }

            this.Pub2.AddTableEndWithBR();
            Button btn = new Button();

            btn.CssClass = "Btn";
            if (isHave == false)
            {
                return;
            }
            this.Pub2.Add("到分组:");
            gfs = new GroupFields(this.FK_Node);
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_GroupField";
            ddl.Bind(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab);
            ddl.SetSelectItem(this.GroupField);
            this.Pub2.Add(ddl);
            btn.ID   = "Btn_OK";
            btn.Text = " 复制 ";

            btn.UseSubmitBehavior = false;
            btn.OnClientClick     = "this.disabled=true;";
            //this.disabled='disabled'; return true;";
            // btn.Attributes["onclick"] = " return confirm('您确定要复制选择的字段到 [" + nd.Name + "]表单中吗?');";
            // btn.Attributes["onclick"] = " return confirm('" + this.ToE("AYS", "您确定要复制选择的字段到 [" + nd.Name + "]表单中吗?") + "');";

            btn.Click += new EventHandler(btn_Copy_Click);
            this.Pub2.Add(btn);
        }
Exemplo n.º 10
0
        public void EditBeforeEnd(MapAttr mapAttr)
        {
            #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("colspan=3", ddlGroup);
            this.Pub1.AddTREnd();
            #endregion 字段分组

            #region 是否是数字签名字段
            if (mapAttr.UIIsEnable == false && mapAttr.MyDataType == DataType.AppString && mapAttr.LGType == FieldTypeS.Normal)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                CheckBox cb = new CheckBox();
                cb.ID      = "CB_IsSigan";
                cb.Text    = "是否是数字签名字段";
                cb.Checked = mapAttr.IsSigan;

                this.Pub1.AddTD("colspan=3", cb);
                this.Pub1.AddTREnd();
            }
            #endregion 字段分组

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD 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.ID       = "Btn_SaveAndClose";
            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_SaveAndNew";
            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.Text ="扩展设置";
                //btn.Attributes["onclick"] = "javascript:WinOpen('AutoFull.aspx?RefNo=" + this.RefNo + "&FK_MapData=" + mapAttr.FK_MapData + "',''); return false;";

                this.Pub1.Add("<input type=button class=Btn value='扩展设置' onclick=\"javascript:WinOpen('AutoFull.aspx?RefNo=" + this.RefNo + "&FK_MapData=" + mapAttr.FK_MapData + "',''); return false;\" />");

                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;
            btn          = new Button();
            btn.ID       = "Btn_New";
            btn.CssClass = "Btn";
            btn.Text     = "新建";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_Back";
            btn.CssClass = "Btn";
            btn.Text     = "返回";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            // this.Pub1.Add("<input type=button  value='" + + "' onclick=\"window.location.href='" + url + "'\" >");
            // this.Pub1.Add("<a href='" + url + "'><img src='/WF/Img/Btn/New.gif' border=0>新建</a></TD>");
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithBR();
        }
Exemplo n.º 11
0
            public Request<Group[]> GetById(
                int[] groupIds ,  GroupFields fields 
            ) {
                var req = new Request<Group[]>{
                    MethodName = "groups.getById",
                    Parameters = new Dictionary<string, string> {

                        { "group_ids", (groupIds??new int[]{}).ToNCStringA()},
                        { "fields", String.Join( ",", MiscTools.GetGroupFields( fields ) )},

                    }
                };
                if (_parent.IsLogged)
                    req.Token = _parent.CurrentToken;
                return req;
            }
Exemplo n.º 12
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();
        }
Exemplo n.º 13
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();
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "字段分组";

            switch (this.DoType)
            {
            case "FunList":
                this.Pub1.AddFieldSet("字段分组向导");
                this.Pub1.AddUL();
                this.Pub1.AddLi("<b><a href='GroupField.aspx?DoType=NewGroup&RefNo=" + this.RefNo + "'>新建空白字段分组</a></b><br><font color=green>空白字段分组,建立后可以把相关的字段放入此分组里。</font>");
                this.Pub1.AddLi("<b><a href='GroupField.aspx?DoType=NewCheckGroup&RefNo=" + this.RefNo + "'>新建审核分组</a></b><br><font color=green>系统会让您输入审核的信息,并创建审核分组。</font>");
                this.Pub1.AddLi("<b><a href='GroupField.aspx?DoType=NewEvalGroup&RefNo=" + this.RefNo + "'>创建工作质量考核字段分组</a></b><br><font color=green>创建质量考核: EvalEmpNo,EvalEmpName,EvalCent,EvalNote 4个必要的字段。</font>");
                this.Pub1.AddULEnd();
                this.Pub1.AddFieldSetEnd();
                return;

            case "NewCheckGroup":
                this.Pub1.AddFieldSet("<a href=GroupField.aspx?DoType=FunList&RefNo=" + this.RefNo + " >字段分组向导</a> - " + "审核分组");
                TB tbc = new TB();
                tbc.ID = "TB_Sta";
                this.Pub1.Add("审核岗位<font color=red>*</font>");
                this.Pub1.Add(tbc);
                this.Pub1.AddBR("<font color=green>比如:分局长审核、科长审核、总经理审核。</font>");
                this.Pub1.AddBR();

                tbc    = new TB();
                tbc.ID = "TB_Prx";
                this.Pub1.Add("字段前缀:");
                this.Pub1.Add(tbc);
                this.Pub1.AddBR("<font color=green>用于自动创建字段,请输入英文字母或者字母数字组合。系统自动依据您的输入产生字段。如:XXX_Note,审核意见。XXX_RDT审核时间。XXX_Checker审核人,为空系统自动用拼音表示。</font>");
                this.Pub1.AddBR();
                this.Pub1.AddHR();
                Btn btnc = new Btn();
                btnc.Click += new EventHandler(btn_Check_Click);
                btnc.Text   = "保存";

                this.Pub1.Add(btnc);
                this.Pub1.AddFieldSetEnd();
                return;

            case "NewEvalGroup":

                GroupField gf = new GroupField();
                gf.Lab    = "工作质量考核";
                gf.EnName = this.RefNo;
                gf.Insert();

                MapAttr attr = new MapAttr();
                attr.FK_MapData    = this.RefNo;
                attr.KeyOfEn       = BP.WF.WorkSysFieldAttr.EvalNote;
                attr.Name          = "审核意见";
                attr.MyDataType    = DataType.AppString;
                attr.UIContralType = UIContralType.TB;
                attr.UIIsEnable    = true;
                attr.UIIsLine      = true;
                attr.MaxLen        = 500;
                attr.GroupID       = gf.OID;
                attr.UIHeight      = 23;
                attr.ColSpan       = 4;
                attr.Idx           = 1;
                attr.Insert();

                attr               = new MapAttr();
                attr.FK_MapData    = this.RefNo;
                attr.KeyOfEn       = BP.WF.WorkSysFieldAttr.EvalCent;
                attr.Name          = "分值";
                attr.MyDataType    = DataType.AppFloat;
                attr.UIContralType = UIContralType.TB;
                attr.MaxLen        = 50;
                attr.MinLen        = 0;
                attr.UIIsEnable    = true;
                attr.UIIsLine      = false;
                attr.DefVal        = "0";
                attr.UIIsEnable    = false;
                attr.GroupID       = gf.OID;
                attr.IsSigan       = true;
                attr.Idx           = 2;
                attr.Insert();

                attr               = new MapAttr();
                attr.FK_MapData    = this.RefNo;
                attr.KeyOfEn       = BP.WF.WorkSysFieldAttr.EvalEmpNo;
                attr.Name          = "被评估人编号";
                attr.MyDataType    = DataType.AppString;
                attr.UIContralType = UIContralType.TB;
                attr.UIIsEnable    = true;
                attr.UIIsLine      = false;
                attr.DefVal        = "";
                attr.UIIsEnable    = false;
                attr.GroupID       = gf.OID;
                attr.Idx           = 3;
                attr.Insert();

                attr               = new MapAttr();
                attr.FK_MapData    = this.RefNo;
                attr.KeyOfEn       = BP.WF.WorkSysFieldAttr.EvalEmpName;
                attr.Name          = "被评估人名称";
                attr.MyDataType    = DataType.AppString;
                attr.UIContralType = UIContralType.TB;
                attr.UIIsEnable    = true;
                attr.UIIsLine      = false;
                attr.DefVal        = "";
                attr.UIIsEnable    = false;
                attr.GroupID       = gf.OID;
                attr.Idx           = 4;
                attr.Insert();
                this.WinCloseWithMsg("保存成功");     // "增加成功,您可以调整它的位置与修改字段的标签。"
                return;

            case "NewGroup":
                GroupFields mygfs = new GroupFields(this.RefNo);
                GroupField  gf1   = new GroupField();
                gf1.Idx    = mygfs.Count;
                gf1.Lab    = "新建字段分组";  // "新建字段分组";
                gf1.EnName = this.RefNo;
                if (gf1.IsExit(GroupFieldAttr.EnName, gf1.EnName, GroupFieldAttr.Lab, gf1.Lab) == false)
                {
                    gf1.Insert();
                }
                this.Response.Redirect("GroupField.aspx?RefNo=" + this.RefNo + "&RefOID=" + gf1.OID, true);
                return;

            default:
                break;
            }

            #region edit operation
            GroupField en = new GroupField(this.RefOID);
            this.Pub1.Add("<Table border=0 align=center>");
            this.Pub1.AddCaptionLeft("字段分组");
            this.Pub1.AddTR();

            this.Pub1.AddTD("分组名称");

            TB tb = new TB();
            tb.ID      = "TB_Lab_" + en.OID;
            tb.Text    = en.Lab;
            tb.Columns = 50;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD align=center colspan=2>");
            Btn btn = new Btn();
            btn.Text   = "保存";
            btn.ID     = "Btn_Save";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
            btn        = new Btn();
            btn.Text   = "保存并关闭";
            btn.ID     = "Btn_SaveAndClose";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn        = new Btn();
            btn.Text   = "新建字段";
            btn.ID     = "Btn_NewField";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            //btn = new Btn();
            //btn.Text = this.ToE("CopyField", "复制字段");
            //btn.ID = "Btn_CopyField";
            //btn.Click += new EventHandler(btn_Click);
            //this.Pub1.Add(btn);


            btn        = new Btn();
            btn.Text   = "删除";
            btn.ID     = "Btn_Delete";
            btn.Click += new EventHandler(btn_del_Click);
            btn.Attributes["onclick"] = " return confirm('您确认吗?');";

            this.Pub1.Add(btn);

            this.Pub1.Add("</TD>");
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
            this.Pub1.Add("把相近的字段放在一个大单元格里,只是为了显示所用没有任何计算意义。");
            #endregion
        }
Exemplo n.º 15
0
 public async Task<string> GetById(
     int[] groupIds ,  GroupFields fields 
 ){
     return await _parent.Executor.ExecRawAsync(
         _parent._reqapi.Groups.GetById(
                groupIds,fields
         )
     ).ConfigureAwait(false);
 }
Exemplo n.º 16
0
        public void BindEdit(MapData md, MapFrame dtl)
        {
            this.Pub1.AddTable();
            //  this.Pub1.AddCaptionLeftTX("<a href='MapDef.aspx?MyPK=" + md.No + "'>" + "返回" + ":" + md.Name + "</a> -  " + this.ToE("DtlTable", "从表") + ":(" + dtl.Name + ")");
            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_" + MapFrameAttr.NoOfObj;
            tb.Text = dtl.NoOfObj;
            if (this.DoType == "Edit")
            {
                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_Name";
            tb.Text    = dtl.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("框架连接");
            tb         = new TB();
            tb.ID      = "TB_URL";
            tb.Text    = dtl.URL;
            tb.Columns = 50;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架宽度");
            tb          = new TB();
            tb.ID       = "TB_W";
            tb.Text     = dtl.W;
            tb.ShowType = TBType.TB;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架高度");
            tb          = new TB();
            tb.ID       = "TB_H";
            tb.ShowType = TBType.TB;
            tb.Text     = dtl.H;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDBegin("colspan=3");

            RadioBtn rb = new RadioBtn();

            rb.Text      = "指定框架宽度高度";
            rb.ID        = "RB_IsAutoSize_0";
            rb.GroupName = "s";
            if (dtl.IsAutoSize)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }

            this.Pub1.Add(rb);


            rb           = new RadioBtn();
            rb.Text      = "让框架自适应大小";
            rb.ID        = "RB_IsAutoSize_1";
            rb.GroupName = "s";

            if (dtl.IsAutoSize)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

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

            GroupFields gfs = new GroupFields(md.No);

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示在分组");
            DDL 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();


            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_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_MapFrame != null)
            {
                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);
            }

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
        void btn_Copy_Click(object sender, EventArgs e)
        {
            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            Node       sNd = new Node(this.NodeOfSelect);

            BP.En.Attrs attrs     = sNd.HisWork.EnMap.Attrs;
            BP.En.Attrs attrsCopy = nd.HisWork.EnMap.Attrs;

            // 开始copy 分组的节点。
            GroupFields gfs  = new GroupFields(this.NodeOfSelect);
            MapDtls     dtls = new MapDtls(this.NodeOfSelect);
            MapM2Ms     m2ms = new MapM2Ms(this.NodeOfSelect);
            MapFrames   frms = new MapFrames(this.NodeOfSelect);

            foreach (GroupField gf in gfs)
            {
                CheckBox cb = this.Pub2.GetCBByID("CB" + gf.OID);
                if (cb.Checked == false)
                {
                    continue;
                }

                // 生成一个分组实体.
                GroupField mygf = new GroupField();
                mygf.Lab    = gf.Lab;
                mygf.EnName = this.FK_Node;
                mygf.Idx    = gf.Idx;
                mygf.Insert();

                foreach (MapM2M m2m in m2ms)
                {
                    if (m2m.GroupID != gf.OID)
                    {
                        continue;
                    }

                    MapM2M mym2m = new MapM2M();
                    mym2m.MyPK = m2m.MyPK.Replace(this.NodeOfSelect, this.FK_Node);
                    //  mym2m.FK_MapData =this
                    if (mym2m.IsExits)
                    {
                        continue;
                    }

                    mym2m.Copy(m2m);
                    mym2m.FK_MapData = this.FK_Node;
                    mym2m.GroupID    = mygf.OID;
                    mym2m.MyPK       = m2m.MyPK.Replace(this.NodeOfSelect, this.FK_Node);
                    mym2m.Insert();
                }

                foreach (MapFrame frm in frms)
                {
                    if (frm.GroupID != gf.OID)
                    {
                        continue;
                    }

                    MapFrame myen = new MapFrame();
                    myen.MyPK = frm.MyPK.Replace(this.NodeOfSelect, this.FK_Node);
                    if (myen.IsExits)
                    {
                        continue;
                    }

                    myen.Copy(frm);
                    myen.FK_MapData = this.FK_Node;
                    myen.GroupID    = mygf.OID;
                    myen.MyPK       = frm.MyPK.Replace(this.NodeOfSelect, this.FK_Node);
                    myen.Insert();
                }

                // 复制从表.
                foreach (MapDtl dtl in dtls)
                {
                    cb = this.Pub2.GetCBByID("CB_" + dtl.No + gf.OID);
                    MapDtl dtlNew = new MapDtl();
                    dtlNew.No = dtl.No.Replace(this.NodeOfSelect, this.FK_Node);
                    if (dtlNew.IsExits)
                    {
                        continue;
                    }

                    dtlNew.Copy(dtl);
                    dtlNew.FK_MapData = this.FK_Node;
                    dtlNew.No         = dtl.No.Replace(this.NodeOfSelect, this.FK_Node);

                    //  dtlNew.No = this.FK_Node + "Dtl";
                    // dtlNew.No = dtl.No.Replace(this.FK_Node, this.NodeOfSelect);

                    dtlNew.IsInsert = false;
                    dtlNew.IsUpdate = false;
                    dtlNew.IsDelete = false;

                    dtlNew.GroupID = mygf.OID;
                    dtlNew.PTable  = dtlNew.No;

                    dtlNew.Insert();

                    // 复制从表里面的明细。
                    int      idx    = 0;
                    MapAttrs mattrs = new MapAttrs(dtl.No);
                    foreach (MapAttr attr in mattrs)
                    {
                        MapAttr attrNew = new MapAttr();
                        attrNew.Copy(attr);
                        attrNew.FK_MapData = dtlNew.No;
                        attrNew.UIIsEnable = false;
                        if (attrNew.DefVal.Contains("@"))
                        {
                            attrNew.DefVal = "";
                        }

                        dtlNew.RowIdx       = idx;
                        attrNew.HisEditType = EditType.Edit;
                        attrNew.Insert();
                    }
                }

                // copy his fields.
                MapAttrs willCopyAttrs = new MapAttrs();
                willCopyAttrs.Retrieve(MapAttrAttr.GroupID, gf.OID, MapAttrAttr.Idx);
                int idx1 = 0;
                foreach (MapAttr attr in willCopyAttrs)
                {
                    MapAttr attrNew = new MapAttr();
                    if (attrNew.IsExit(MapAttrAttr.FK_MapData, this.FK_Node,
                                       MapAttrAttr.KeyOfEn, attr.KeyOfEn) == true)
                    {
                        continue;
                    }

                    if (attr.UIVisible == false)
                    {
                        continue;
                    }

                    idx1++;
                    attrNew.Copy(attr);
                    attrNew.GroupID    = mygf.OID;
                    attrNew.FK_MapData = this.FK_Node;
                    attrNew.UIIsEnable = false;
                    attrNew.Idx        = idx1;
                    if (attrNew.KeyOfEn == "Title")
                    {
                        attrNew.HisEditType = EditType.Edit;
                    }

                    attrNew.HisEditType = EditType.Edit;
                    attrNew.DefVal      = "";
                    attrNew.Insert();
                }
            }


            int GroupField = this.Pub2.GetDDLByID("DDL_GroupField").SelectedItemIntVal;

            foreach (Attr attr in attrs)
            {
                if (this.Pub2.IsExit(attr.Key) == false)
                {
                    continue;
                }
                CheckBox cb = this.Pub2.GetCBByID(attr.Key);
                if (cb.Checked == false)
                {
                    continue;
                }

                BP.Sys.MapAttr ma = new BP.Sys.MapAttr();
                int            i  = ma.Retrieve(BP.Sys.MapAttrAttr.KeyOfEn, attr.Key,
                                                BP.Sys.MapAttrAttr.FK_MapData, this.NodeOfSelect);

                BP.Sys.MapAttr ma1     = new BP.Sys.MapAttr();
                bool           ishavle = ma1.IsExit(BP.Sys.MapAttrAttr.KeyOfEn, attr.Key,
                                                    BP.Sys.MapAttrAttr.FK_MapData, this.FK_Node);

                if (ishavle)
                {
                    continue;
                }


                ma1.Copy(ma);

                ma1.FK_MapData = this.FK_Node;
                ma1.KeyOfEn    = ma.KeyOfEn;
                ma1.Name       = ma.Name;
                ma1.GroupID    = GroupField;
                ma1.UIIsEnable = false;

                ma1.HisEditType = EditType.Edit;

                if (ma1.DefVal != null && ma1.DefVal.Contains("@"))
                {
                    ma1.DefVal = "";
                }
                ma1.Insert();
            }

            if (this.Pub2.IsExit("CB_Table"))
            {
                if (this.Pub2.GetCBByID("CB_Table").Checked)
                {
                    MapData md1 = new MapData(this.NodeOfSelect);
                    MapData md2 = new MapData(this.FK_Node);
                    //md2.CellsX = md1.CellsX;
                    //md2.CellsY = md1.CellsY;
                    md2.Update();

                    //MapAttrs ma1 = md1.GenerHisTableCells;
                    // 删除历史数据。

                    //ma1.Delete(MapAttrAttr.FK_MapData, this.FK_Node + "T");
                    //foreach (MapAttr attr in ma1)
                    //{
                    //    MapAttr attr2 = new MapAttr();
                    //    attr2.Copy(attr);
                    //    // attr2.OID = 0;
                    //    attr2.GroupID = 0;
                    //    attr2.Idx = 0;
                    //    attr2.FK_MapData = this.FK_Node + "T";
                    //    attr2.UIIsEnable = false;
                    //    attr2.Insert();
                    //}
                }
            }

            this.WinClose();
            //this.WinCloseWithMsg("复制成功");
            //this.Response.Redirect("MapDef.aspx?PK=" + this.FK_Node + "&NodeOfSelect=" + this.NodeOfSelect);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Pub1.AddTable(" width='80%' ");
            this.Pub1.AddCaptionLeft("隐藏字段");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("字段");
            this.Pub1.AddTDTitle("名称(点击编辑)");
            this.Pub1.AddTDTitle("类型");
            this.Pub1.AddTREnd();
            MapAttrs    mattrs = new MapAttrs(this.FK_MapData);
            GroupFields gfs = new GroupFields(this.FK_MapData);
            string      msg = ""; int idx = 0;

            foreach (MapAttr attr in mattrs)
            {
                if (attr.UIVisible)
                {
                    continue;
                }
                switch (attr.KeyOfEn)
                {
                case "BatchID":
                case "OID":
                case "FID":
                case "FK_NY":
                case "RefPK":
                case "Emps":
                case "FK_Dept":
                case "WFState":
                case "RDT":
                case "MyNum":
                case "Rec":
                case "CDT":
                    continue;

                default:
                    break;
                }
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD(attr.KeyOfEn);
                switch (attr.LGType)
                {
                case FieldTypeS.Normal:
                    this.Pub1.AddTD("<a href=\"javascript:Edit('" + attr.FK_MapData + "','" + attr.MyPK + "','" + attr.MyDataType + "');\">" + attr.Name + "</a>");
                    break;

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

                case FieldTypeS.FK:
                    this.Pub1.AddTD("<a href=\"javascript:EditTable('" + attr.FK_MapData + "','" + attr.MyPK + "','" + attr.MyDataType + "');\">" + attr.Name + "</a>");
                    break;

                default:
                    break;
                }
                this.Pub1.AddTD(attr.LGType.ToString());
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEndWithHR();
            return;

            this.Pub1.AddFieldSet("编辑隐藏字段");
            this.Pub1.Add("说明:隐藏字段是不显示在表单里面,多用于属性的计算、方向条件的设置,报表的体现。");
            this.Pub1.AddFieldSetEnd();
        }
Exemplo n.º 19
0
        /// <summary>
        /// 产生一个WorkNode
        /// </summary>
        /// <param name="fk_flow">流程编号</param>
        /// <param name="fk_node">节点ID</param>
        /// <param name="workID">工作ID</param>
        /// <param name="fid">FID</param>
        /// <param name="userNo">用户编号</param>
        /// <returns>返回dataset</returns>
        public static DataSet GenerWorkNode(string fk_flow, int fk_node, Int64 workID, Int64 fid, string userNo, string fromWorkOpt = "0")
        {
            //节点.
            if (fk_node == 0)
            {
                fk_node = int.Parse(fk_flow + "01");
            }

            if (workID == 0)
            {
                workID = BP.WF.Dev2Interface.Node_CreateBlankWork(fk_flow, null, null, userNo, null);
            }

            Node nd = new Node(fk_node);

            try
            {
                nd.WorkID = workID; //为获取表单ID提供参数.
                MapData md = new MapData();
                md.No = nd.NodeFrmID;
                if (md.RetrieveFromDBSources() == 0)
                {
                    throw new Exception("装载错误,该表单ID=" + md.No + "丢失,请修复一次流程重新加载一次.");
                }

                Work wk = nd.HisWork;
                wk.OID = workID;

                wk.RetrieveFromDBSources();
                wk.ResetDefaultVal();

                // 第1.2: 调用,处理用户定义的业务逻辑.
                string sendWhen = nd.HisFlow.DoFlowEventEntity(EventListOfNode.FrmLoadBefore, nd,
                                                               wk, null);

                //获得表单模版.
                DataSet myds = BP.Sys.CCFormAPI.GenerHisDataSet(md.No, nd.Name);

                //移除MapAttr
                myds.Tables.Remove("Sys_MapAttr"); //移除.

                //获取表单的mapAttr
                //求出集合.
                MapAttrs mattrs = new MapAttrs(md.No);
                if (fk_node != null)
                {
                    /*处理表单权限控制方案*/
                    FrmNode frmNode = new FrmNode();
                    int     count   = frmNode.Retrieve(FrmNodeAttr.FK_Frm, md.No, FrmNodeAttr.FK_Node, fk_node);
                    if (count != 0 && frmNode.FrmSln != 0)
                    {
                        FrmFields fls = new FrmFields(md.No, frmNode.FK_Node);
                        foreach (FrmField item in fls)
                        {
                            foreach (MapAttr attr in mattrs)
                            {
                                if (attr.KeyOfEn != item.KeyOfEn)
                                {
                                    continue;
                                }

                                if (item.IsSigan)
                                {
                                    item.UIIsEnable = false;
                                }

                                attr.UIIsEnable = item.UIIsEnable;
                                attr.UIVisible  = item.UIVisible;
                                attr.IsSigan    = item.IsSigan;
                                attr.DefValReal = item.DefVal;
                            }
                        }
                    }
                }

                DataTable Sys_MapAttr = mattrs.ToDataTableField("Sys_MapAttr");
                myds.Tables.Add(Sys_MapAttr);

                //把流程信息表发送过去.
                GenerWorkFlow gwf = new GenerWorkFlow();
                gwf.WorkID = workID;
                gwf.RetrieveFromDBSources();

                //加入WF_Node.
                DataTable WF_Node = nd.ToDataTableField("WF_Node");
                myds.Tables.Add(WF_Node);

                #region 加入组件的状态信息, 在解析表单的时候使用.
                BP.WF.Template.FrmNodeComponent fnc = new FrmNodeComponent(nd.NodeID);

                nd.WorkID = workID; //为获取表单ID提供参数.
                if (nd.NodeFrmID != "ND" + nd.NodeID && nd.HisFormType != NodeFormType.RefOneFrmTree)
                {
                    /*说明这是引用到了其他节点的表单,就需要把一些位置元素修改掉.*/
                    int refNodeID = int.Parse(nd.NodeFrmID.Replace("ND", ""));

                    BP.WF.Template.FrmNodeComponent refFnc = new FrmNodeComponent(refNodeID);

                    fnc.SetValByKey(FrmWorkCheckAttr.FWC_H, refFnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_H));
                    fnc.SetValByKey(FrmWorkCheckAttr.FWC_W, refFnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_W));
                    fnc.SetValByKey(FrmWorkCheckAttr.FWC_X, refFnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_X));
                    fnc.SetValByKey(FrmWorkCheckAttr.FWC_Y, refFnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_Y));

                    if (fnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_H) <= 10)
                    {
                        fnc.SetValByKey(FrmWorkCheckAttr.FWC_H, 500);
                    }

                    if (fnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_W) <= 10)
                    {
                        fnc.SetValByKey(FrmWorkCheckAttr.FWC_W, 600);
                    }

                    if (fnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_X) <= 10)
                    {
                        fnc.SetValByKey(FrmWorkCheckAttr.FWC_X, 200);
                    }

                    if (fnc.GetValFloatByKey(FrmWorkCheckAttr.FWC_Y) <= 10)
                    {
                        fnc.SetValByKey(FrmWorkCheckAttr.FWC_Y, 200);
                    }


                    fnc.SetValByKey(FrmSubFlowAttr.SF_H, refFnc.GetValFloatByKey(FrmSubFlowAttr.SF_H));
                    fnc.SetValByKey(FrmSubFlowAttr.SF_W, refFnc.GetValFloatByKey(FrmSubFlowAttr.SF_W));
                    fnc.SetValByKey(FrmSubFlowAttr.SF_X, refFnc.GetValFloatByKey(FrmSubFlowAttr.SF_X));
                    fnc.SetValByKey(FrmSubFlowAttr.SF_Y, refFnc.GetValFloatByKey(FrmSubFlowAttr.SF_Y));

                    fnc.SetValByKey(FrmThreadAttr.FrmThread_H, refFnc.GetValFloatByKey(FrmThreadAttr.FrmThread_H));
                    fnc.SetValByKey(FrmThreadAttr.FrmThread_W, refFnc.GetValFloatByKey(FrmThreadAttr.FrmThread_W));
                    fnc.SetValByKey(FrmThreadAttr.FrmThread_X, refFnc.GetValFloatByKey(FrmThreadAttr.FrmThread_X));
                    fnc.SetValByKey(FrmThreadAttr.FrmThread_Y, refFnc.GetValFloatByKey(FrmThreadAttr.FrmThread_Y));

                    fnc.SetValByKey(FrmTrackAttr.FrmTrack_H, refFnc.GetValFloatByKey(FrmTrackAttr.FrmTrack_H));
                    fnc.SetValByKey(FrmTrackAttr.FrmTrack_W, refFnc.GetValFloatByKey(FrmTrackAttr.FrmTrack_W));
                    fnc.SetValByKey(FrmTrackAttr.FrmTrack_X, refFnc.GetValFloatByKey(FrmTrackAttr.FrmTrack_X));
                    fnc.SetValByKey(FrmTrackAttr.FrmTrack_Y, refFnc.GetValFloatByKey(FrmTrackAttr.FrmTrack_Y));

                    fnc.SetValByKey(FTCAttr.FTC_H, refFnc.GetValFloatByKey(FTCAttr.FTC_H));
                    fnc.SetValByKey(FTCAttr.FTC_W, refFnc.GetValFloatByKey(FTCAttr.FTC_W));
                    fnc.SetValByKey(FTCAttr.FTC_X, refFnc.GetValFloatByKey(FTCAttr.FTC_X));
                    fnc.SetValByKey(FTCAttr.FTC_Y, refFnc.GetValFloatByKey(FTCAttr.FTC_Y));

                    #region 没有审核组件分组就增加上审核组件分组. @杜需要翻译&测试.
                    if (md.HisFrmType == FrmType.FoolForm)
                    {
                        //判断是否是傻瓜表单,如果是,就要判断该傻瓜表单是否有审核组件groupfield ,没有的话就增加上.
                        DataTable gf     = myds.Tables["Sys_GroupField"];
                        bool      isHave = false;
                        foreach (DataRow dr in gf.Rows)
                        {
                            string cType = dr["CtrlType"] as string;
                            if (cType == null)
                            {
                                continue;
                            }

                            if (cType.Equals("FWC") == true)
                            {
                                isHave = true;
                            }
                        }

                        if (isHave == false)
                        {
                            DataRow dr = gf.NewRow();

                            nd.WorkID = workID; //为获取表单ID提供参数.
                            dr[GroupFieldAttr.OID]      = 100;
                            dr[GroupFieldAttr.FrmID]    = nd.NodeFrmID;
                            dr[GroupFieldAttr.CtrlType] = "FWC";
                            dr[GroupFieldAttr.CtrlID]   = "FWCND" + nd.NodeID;
                            dr[GroupFieldAttr.Idx]      = 100;
                            dr[GroupFieldAttr.Lab]      = "审核信息";
                            gf.Rows.Add(dr);

                            myds.Tables.Remove("Sys_GroupField");
                            myds.Tables.Add(gf);

                            //执行更新,就自动生成那个丢失的字段分组.
                            refFnc.Update();

                            /*
                             * //丢失了就插入新的.
                             * BP.Sys.GroupField gfEn = new GroupField();
                             * gfEn.FrmID = nd.NodeFrmID;
                             * gfEn.CtrlType = "FWC";
                             * gfEn.CtrlID = "FWCND" + nd.NodeID;
                             * gfEn.Idx = 100;
                             * gfEn.Lab = "审核信息";
                             * gfEn.Insert(); */
                        }
                    }
                    #endregion 没有审核组件分组就增加上审核组件分组.
                }

                #region 没有审核组件分组就增加上审核组件分组. @杜需要翻译&测试.
                if (nd.NodeFrmID == "ND" + nd.NodeID && nd.HisFormType != NodeFormType.RefOneFrmTree)
                {
                    //   Work wk1 = nd.HisWork;

                    if (nd.FormType == NodeFormType.FoolForm)
                    {
                        //判断是否是傻瓜表单,如果是,就要判断该傻瓜表单是否有审核组件groupfield ,没有的话就增加上.
                        DataTable gf     = myds.Tables["Sys_GroupField"];
                        bool      isHave = false;
                        foreach (DataRow dr in gf.Rows)
                        {
                            string cType = dr["CtrlType"] as string;
                            if (cType == null)
                            {
                                continue;
                            }

                            if (cType.Equals("FWC") == true)
                            {
                                isHave = true;
                            }
                        }

                        if (isHave == false)
                        {
                            DataRow dr = gf.NewRow();

                            nd.WorkID = workID; //为获取表单ID提供参数.
                            dr[GroupFieldAttr.OID]      = 100;
                            dr[GroupFieldAttr.FrmID]    = nd.NodeFrmID;
                            dr[GroupFieldAttr.CtrlType] = "FWC";
                            dr[GroupFieldAttr.CtrlID]   = "FWCND" + nd.NodeID;
                            dr[GroupFieldAttr.Idx]      = 100;
                            dr[GroupFieldAttr.Lab]      = "审核信息";
                            gf.Rows.Add(dr);

                            myds.Tables.Remove("Sys_GroupField");
                            myds.Tables.Add(gf);

                            //更新,为了让其自动增加审核分组.
                            BP.WF.Template.FrmNodeComponent refFnc = new FrmNodeComponent(nd.NodeID);
                            refFnc.Update();
                        }
                    }
                }
                #endregion 没有审核组件分组就增加上审核组件分组.

                myds.Tables.Add(fnc.ToDataTableField("WF_FrmNodeComponent"));

                #endregion 加入组件的状态信息, 在解析表单的时候使用.

                #region 增加 groupfields
                if (nd.FormType == NodeFormType.FoolTruck && nd.IsStartNode == false &&
                    DataType.IsNullOrEmpty(wk.HisPassedFrmIDs) == false)
                {
                    #region 处理字段分组排序.
                    //查询所有的分组, 如果是查看表单的方式,就不应该把当前的表单显示出来.
                    string myFrmIDs = "";
                    if (fromWorkOpt.Equals("1") == true)
                    {
                        if (gwf.WFState == WFState.Complete)
                        {
                            myFrmIDs = wk.HisPassedFrmIDs + ",'ND" + fk_node + "'";
                        }
                        else
                        {
                            myFrmIDs = wk.HisPassedFrmIDs; //流程未完成并且是查看表单的情况.
                        }
                    }
                    else
                    {
                        myFrmIDs = wk.HisPassedFrmIDs + ",'ND" + fk_node + "'";
                    }

                    GroupFields gfs = new GroupFields();
                    gfs.RetrieveIn(GroupFieldAttr.FrmID, "(" + myFrmIDs + ")");

                    //按照时间的顺序查找出来 ids .
                    string sqlOrder = "SELECT OID FROM  Sys_GroupField WHERE   FrmID IN (" + myFrmIDs + ")";
                    if (BP.Sys.SystemConfig.AppCenterDBType == DBType.Oracle)
                    {
                        myFrmIDs  = myFrmIDs.Replace("'", "");
                        sqlOrder += " ORDER BY INSTR('" + myFrmIDs + "',FrmID) , Idx";
                    }

                    if (BP.Sys.SystemConfig.AppCenterDBType == DBType.MSSQL)
                    {
                        myFrmIDs  = myFrmIDs.Replace("'", "");
                        sqlOrder += " ORDER BY CHARINDEX(FrmID, '" + myFrmIDs + "'), Idx";
                    }

                    if (BP.Sys.SystemConfig.AppCenterDBType == DBType.MySQL)
                    {
                        myFrmIDs  = myFrmIDs.Replace("'", "");
                        sqlOrder += " ORDER BY INSTR('" + myFrmIDs + "', FrmID ), Idx";
                    }
                    DataTable dtOrder = DBAccess.RunSQLReturnTable(sqlOrder);

                    //创建容器,把排序的分组放入这个容器.
                    GroupFields gfsNew = new GroupFields();

                    //遍历查询出来的分组.
                    foreach (DataRow dr in dtOrder.Rows)
                    {
                        string pkOID = dr[0].ToString();
                        var    mygf  = gfs.GetEntityByKey(pkOID);
                        gfsNew.AddEntity(mygf); //把分组字段加入里面去.
                    }

                    DataTable dtGF = gfsNew.ToDataTableField("Sys_GroupField");
                    myds.Tables.Remove("Sys_GroupField");
                    myds.Tables.Add(dtGF);
                    #endregion 处理字段分组排序.

                    #region 处理 mapattrs
                    //求当前表单的字段集合.
                    MapAttrs    attrs = new MapAttrs();
                    QueryObject qo    = new QueryObject(attrs);
                    qo.AddWhere(MapAttrAttr.FK_MapData, "ND" + nd.NodeID);
                    qo.addOrderBy(MapAttrAttr.Idx);
                    qo.DoQuery();

                    //计算累加的字段集合.
                    MapAttrs attrsLeiJia = new MapAttrs();
                    qo = new QueryObject(attrsLeiJia);
                    qo.AddWhere(MapAttrAttr.FK_MapData, " IN ", "(" + wk.HisPassedFrmIDs + ")");
                    qo.addOrderBy(MapAttrAttr.Idx);
                    qo.DoQuery();

                    //把两个集合接起来.
                    foreach (MapAttr item in attrsLeiJia)
                    {
                        item.UIIsEnable = false; //设置为只读的.
                        attrs.AddEntity(item);
                    }

                    //替换掉现有的.
                    myds.Tables.Remove("Sys_MapAttr");                      //移除.
                    myds.Tables.Add(attrs.ToDataTableField("Sys_MapAttr")); //增加.
                    #endregion 处理mapattrs

                    #region 把枚举放入里面去.
                    myds.Tables.Remove("Sys_Enum");

                    myFrmIDs = wk.HisPassedFrmIDs + ",'ND" + fk_node + "'";
                    SysEnums enums = new SysEnums();
                    enums.RetrieveInSQL(SysEnumAttr.EnumKey,
                                        "SELECT UIBindKey FROM Sys_MapAttr WHERE FK_MapData in(" + myFrmIDs + ")");

                    // 加入最新的枚举.
                    myds.Tables.Add(enums.ToDataTableField("Sys_Enum"));
                    #endregion 把枚举放入里面去.

                    #region  MapExt .
                    myds.Tables.Remove("Sys_MapExt");

                    // 把扩展放入里面去.
                    myFrmIDs = wk.HisPassedFrmIDs + ",'ND" + fk_node + "'";
                    BP.Sys.MapExts exts = new MapExts();
                    qo = new QueryObject(exts);
                    qo.AddWhere(MapExtAttr.FK_MapData, " IN ", "(" + myFrmIDs + ")");
                    qo.DoQuery();

                    // 加入最新的MapExt.
                    myds.Tables.Add(exts.ToDataTableField("Sys_MapExt"));
                    #endregion  MapExt .
                }
                #endregion 增加 groupfields

                #region 流程设置信息.
                if (nd.IsStartNode == false)
                {
                    BP.WF.Dev2Interface.Node_SetWorkRead(fk_node, workID);

                    // @杜.
                    if (gwf.TodoEmps.Contains(BP.Web.WebUser.Name + ";") == false)
                    {
                        gwf.TodoEmps += BP.Web.WebUser.No + "," + BP.Web.WebUser.Name;
                        gwf.Update();
                    }
                }

                //增加转向下拉框数据.
                if (nd.CondModel == CondModel.SendButtonSileSelect)
                {
                    if (nd.IsStartNode == true || gwf.TodoEmps.Contains(WebUser.No + ",") == true)
                    {
                        /*如果当前不是主持人,如果不是主持人,就不让他显示下拉框了.*/

                        /*如果当前节点,是可以显示下拉框的.*/
                        Nodes nds = nd.HisToNodes;

                        DataTable dtToNDs = new DataTable();
                        dtToNDs.TableName = "ToNodes";
                        dtToNDs.Columns.Add("No", typeof(string));           //节点ID.
                        dtToNDs.Columns.Add("Name", typeof(string));         //到达的节点名称.
                        dtToNDs.Columns.Add("IsSelectEmps", typeof(string)); //是否弹出选择人的对话框?
                        dtToNDs.Columns.Add("IsSelected", typeof(string));   //是否选择?

                        #region 增加到达延续子流程节点。
                        NodeYGFlows ygflows = new NodeYGFlows(fk_node.ToString());
                        if (ygflows.Count > 1 && SystemConfig.CustomerNo.Equals("CZBank") == true)
                        {
                            dtToNDs.Rows.Clear();  //为浙商银行做的特殊判断,如果配置了延续流程,就不让其走分支节点.
                        }
                        foreach (NodeYGFlow item in ygflows)
                        {
                            DataRow dr = dtToNDs.NewRow();
                            dr["No"]   = item.FK_Flow + "01";
                            dr["Name"] = "启动:" + item.FlowName;
                            //if (item.HisDeliveryWay == DeliveryWay.BySelected)
                            dr["IsSelectEmps"] = "1";
                            //else
                            //  dr["IsSelectEmps"] = "0";  //是不是,可以选择接受人.

                            //设置默认选择的节点.
                            //if (defalutSelectedNodeID == item.NodeID)
                            //    dr["IsSelected"] = "1";
                            //else
                            //    dr["IsSelected"] = "0";

                            dr["IsSelected"] = "0";
                            dtToNDs.Rows.Add(dr);
                        }
                        #endregion 增加到达延续子流程节点。

                        #region 到达其他节点.
                        //上一次选择的节点.
                        int defalutSelectedNodeID = 0;
                        if (nds.Count > 1)
                        {
                            string mysql = "";
                            // 找出来上次发送选择的节点.
                            if (SystemConfig.AppCenterDBType == DBType.MSSQL)
                            {
                                mysql = "SELECT  top 1 NDTo FROM ND" + int.Parse(nd.FK_Flow) + "Track A WHERE A.NDFrom=" + fk_node + " AND ActionType=1 ORDER BY WorkID DESC";
                            }
                            else if (SystemConfig.AppCenterDBType == DBType.Oracle)
                            {
                                mysql = "SELECT * FROM ( SELECT  NDTo FROM ND" + int.Parse(nd.FK_Flow) + "Track A WHERE A.NDFrom=" + fk_node + " AND ActionType=1 ORDER BY WorkID DESC ) WHERE ROWNUM =1";
                            }
                            else if (SystemConfig.AppCenterDBType == DBType.MySQL)
                            {
                                mysql = "SELECT  NDTo FROM ND" + int.Parse(nd.FK_Flow) + "Track A WHERE A.NDFrom=" + fk_node + " AND ActionType=1 ORDER BY WorkID  DESC limit 1,1";
                            }

                            //获得上一次发送到的节点.
                            defalutSelectedNodeID = DBAccess.RunSQLReturnValInt(mysql, 0);
                        }

                        #region 为天业集团做一个特殊的判断.
                        if (SystemConfig.CustomerNo == "TianYe" && nd.Name.Contains("董事长") == true)
                        {
                            /*如果是董事长节点, 如果是下一个节点默认的是备案. */
                            foreach (Node item in nds)
                            {
                                if (item.Name.Contains("备案") == true && item.Name.Contains("待") == false)
                                {
                                    defalutSelectedNodeID = item.NodeID;
                                    break;
                                }
                            }
                        }
                        #endregion 为天业集团做一个特殊的判断.


                        foreach (Node item in nds)
                        {
                            DataRow dr = dtToNDs.NewRow();
                            dr["No"]   = item.NodeID;
                            dr["Name"] = item.Name;
                            //if (item.hissel

                            if (item.HisDeliveryWay == DeliveryWay.BySelected)
                            {
                                dr["IsSelectEmps"] = "1";
                            }
                            else
                            {
                                dr["IsSelectEmps"] = "0";  //是不是,可以选择接受人.
                            }
                            //设置默认选择的节点.
                            if (defalutSelectedNodeID == item.NodeID)
                            {
                                dr["IsSelected"] = "1";
                            }
                            else
                            {
                                dr["IsSelected"] = "0";
                            }

                            dtToNDs.Rows.Add(dr);
                        }
                        #endregion 到达其他节点。


                        //增加一个下拉框, 对方判断是否有这个数据.
                        myds.Tables.Add(dtToNDs);
                    }
                }

                // 节点数据.
                //string sql = "SELECT * FROM WF_Node WHERE NodeID=" + fk_node;
                //DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);
                //dt.TableName = "WF_NodeBar";
                //myds.Tables.Add(dt);

                //// 流程数据.
                //Flow fl = new Flow(fk_flow);
                //myds.Tables.Add(fl.ToDataTableField("WF_Flow"));
                #endregion 流程设置信息.

                #region 把主从表数据放入里面.
                //.工作数据放里面去, 放进去前执行一次装载前填充事件.

                //重设默认值.
                wk.ResetDefaultVal();

                //@樊雷伟 把这部分代码搬到jflow上去. CCFlowAPI. 114行出.
                if (BP.Sys.SystemConfig.IsBSsystem == true)
                {
                    // 处理传递过来的参数。
                    foreach (string k in System.Web.HttpContext.Current.Request.QueryString.AllKeys)
                    {
                        if (DataType.IsNullOrEmpty(k) == true)
                        {
                            continue;
                        }

                        wk.SetValByKey(k, System.Web.HttpContext.Current.Request.QueryString[k]);
                    }

                    // 处理传递过来的frm参数。
                    foreach (string k in System.Web.HttpContext.Current.Request.Form.AllKeys)
                    {
                        if (DataType.IsNullOrEmpty(k) == true)
                        {
                            continue;
                        }
                        wk.SetValByKey(k, System.Web.HttpContext.Current.Request.Form[k]);
                    }

                    //更新到数据库里.
                    wk.DirectUpdate();
                }

                // 执行表单事件..
                string msg = md.DoEvent(FrmEventList.FrmLoadBefore, wk);
                if (DataType.IsNullOrEmpty(msg) == false)
                {
                    throw new Exception("err@错误:" + msg);
                }

                // 执行FEE事件.
                string msgOfLoad = nd.HisFlow.DoFlowEventEntity(EventListOfNode.FrmLoadBefore, nd,
                                                                wk, null);
                if (msgOfLoad != null)
                {
                    wk.RetrieveFromDBSources();
                }

                //执行装载填充.
                MapExt me = new MapExt();
                if (me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.PageLoadFull, MapExtAttr.FK_MapData, wk.NodeFrmID) == 1)
                {
                    //执行通用的装载方法.
                    MapAttrs attrs = new MapAttrs(wk.NodeFrmID);
                    MapDtls  dtls  = new MapDtls(wk.NodeFrmID);
                    wk = BP.WF.Glo.DealPageLoadFull(wk, me, attrs, dtls) as Work;
                }

                //如果是累加表单,就把整个rpt数据都放入里面去.
                if (nd.FormType == NodeFormType.FoolTruck && nd.IsStartNode == false &&
                    DataType.IsNullOrEmpty(wk.HisPassedFrmIDs) == false)
                {
                    GERpt rpt = new GERpt("ND" + int.Parse(nd.FK_Flow) + "Rpt", workID); // nd.HisFlow.HisGERpt;
                    rpt.ResetDefaultVal();

                    //rpt.Copy(wk); //加入后就出现了错误.

                    myds.Tables.Add(rpt.ToDataTableField("MainTable"));
                    // myds.WriteXml("C:\\XX.xml");
                }
                else
                {
                    DataTable mainTable = wk.ToDataTableField(md.No);
                    mainTable.TableName = "MainTable";
                    myds.Tables.Add(mainTable);
                }
                string    sql = "";
                DataTable dt  = null;
                #endregion

                #region 把外键表加入DataSet
                DataTable dtMapAttr = myds.Tables["Sys_MapAttr"];
                MapExts   mes       = md.MapExts;
                foreach (DataRow dr in dtMapAttr.Rows)
                {
                    string lgType    = dr["LGType"].ToString();
                    string uiBindKey = dr["UIBindKey"].ToString();

                    if (DataType.IsNullOrEmpty(uiBindKey) == true)
                    {
                        continue; //为空就continue.
                    }
                    if (lgType.Equals("1") == true)
                    {
                        continue; //枚举值就continue;
                    }
                    string uiIsEnable = dr["UIIsEnable"].ToString();
                    if (uiIsEnable.Equals("0") == true && lgType.Equals("1") == true)
                    {
                        continue; //如果是外键,并且是不可以编辑的状态.
                    }
                    if (uiIsEnable.Equals("1") == true && lgType.Equals("0") == true)
                    {
                        continue; //如果是外部数据源,并且是不可以编辑的状态.
                    }
                    // 检查是否有下拉框自动填充。
                    string keyOfEn    = dr["KeyOfEn"].ToString();
                    string fk_mapData = dr["FK_MapData"].ToString();


                    #region 处理下拉框数据范围. for 小杨.
                    me = mes.GetEntityByKey(MapExtAttr.ExtType, MapExtXmlList.AutoFullDLL, MapExtAttr.AttrOfOper, keyOfEn) as MapExt;
                    if (me != null)
                    {
                        string fullSQL = me.Doc.Clone() as string;
                        fullSQL = fullSQL.Replace("~", ",");
                        fullSQL = BP.WF.Glo.DealExp(fullSQL, wk, null);
                        dt      = DBAccess.RunSQLReturnTable(fullSQL);
                        //重构新表
                        DataTable dt_FK_Dll = new DataTable();
                        dt_FK_Dll.TableName = keyOfEn;//可能存在隐患,如果多个字段,绑定同一个表,就存在这样的问题.
                        dt_FK_Dll.Columns.Add("No", typeof(string));
                        dt_FK_Dll.Columns.Add("Name", typeof(string));
                        foreach (DataRow dllRow in dt.Rows)
                        {
                            DataRow drDll = dt_FK_Dll.NewRow();
                            drDll["No"]   = dllRow["No"];
                            drDll["Name"] = dllRow["Name"];
                            dt_FK_Dll.Rows.Add(drDll);
                        }
                        myds.Tables.Add(dt_FK_Dll);
                        continue;
                    }
                    #endregion 处理下拉框数据范围.

                    // 判断是否存在.
                    if (myds.Tables.Contains(uiBindKey) == true)
                    {
                        continue;
                    }

                    if (BP.Sys.PubClass.GetDataTableByUIBineKey(uiBindKey) != null)
                    {
                        myds.Tables.Add(BP.Sys.PubClass.GetDataTableByUIBineKey(uiBindKey));
                    }
                }
                #endregion End把外键表加入DataSet

                #region 处理流程-消息提示.
                DataTable dtAlert = new DataTable();
                dtAlert.TableName = "AlertMsg";

                dtAlert.Columns.Add("Title", typeof(string));
                dtAlert.Columns.Add("Msg", typeof(string));
                dtAlert.Columns.Add("URL", typeof(string));

                //  string msg = "";
                switch (gwf.WFState)
                {
                case WFState.AskForReplay:     // 返回加签的信息.
                    string mysql = "SELECT * FROM ND" + int.Parse(fk_flow) + "Track WHERE WorkID=" + workID + " AND " + TrackAttr.ActionType + "=" + (int)ActionType.ForwardAskfor;

                    DataTable mydt = BP.DA.DBAccess.RunSQLReturnTable(mysql);
                    foreach (DataRow dr in mydt.Rows)
                    {
                        string msgAskFor  = dr[TrackAttr.Msg].ToString();
                        string worker     = dr[TrackAttr.EmpFrom].ToString();
                        string workerName = dr[TrackAttr.EmpFromT].ToString();
                        string rdt        = dr[TrackAttr.RDT].ToString();

                        DataRow drMsg = dtAlert.NewRow();
                        drMsg["Title"] = worker + "," + workerName + "回复信息:";
                        drMsg["Msg"]   = DataType.ParseText2Html(msgAskFor) + "<br>" + rdt;
                        dtAlert.Rows.Add(drMsg);
                    }
                    break;

                case WFState.Askfor:     //加签.

                    sql = "SELECT * FROM ND" + int.Parse(fk_flow) + "Track WHERE WorkID=" + workID + " AND " + TrackAttr.ActionType + "=" + (int)ActionType.AskforHelp;
                    dt  = BP.DA.DBAccess.RunSQLReturnTable(sql);
                    foreach (DataRow dr in dt.Rows)
                    {
                        string msgAskFor  = dr[TrackAttr.Msg].ToString();
                        string worker     = dr[TrackAttr.EmpFrom].ToString();
                        string workerName = dr[TrackAttr.EmpFromT].ToString();
                        string rdt        = dr[TrackAttr.RDT].ToString();

                        DataRow drMsg = dtAlert.NewRow();
                        drMsg["Title"] = worker + "," + workerName + "请求加签:";
                        drMsg["Msg"]   = DataType.ParseText2Html(msgAskFor) + "<br>" + rdt + "<a href='./WorkOpt/AskForRe.htm?FK_Flow=" + fk_flow + "&FK_Node=" + fk_node + "&WorkID=" + workID + "&FID=" + fid + "' >回复加签意见</a> --";
                        dtAlert.Rows.Add(drMsg);

                        //提示信息.
                        // this.FlowMsg.AlertMsg_Info(worker + "," + workerName + "请求加签:",
                        //   DataType.ParseText2Html(msgAskFor) + "<br>" + rdt + " --<a href='./WorkOpt/AskForRe.aspx?FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&WorkID=" + this.WorkID + "&FID=" + this.FID + "' >回复加签意见</a> --");
                    }
                    // isAskFor = true;
                    break;

                case WFState.ReturnSta:
                    /* 如果工作节点退回了*/
                    ReturnWorks rws = new ReturnWorks();
                    rws.Retrieve(ReturnWorkAttr.ReturnToNode, fk_node,
                                 ReturnWorkAttr.WorkID, workID,
                                 ReturnWorkAttr.RDT);

                    if (rws.Count != 0)
                    {
                        //string msgInfo = "";
                        //foreach (BP.WF.ReturnWork rw in rws)
                        //{
                        //    DataRow drMsg = dtAlert.NewRow();
                        //    //drMsg["Title"] = "来自节点:" + rw.ReturnNodeName + " 退回人:" + rw.ReturnerName + "  " + rw.RDT + "&nbsp;<a href='/DataUser/ReturnLog/" + fk_flow + "/" + rw.MyPK + ".htm' target=_blank>工作日志</a>";
                        //    drMsg["Title"] = "来自节点:" + rw.ReturnNodeName + " 退回人:" + rw.ReturnerName + "  " + rw.RDT;
                        //    drMsg["Msg"] = rw.BeiZhuHtml;
                        //    dtAlert.Rows.Add(drMsg);
                        //}

                        string msgInfo = "";
                        foreach (BP.WF.ReturnWork rw in rws)
                        {
                            //drMsg["Title"] = "来自节点:" + rw.ReturnNodeName + " 退回人:" + rw.ReturnerName + "  " + rw.RDT + "&nbsp;<a href='/DataUser/ReturnLog/" + fk_flow + "/" + rw.MyPK + ".htm' target=_blank>工作日志</a>";
                            msgInfo += "\t\n来自节点:" + rw.ReturnNodeName + " 退回人:" + rw.ReturnerName + "  " + rw.RDT;
                            msgInfo += rw.BeiZhuHtml;
                        }

                        string str = nd.ReturnAlert;
                        if (str != "")
                        {
                            str = str.Replace("~", "'");
                            str = str.Replace("@PWorkID", workID.ToString());
                            str = str.Replace("@PNodeID", nd.NodeID.ToString());
                            str = str.Replace("@FK_Node", nd.NodeID.ToString());

                            str = str.Replace("@PFlowNo", fk_flow);
                            str = str.Replace("@FK_Flow", fk_flow);
                            str = str.Replace("@PWorkID", workID.ToString());

                            str = str.Replace("@WorkID", workID.ToString());
                            str = str.Replace("@OID", workID.ToString());

                            DataRow drMsg = dtAlert.NewRow();
                            drMsg["Title"] = "退回信息";
                            drMsg["Msg"]   = msgInfo + "\t\n" + str;
                            dtAlert.Rows.Add(drMsg);
                        }
                        else
                        {
                            DataRow drMsg = dtAlert.NewRow();
                            drMsg["Title"] = "退回信息";
                            drMsg["Msg"]   = msgInfo + "\t\n" + str;
                            dtAlert.Rows.Add(drMsg);
                        }
                    }
                    break;

                case WFState.Shift:
                    /* 判断移交过来的。 */
                    ShiftWorks        fws = new ShiftWorks();
                    BP.En.QueryObject qo  = new QueryObject(fws);
                    qo.AddWhere(ShiftWorkAttr.WorkID, workID);
                    qo.addAnd();
                    qo.AddWhere(ShiftWorkAttr.FK_Node, fk_node);
                    qo.addOrderBy(ShiftWorkAttr.RDT);
                    qo.DoQuery();
                    if (fws.Count >= 1)
                    {
                        DataRow drMsg = dtAlert.NewRow();
                        drMsg["Title"] = "移交历史信息";
                        msg            = "";
                        foreach (ShiftWork fw in fws)
                        {
                            string temp = "@移交人[" + fw.FK_Emp + "," + fw.FK_EmpName + "]。@接受人:" + fw.ToEmp + "," + fw.ToEmpName + "。<br>移交原因:-------------" + fw.NoteHtml;
                            if (fw.FK_Emp == WebUser.No)
                            {
                                temp = "<b>" + temp + "</b>";
                            }

                            temp = temp.Replace("@", "<br>@");
                            msg += temp + "<hr/>";
                        }
                        drMsg["Msg"] = msg;
                        dtAlert.Rows.Add(drMsg);
                    }
                    break;

                default:
                    break;
                }
                #endregion

                #region 增加流程节点表单绑定信息.
                if (nd.HisFormType == NodeFormType.RefOneFrmTree)
                {
                    /* 独立流程节点表单. */

                    nd.WorkID = workID; //为获取表单ID ( NodeFrmID )提供参数.

                    FrmNode fn = new FrmNode();
                    fn.MyPK = nd.NodeFrmID + "_" + nd.NodeID + "_" + nd.FK_Flow;
                    fn.Retrieve();
                    myds.Tables.Add(fn.ToDataTableField("FrmNode"));
                }
                #endregion 增加流程节点表单绑定信息.


                myds.Tables.Add(dtAlert);
                return(myds);
            }
            catch (Exception ex)
            {
                Log.DebugWriteError(ex.StackTrace);
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 20
0
 public Group[] GetByIdSync(
     int[] groupIds ,  GroupFields fields 
 ) {
     var task = _parent.Executor.ExecAsync(
             _parent._reqapi.Groups.GetById(
                 groupIds,fields
             )
         );
     task.Wait();
     return task.Result.Response;
 }
Exemplo n.º 21
0
 public async Task <Group[]> GetById(
     int[] groupIds ,  GroupFields fields 
 ) {
     return (
         await _parent.Executor.ExecAsync(
             _parent._reqapi.Groups.GetById(
                 groupIds,fields
             )
         ).ConfigureAwait(false)
     ).Response;
 }
Exemplo n.º 22
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();

            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();
        }
Exemplo n.º 23
0
    public void InsertDtl()
    {
        string    sql = "SELECT * FROM Sys_MapDtl WHERE FK_MapData LIKE '" + this.MyPK.Replace("Rpt", "") + "%'";
        DataTable dt  = BP.DA.DBAccess.RunSQLReturnTable(sql);

        if (dt.Rows.Count == 0)
        {
            this.WinCloseWithMsg("此流程中没有从表所以您不能插入。");
            return;
        }

        Nodes nds = new Nodes(BP.WF.Glo.GenerFlowNo(this.MyPK));

        this.Pub1.AddTable();
        this.Pub1.AddCaptionLeft("请选择要插入的从表");
        foreach (BP.WF.Node nd in nds)
        {
            if (nd.IsEndNode == false)
            {
                continue;
            }

            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("节点步骤:" + nd.Step + " 节点名称:" + nd.Name);
            this.Pub1.AddTREnd();

            MapDtls dtls = new MapDtls("ND" + nd.NodeID);

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin();

            foreach (MapDtl dtl in dtls)
            {
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + dtl.No;
                cb.Text = dtl.Name;
                this.Pub1.Add(cb);

                #region 字段分组
                DDL ddlGroup = new DDL();
                ddlGroup.ID = "DDL_" + dtl.No;
                GroupFields gfs = new GroupFields(dtl.FK_MapData);
                ddlGroup.Bind(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab);
                this.Pub1.Add("插入位置");
                this.Pub1.Add(ddlGroup);

                //this.Pub1.Add("查询条件:");
                //MapAttrs attrs = new MapAttrs(dtl.No);
                //foreach (MapAttr attr in attrs)
                //{
                //    if (attr.UIContralType != UIContralType.DDL)
                //        continue;
                //    cb = new CheckBox();
                //    cb.ID = "CB_" + dtl.No + "_" + attr.KeyOfEn;
                //    cb.Text = attr.Name;
                //    this.Pub1.Add(cb);
                //}
                #endregion 字段分组
            }

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

        this.Pub1.AddTRSum();
        Button btn = new Button();
        btn.ID       = "Btn_Save";
        btn.Text     = "插入到报表";
        btn.CssClass = "Btn";
        btn.Click   += new EventHandler(btn_Click);
        this.Pub1.AddTD(btn);
        this.Pub1.AddTREnd();
        this.Pub1.AddTableEnd();
    }
Exemplo n.º 24
0
        void btn_Click(object sender, EventArgs e)
        {
            FrmAttachment ath = new FrmAttachment();

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

            ath.RetrieveFromDBSources();

            Button btn = sender as Button;

            if (btn.ID == "Btn_Delete")
            {
                //ath.MyPK = this.FK_MapData + "_" + this.Ath;
                ath.Delete();
                this.WinClose("删除成功.");
                return;
            }

            ath.MyPK = this.FK_MapData + "_" + this.Ath;
            if (this.Ath != null)
            {
                ath.RetrieveFromDBSources();
            }
            ath            = this.Pub1.Copy(ath) as FrmAttachment;
            ath.FK_MapData = this.FK_MapData;
            ath.FK_Node    = this.FK_Node;
            if (string.IsNullOrEmpty(this.Ath) == false)
            {
                ath.NoOfObj = this.Ath;
            }

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

            GroupFields gfs1 = new GroupFields(this.FK_MapData);

            if (gfs1.Count == 1)
            {
                GroupField gf = (GroupField)gfs1[0];
                ath.GroupID = gf.OID;
            }
            else
            {
                ath.GroupID = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemIntVal;
            }

            //对流程的特殊判断.  20160513 加载页面时添加了判断,此处没有添加,导致保存报错。 zqp
            if (ath.IsNodeSheet == true)
            {
                ath.HisCtrlWay     = (AthCtrlWay)this.Pub1.GetDDLByID("DDL_CtrlWay").SelectedItemIntVal;
                ath.AthUploadWay   = (AthUploadWay)this.Pub1.GetDDLByID("DDL_AthUploadWay").SelectedItemIntVal;
                ath.FileShowWay    = (FileShowWay)this.Pub1.GetDDLByID("DDL_FileShowWay").SelectedItemIntVal;     //文件展现方式.
                ath.UploadCtrl     = this.Pub1.GetDDLByID("DDL_UploadCtrl").SelectedItemIntVal;                   //使用的附件上传工具.
                ath.SaveWay        = this.Pub1.GetDDLByID("DDL_" + FrmAttachmentAttr.SaveWay).SelectedItemIntVal; //保存方式.
                ath.IsHeLiuHuiZong = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsHeLiuHuiZong).Checked;       //是否是合流节点汇总.
                ath.IsToHeLiuHZ    = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsToHeLiuHZ).Checked;          //是否汇总到合流节点..
            }


            //word附件相关.
            ath.IsWoEnableWF             = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableWF).Checked;
            ath.IsWoEnableSave           = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableSave).Checked;
            ath.IsWoEnableReadonly       = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableReadonly).Checked;
            ath.IsWoEnableRevise         = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableRevise).Checked;
            ath.IsWoEnableViewKeepMark   = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableViewKeepMark).Checked;
            ath.IsWoEnablePrint          = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnablePrint).Checked;
            ath.IsWoEnableSeal           = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableSeal).Checked;
            ath.IsWoEnableOver           = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableOver).Checked;
            ath.IsWoEnableTemplete       = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableTemplete).Checked;
            ath.IsWoEnableCheck          = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableCheck).Checked;
            ath.IsWoEnableInsertFengXian = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableInsertFengXian).Checked;
            ath.IsWoEnableInsertFlow     = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableInsertFlow).Checked;
            ath.IsWoEnableMarks          = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableMarks).Checked;
            ath.IsWoEnableDown           = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableDown).Checked;

            ath.IsVisable = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsVisable).Checked; //是否可见.


            ath.FastKeyIsEnable  = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.FastKeyIsEnable).Checked;
            ath.FastKeyGenerRole = this.Pub1.GetTBByID("TB_" + FrmAttachmentAttr.FastKeyGenerRole).Text;


            ath.IsOrder = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsOrder).Checked;

            if (ath.FastKeyIsEnable == true)
            {
                if (ath.FastKeyGenerRole.Contains("*OID") == false)
                {
                    throw new Exception("@快捷键生成规则必须包含*OID,否则会导致文件名重复.");
                }
            }

            if (this.Ath == null)
            {
                ath.UploadType = (AttachmentUploadType)int.Parse(this.UploadType);

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

                if (ath.IsExits == true)
                {
                    this.Alert("附件编号(" + ath.NoOfObj + ")已经存在。");
                    return;
                }
                ath.Insert();
            }
            else
            {
                ath.NoOfObj = this.Ath;
                if (this.FK_Node == 0)
                {
                    ath.MyPK = this.FK_MapData + "_" + this.Ath;
                }
                else
                {
                    ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node;
                }

                ath.Update();
            }
            this.WinCloseWithMsg("保存成功");
        }
Exemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FrmAttachment ath = new FrmAttachment();

            ath.MyPK = this.FK_MapData + "_" + this.Ath;
            if (this.Ath != null)
            {
                ath.RetrieveFromDBSources();
            }

            ath.FK_MapData = this.FK_MapData;
            ath.NoOfObj    = this.Ath;
            ath.MyPK       = this.FK_MapData + "_" + this.Ath;

            //this.Response.Write(this.Ath);
            //this.Response.Write("  -- "+this.FK_MapData);

            this.Title = "附件属性设置";

            this.Pub1.AddTable();
            //this.Pub1.AddCaptionLeft("附件");
            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_" + 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.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.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.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.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.AddTD("colspan=3", "帮助:类别可以为空,设置的格式为:类别名1,类别名2,类别名3");
            this.Pub1.AddTREnd();

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

            cb.ID      = "CB_" + FrmAttachmentAttr.IsDownload;
            cb.Text    = "是否可下载";
            cb.Checked = ath.IsDownload;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsDelete;
            cb.Text    = "是否可删除";
            cb.Checked = ath.IsDelete;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

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

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



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

            GroupFields gfs = new GroupFields(ath.FK_MapData);

            this.Pub1.AddTR1();
            this.Pub1.AddTD("显示在分组");
            BP.Web.Controls.DDL 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=2", ddl);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            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();
            this.Pub1.AddTableEnd();
        }
        public void EditBeforeEnd(MapAttr mapAttr)
        {
            #region 合并单元格数
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("合并单元格数");
            DDL ddl1 = new DDL();
            ddl1.ID = "DDL_ColSpan";
            for (int i = 1; i < 12; i++)
            {
                ddl1.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
            ddl1.SetSelectItem(mapAttr.ColSpan.ToString());
            this.Pub1.AddTD(ddl1);

            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("colspan=3", ddlGroup);
            this.Pub1.AddTREnd();
            #endregion 字段分组

            #region 是否是数字签名字段
            if (mapAttr.UIIsEnable == false && mapAttr.MyDataType == DataType.AppString && mapAttr.LGType == FieldTypeS.Normal)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);

                DDL ddl = new DDL();
                ddl.ID = "DDL_SignType";
                ddl.Items.Add(new ListItem("无", "0"));
                ddl.Items.Add(new ListItem("图片签名", "1"));
                ddl.Items.Add(new ListItem("CA签名", "2"));
                ddl.SetSelectItem((int)mapAttr.SignType);


                //CheckBox cb = new CheckBox();
                //cb.ID = "CB_IsSigan";
                //cb.Text = "是否是数字签名字段";
                //cb.Checked = mapAttr.IsSigan;

                this.Pub1.AddTD("colspan=2", ddl);
                if (mapAttr.SignType == SignType.CA)
                {
                    TB sigan = new TB();
                    sigan.ID   = "TB_SiganField";
                    sigan.Text = mapAttr.Para_SiganField;
                    this.Pub1.AddTD(sigan);
                }
                else if (mapAttr.SignType == SignType.Pic)
                {
                    DDL ddlPic = new DDL();
                    ddlPic.ID = "DDL_PicType";
                    ddlPic.Items.Add(new ListItem("自动签名", "0"));
                    ddlPic.Items.Add(new ListItem("手动签名", "1"));
                    ddlPic.SetSelectItem((int)mapAttr.PicType);
                    this.Pub1.AddTD(ddlPic);
                }
                else
                {
                    this.Pub1.AddTD();
                }
                this.Pub1.AddTREnd();
            }
            #endregion 字段分组


            #region 字段分组
            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字体大小");

            DDL ddlFont = new DDL();
            ddlFont.ID = "DDL_FontSize";
            ddlFont.Items.Add(new ListItem("默认", "0"));
            for (int i = 10; i < 28; i++)
            {
                ddlFont.Items.Add(new ListItem(i + "px", i.ToString()));
            }

            ddlFont.SetSelectItem(mapAttr.Para_FontSize);
            this.Pub1.AddTD("colspan=3", ddlFont);
            this.Pub1.AddTREnd();
            #endregion 字段分组


            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD 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.ID       = "Btn_SaveAndClose";
            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_SaveAndNew";
            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.Text ="扩展设置";
                //btn.Attributes["onclick"] = "javascript:WinOpen('AutoFull.aspx?RefNo=" + this.RefNo + "&FK_MapData=" + mapAttr.FK_MapData + "',''); return false;";

                this.Pub1.Add("<input type=button class=Btn value='扩展设置' onclick=\"javascript:WinOpen('AutoFull.aspx?RefNo=" + this.RefNo + "&FK_MapData=" + mapAttr.FK_MapData + "',''); return false;\" />");

                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;
            btn          = new Button();
            btn.ID       = "Btn_New";
            btn.CssClass = "Btn";
            btn.Text     = "新建";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_Back";
            btn.CssClass = "Btn";
            btn.Text     = "返回";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithBR();
        }
Exemplo n.º 27
0
    public void SelectColumns()
    {
        this.Pub2.AddH2("请选择要显示的字段,然后点保存按钮,系统的查询列表就以您设计的体现.");
        this.Pub2.AddHR();

        this.Pub2.AddTable("width=90% align=left");
        GroupFields gfs         = new GroupFields(this.FK_Flow);
        MapAttrs    mattrs      = new MapAttrs(this.FK_MapData);
        MapData     md          = new MapData(this.FK_MapData);
        bool        isBr        = false;
        string      attrInTable = md.AttrsInTable;

        foreach (GroupField gf in gfs)
        {
            this.Pub2.AddTR();
            this.Pub2.AddTDTitle(gf.Lab);
            this.Pub2.AddTREnd();

            this.Pub2.AddTR();
            this.Pub2.AddTDBigDocBegain();

            this.Pub2.AddTable("width=100% border=0");
            isBr = false;
            foreach (MapAttr attr in mattrs)
            {
                if (attr.GroupID != gf.OID)
                {
                    continue;
                }

                CheckBox cb = new CheckBox();
                cb.ID      = "CB_" + attr.KeyOfEn;
                cb.Text    = attr.Name + "(" + attr.KeyOfEn + ")";
                cb.Checked = attrInTable.Contains("@" + attr.KeyOfEn + "=");

                if (isBr == false)
                {
                    this.Pub2.AddTR();
                }
                this.Pub2.AddTD(cb);
                if (isBr)
                {
                    this.Pub2.AddTREnd();
                }

                isBr = !isBr;
            }
            this.Pub2.AddTableEnd();


            this.Pub2.AddTDEnd();
            this.Pub2.AddTREnd();
        }
        this.Pub2.AddTR();
        this.Pub2.AddTDTitle("未分组");
        this.Pub2.AddTREnd();
        this.Pub2.AddTR();
        this.Pub2.AddTDBigDocBegain();

        this.Pub2.AddTable("width=100% border=0");
        isBr = false;
        foreach (MapAttr attr in mattrs)
        {
            if (gfs.Contains(attr.GroupID))
            {
                continue;
            }

            CheckBox cb = new CheckBox();
            cb.ID   = "CB_" + attr.KeyOfEn;
            cb.Text = attr.Name + "(" + attr.KeyOfEn + ")";

            cb.Checked = attrInTable.Contains("@" + attr.KeyOfEn + "=");

            if (isBr == false)
            {
                this.Pub2.AddTR();
            }
            this.Pub2.AddTD(cb);
            if (isBr)
            {
                this.Pub2.AddTREnd();
            }

            isBr = !isBr;
        }
        this.Pub2.AddTableEnd();

        this.Pub2.AddTDEnd();
        this.Pub2.AddTREnd();


        this.Pub2.AddTRSum();
        this.Pub2.AddTDBegin();

        Button btn = new Button();

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

        this.Pub2.AddTDEnd();
        this.Pub2.AddTREnd();
        this.Pub2.AddTableEnd();
    }
Exemplo n.º 28
0
        public void EditBeforeEnd(MapAttr mapAttr)
        {
            #region 合并单元格数
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("合并单元格数");
            DDL ddl1 = new DDL();
            ddl1.ID = "DDL_ColSpan";
            for (int i = 1; i < 12; i++)
            {
                ddl1.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
            ddl1.SetSelectItem(mapAttr.ColSpan.ToString());
            this.Pub1.AddTD(ddl1);

            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("colspan=3", ddlGroup);
            this.Pub1.AddTREnd();
            #endregion 字段分组

            #region 是否是数字签名字段
            if (mapAttr.UIIsEnable == false && mapAttr.MyDataType == DataType.AppString && mapAttr.LGType == FieldTypeS.Normal)
            {
                isItem = this.Pub1.AddTR(isItem);
                this.Pub1.AddTDIdx(idx++);

                this.Pub1.AddTD("签名模式");

                DDL ddl = new DDL();
                ddl.ID = "DDL_SignType";
                ddl.Items.Add(new ListItem("无", "0"));
                ddl.Items.Add(new ListItem("图片签名", "1"));
                ddl.Items.Add(new ListItem("山东CA签名", "2"));
                ddl.Items.Add(new ListItem("广东CA签名", "3"));

                ddl.SetSelectItem((int)mapAttr.SignType);

                this.Pub1.AddTD(ddl);
                if (mapAttr.SignType == SignType.CA)
                {
                    TB sigan = new TB();
                    sigan.ID   = "TB_SiganField";
                    sigan.Text = mapAttr.Para_SiganField;
                    this.Pub1.AddTD(sigan);
                }
                else
                if (mapAttr.SignType == SignType.GDCA)
                {
                    TB sigan = new TB();
                    sigan.ID   = "TB_SiganField";
                    sigan.Text = mapAttr.Para_SiganField;
                    this.Pub1.AddTD(sigan);
                }
                else if (mapAttr.SignType == SignType.Pic)
                {
                    DDL ddlPic = new DDL();
                    ddlPic.ID = "DDL_PicType";
                    ddlPic.Items.Add(new ListItem("自动签名", "0"));
                    ddlPic.Items.Add(new ListItem("手动签名", "1"));
                    ddlPic.SetSelectItem((int)mapAttr.PicType);
                    this.Pub1.AddTD(ddlPic);
                }
                else
                {
                    this.Pub1.AddTD();
                }
                this.Pub1.AddTREnd();
            }
            #endregion 字段分组

            #region 字段分组
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("字体大小");

            DDL ddlFont = new DDL();
            ddlFont.ID = "DDL_FontSize";
            ddlFont.Items.Add(new ListItem("默认", "0"));
            for (int i = 10; i < 28; i++)
            {
                ddlFont.Items.Add(new ListItem(i + "px", i.ToString()));
            }

            ddlFont.SetSelectItem(mapAttr.Para_FontSize);
            this.Pub1.AddTD(ddlFont);


            //是否必填字段.
            this.Pub1.Add("<TD>");
            RadioButton rb = new RadioButton();
            rb.ID        = "RB_UIIsInput_0";
            rb.Text      = "非必填字段";
            rb.GroupName = "si";
            rb.Checked   = !mapAttr.UIIsInput;

            this.Pub1.Add(rb);
            rb           = new RadioButton();
            rb.ID        = "RB_UIIsInput_1";
            rb.Text      = "必填";
            rb.GroupName = "si";
            rb.Checked   = mapAttr.UIIsInput;
            this.Pub1.Add(rb);
            this.Pub1.Add("</TD>");

            this.Pub1.AddTREnd();
            #endregion 字段分组

            #region 扩展设置.
            if (this.RefNo != null)
            {
                isItem = this.Pub1.AddTR(isItem);
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("<a href=\"javascript:WinOpen('./MapExt/PopVal.aspx?FK_MapData=" + mapAttr.FK_MapData + "&RefNo=" + mapAttr.KeyOfEn + "&MyPK=" + MapExtXmlList.PopVal + "_" + mapAttr.MyPK + "')\">设置开窗返回值</a>");
                string html = "<a href=\"javascript:WinOpen('./MapExt/RegularExpression.aspx?FK_MapData=" + mapAttr.FK_MapData + "&RefNo=" + mapAttr.KeyOfEn + "&OperAttrKey=" + mapAttr.MyPK + "')\">正则表达式</a>";
                html += " - <a href=\"javascript:WinOpen('./MapExt/TBFullCtrl.aspx?FK_MapData=" + mapAttr.FK_MapData + "&RefNo=" + mapAttr.KeyOfEn + "&MyPK=" + mapAttr.FK_MapData + "_" + MapExtXmlList.TBFullCtrl + "_" + mapAttr.KeyOfEn + "')\">文本框自动完成</a>";
                html += " - <a href=\"javascript:WinOpen('./MapExt/AotuGenerNo.aspx?FK_MapData=" + mapAttr.FK_MapData + "&RefNo=" + mapAttr.KeyOfEn + "')\">自动生成编号</a>";

                this.Pub1.AddTD(html);
                //this.Pub1.AddTD("<a href=\"javascript:WinOpen('./MapExt/AutoFull.aspx?FK_MapData=" + mapAttr.FK_MapData + "&ExtType=AutoFull&RefNo=" + mapAttr.MyPK + "')\">自动计算</a>");
                html  = "<a href=\"javascript:WinOpen('./MapExt/AutoFull.aspx?FK_MapData=" + mapAttr.FK_MapData + "&ExtType=AutoFull&RefNo=" + mapAttr.MyPK + "')\">自动计算</a>";
                html += " - <a href=\"javascript:WinOpen('./MapExt/InputCheck.aspx?FK_MapData=" + mapAttr.FK_MapData + "&RefNo=" + mapAttr.MyPK + "')\">脚本验证</a>";
                this.Pub1.AddTD(html);
                this.Pub1.AddTREnd();
            }
            #endregion pop返回值.


            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD 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.ID       = "Btn_SaveAndClose";
            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_SaveAndNew";
            btn.Text     = "保存新建"; // "保存新建";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            if (this.RefNo != null)
            {
                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;
            btn          = new Button();
            btn.ID       = "Btn_New";
            btn.CssClass = "Btn";
            btn.Text     = "新建";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_Back";
            btn.CssClass = "Btn";
            btn.Text     = "返回";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithBR();
        }
Exemplo n.º 29
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();
        }
Exemplo n.º 30
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            try
            {
                switch (this.DoType)
                {
                case "New":
                default:
                    MapDtl dtlN = new MapDtl();
                    dtlN = (MapDtl)this.Pub1.Copy(dtlN);
                    try
                    {
                        dtlN.GroupField = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemStringVal;
                    }
                    catch
                    {
                    }

                    if (this.DoType == "New")
                    {
                        if (dtlN.IsExits)
                        {
                            this.Alert("已存在编号:" + dtlN.No);
                            return;
                        }
                    }
                    dtlN.FK_MapData = this.FK_MapData;
                    dtlN.GroupID    = 0;
                    dtlN.RowIdx     = 0;

                    // 参数属性.
                    dtlN.DtlSaveModel   = (DtlSaveModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlSaveModel).SelectedItemIntVal;
                    dtlN.DtlAddRecModel = (DtlAddRecModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlAddRecModel).SelectedItemIntVal;

                    GroupFields gfs1 = new GroupFields(this.FK_MapData);
                    if (gfs1.Count == 1)
                    {
                        GroupField gf = (GroupField)gfs1[0];
                        dtlN.GroupID = gf.OID;
                    }
                    else
                    {
                        dtlN.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal;
                    }
                    dtlN.Insert();
                    if (btn.ID.Contains("AndClose"))
                    {
                        this.WinClose();
                        return;
                    }
                    this.Response.Redirect("MapDtl.aspx?DoType=Edit&FK_MapDtl=" + dtlN.No + "&FK_MapData=" + this.FK_MapData, true);
                    break;

                case "Edit":
                    MapDtl dtl = new MapDtl(this.FK_MapDtl);
                    dtl = (MapDtl)this.Pub1.Copy(dtl);

                    //参数保存.
                    dtl.IsEnableLink = this.Pub1.GetCBByID("CB_" + MapDtlAttr.IsEnableLink).Checked;

                    //手动保存,added by liuxc,2016-4-7
                    dtl.DtlSaveModel   = (DtlSaveModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlSaveModel).SelectedItemIntVal;
                    dtl.DtlAddRecModel = (DtlAddRecModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlAddRecModel).SelectedItemIntVal;


                    if (this.FK_Node != 0)
                    {
                        //是否是分流. add 2015-06-30.
                        dtl.IsFLDtl = this.Pub1.GetCBByID("CB_" + MapDtlAttr.IsFLDtl).Checked;

                        //子线程处理字段.
                        if (this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadGroupMark).Items.Count > 0)
                        {
                            dtl.SubThreadGroupMark = this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadGroupMark).SelectedItemStringVal;
                        }

                        if (this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadWorker).Items.Count > 0)
                        {
                            dtl.SubThreadWorker = this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadWorker).SelectedItemStringVal;
                        }
                    }


                    dtl.LinkLabel  = this.Pub1.GetTBByID("TB_" + MapDtlAttr.LinkLabel).Text;
                    dtl.LinkTarget = this.Pub1.GetTBByID("TB_" + MapDtlAttr.LinkTarget).Text;
                    dtl.LinkUrl    = this.Pub1.GetTBByID("TB_" + MapDtlAttr.LinkUrl).Text;

                    //锁定.
                    dtl.IsRowLock = this.Pub1.GetCBByID("CB_" + MapDtlAttr.IsRowLock).Checked;

                    //分组字段。
                    try
                    {
                        dtl.GroupField = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemStringVal;
                    }
                    catch
                    {
                    }

                    if (this.DoType == "New")
                    {
                        if (dtl.IsExits)
                        {
                            this.Alert("已存在编号:" + dtl.No);
                            return;
                        }
                    }

                    dtl.FK_MapData = this.FK_MapData;
                    GroupFields gfs = new GroupFields(dtl.FK_MapData);
                    if (gfs.Count > 1)
                    {
                        dtl.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal;
                    }

                    if (dtl.IsEnableAthM)
                    {
                        /*如果启用了多附件.*/
                        FrmAttachment ath = new FrmAttachment();
                        ath.MyPK       = dtl.No + "_AthMDtl";
                        ath.FK_MapData = dtl.No;
                        ath.NoOfObj    = "AthMDtl";
                        ath.Name       = "从表行记录附件";
                        if (ath.RetrieveFromDBSources() == 0)
                        {
                            ath.Insert();
                        }
                    }

                    if (this.DoType == "New")
                    {
                        dtl.Insert();
                    }
                    else
                    {
                        dtl.Update();
                    }

                    if (btn.ID.Contains("AndC"))
                    {
                        this.WinClose();
                        return;
                    }
                    this.Response.Redirect("MapDtl.aspx?DoType=Edit&FK_MapDtl=" + dtl.No + "&FK_MapData=" + this.FK_MapData, true);
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Alert(ex.Message);
            }
        }
        public void BindTable(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();

            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("字段英文名"); // "字段英文名称"
            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.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("外键表/类"); // 字段中文名称
            tb      = new TB();
            tb.ID   = "TB_UIBindKey";
            tb.Text = mapAttr.UIBindKey;
            tb.Attributes["width"] = "100%";
            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_DefVal";
            tb.Text = mapAttr.Name;
            tb.Attributes["width"] = "100%";
            tb.Text = mapAttr.DefValReal;
            this.Pub1.AddTD(tb);

            //DDL ddl = new DDL();
            //ddl.ID = "DDL";
            //ddl.BindEntities(mapAttr.HisEntitiesNoName);
            //ddl.SetSelectItem(mapAttr.DefVal);
            //   this.Pub1.AddTD(ddl);
            // this.Pub1.AddTD(ddl);

            if (mapAttr.UIBindKey.Contains("."))
            {
                this.Pub1.AddTD("<a href=\"javascript:WinOpen('../Comm/Search.aspx?EnsName=" + mapAttr.UIBindKey + "','df');\" >打开</a>");
            }
            else
            {
                this.Pub1.AddTD("<a href=\"javascript:WinOpen('../MapDef/SFTableEditData.aspx?RefNo=" + mapAttr.UIBindKey + "','df');\" >打开</a>");
            }
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("是否可编辑");
            this.Pub1.Add("<TD>");
            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();

            #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.AddTR1();
            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.AddTR();
            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("colspan=2", ddlGroup);
            this.Pub1.AddTD();  //( this.to "隶属分组");
            this.Pub1.AddTREnd();
            #endregion 字段分组

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

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose1";
            btn.CssClass = "Btn";
            btn.Text     = "关闭";
            btn.Attributes["onclick"] = " window.close(); return false;";
            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 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.AddTableEnd();
            #endregion 字段按钮
        }
Exemplo n.º 32
0
 /// <summary>Возвращает список групп указанного пользователя.</summary>
 /// <param name="uid">ID пользователя, группы которого необходимо получить</param>
 /// <param name="extended">Если указать в качестве этого параметра 1, то будет возвращена полная информация о группах пользователя</param>
 /// <param name="filter">Список фильтров сообществ, которые необходимо вернуть, перечисленные через запятую</param>
 /// <param name="fields">Список полей из информации о группах, которые необходимо получить</param>
 /// <param name="offset">Смещение, необходимое для выборки определённого подмножества групп</param>
 /// <param name="count">Количество записей которое необходимо вернуть, не более 1000</param>
 /// <returns>Ответ сервера в XML или JSON формате.</returns>
 private VKResponseBase get(System.Int64? uid, System.Boolean? extended, GroupsFilter? filter, GroupFields? fields, System.Int32? offset, System.Int32? count)
 {
     manager.AddValueByName("@uid", uid);
     manager.AddValueByName("@extended", extended);
     manager.AddValueByName("@filter", filter);
     manager.AddValueByName("@fields", fields);
     manager.AddValueByName("@offset", offset);
     manager.AddValueByName("@count", count);
     return new VKResponseBase(GetResponse("get"), IsXMLResponse);
 }
Exemplo n.º 33
0
        /// <summary>
        /// 执行旧版本的兼容性检查.
        /// </summary>
        public string DoCheckFixFrmForUpdateVer()
        {
            // 更新状态.
            DBAccess.RunSQL("UPDATE Sys_GroupField SET CtrlType='' WHERE CtrlType IS NULL");
            DBAccess.RunSQL("UPDATE Sys_GroupField SET CtrlID='' WHERE CtrlID IS NULL");
            DBAccess.RunSQL("UPDATE Sys_GroupField SET CtrlID='' WHERE CtrlID IS NULL");

            //删除重影数据.
            DBAccess.RunSQL("DELETE FROM Sys_GroupField WHERE CtrlType='FWC' and CTRLID is null");



            //一直遇到遇到自动变长的问题, 强制其修复过来.
            DBAccess.RunSQL("UPDATE Sys_Mapattr SET colspan=3 WHERE UIHeight<=38 AND colspan=4");

            string str = "";

            //处理失去分组的字段.
            string   sql   = "SELECT MyPK FROM Sys_MapAttr WHERE FK_MapData='" + this.No + "' AND GroupID NOT IN (SELECT OID FROM Sys_GroupField WHERE FrmID='" + this.No + "' AND ( CtrlType='' OR CtrlType IS NULL)  )  OR GroupID IS NULL ";
            MapAttrs attrs = new MapAttrs();

            attrs.RetrieveInSQL(sql);
            if (attrs.Count != 0)
            {
                GroupField  gf  = null;
                GroupFields gfs = new GroupFields(this.No);
                foreach (GroupField mygf in gfs)
                {
                    if (mygf.CtrlID == "")
                    {
                        gf = mygf;
                    }
                }

                if (gf == null)
                {
                    gf       = new GroupField();
                    gf.Lab   = "基本信息";
                    gf.FrmID = this.No;
                    gf.Insert();
                }

                //设置GID.
                foreach (MapAttr attr in attrs)
                {
                    attr.Update(MapAttrAttr.GroupID, gf.OID);
                }
            }

            //从表.
            MapDtls dtls = new MapDtls(this.No);

            foreach (MapDtl dtl in dtls)
            {
                GroupField gf = new GroupField();
                int        i  = gf.Retrieve(GroupFieldAttr.CtrlID, dtl.No, GroupFieldAttr.FrmID, this.No);
                if (i == 1)
                {
                    continue;
                }

                //GroupField gf = new GroupField();
                //if (gf.IsExit(GroupFieldAttr.CtrlID, dtl.No) == true && !DataType.IsNullOrEmpty(gf.CtrlType))
                //    continue;

                gf.Lab      = dtl.Name;
                gf.CtrlID   = dtl.No;
                gf.CtrlType = "Dtl";
                gf.FrmID    = dtl.FK_MapData;
                gf.DirectSave();
                str += "@为从表" + dtl.Name + " 增加了分组.";
            }

            // 框架.
            MapFrames frams = new MapFrames(this.No);

            foreach (MapFrame fram in frams)
            {
                GroupField gf = new GroupField();
                int        i  = gf.Retrieve(GroupFieldAttr.CtrlID, fram.MyPK, GroupFieldAttr.FrmID, this.No);
                if (i == 1)
                {
                    continue;
                }

                gf.Lab      = fram.Name;
                gf.CtrlID   = fram.MyPK;
                gf.CtrlType = "Frame";
                gf.EnName   = fram.FK_MapData;
                gf.Insert();

                str += "@为框架 " + fram.Name + " 增加了分组.";
            }

            // 附件.
            FrmAttachments aths = new FrmAttachments(this.No);

            foreach (FrmAttachment ath in aths)
            {
                if (ath.IsVisable == false)
                {
                    continue;
                }

                GroupField gf = new GroupField();
                int        i  = gf.Retrieve(GroupFieldAttr.CtrlID, ath.MyPK, GroupFieldAttr.FrmID, this.No);
                if (i == 1)
                {
                    continue;
                }

                gf.Lab      = ath.Name;
                gf.CtrlID   = ath.MyPK;
                gf.CtrlType = "Ath";
                gf.FrmID    = ath.FK_MapData;
                gf.Insert();

                str += "@为附件 " + ath.Name + " 增加了分组.";
            }

            if (this.IsNodeFrm == true)
            {
                FrmNodeComponent conn = new FrmNodeComponent(this.NodeID);
                conn.Update();
            }


            //删除重复的数据, 比如一个从表显示了多个分组里. 增加此部分.
            if (SystemConfig.AppCenterDBType == DBType.Oracle)
            {
                sql = "SELECT * FROM (SELECT FrmID,CtrlID,CtrlType, count(*) as Num FROM sys_groupfield WHERE CtrlID!='' GROUP BY FrmID,CtrlID,CtrlType ) WHERE Num > 1";
            }
            else
            {
                sql = "SELECT * FROM (SELECT FrmID,CtrlID,CtrlType, count(*) as Num FROM sys_groupfield WHERE CtrlID!='' GROUP BY FrmID,CtrlID,CtrlType ) AS A WHERE A.Num > 1";
            }

            DataTable dt = DBAccess.RunSQLReturnTable(sql);

            foreach (DataRow dr in dt.Rows)
            {
                string enName   = dr[0].ToString();
                string ctrlID   = dr[1].ToString();
                string ctrlType = dr[2].ToString();

                GroupFields gfs = new GroupFields();
                gfs.Retrieve(GroupFieldAttr.FrmID, enName, GroupFieldAttr.CtrlID, ctrlID, GroupFieldAttr.CtrlType, ctrlType);

                if (gfs.Count <= 1)
                {
                    continue;
                }
                foreach (GroupField gf in gfs)
                {
                    gf.Delete(); //删除其中的一个.
                    break;
                }
            }



            if (str == "")
            {
                return("检查成功.");
            }

            return(str + ", @@@ 检查成功。");
        }
Exemplo n.º 34
0
 /// <summary>Возвращает информацию о заданной группе или о нескольких группах.</summary>
 /// <param name="gids">ID групп, перечисленные через запятую, информацию о которых необходимо получить</param>
 /// <param name="fields">Список полей из информации о группах, которые необходимо получить</param>
 /// <returns>Ответ сервера в XML или JSON формате.</returns>
 private VKResponseBase getById(IdList gids, GroupFields? fields)
 {
     manager.AddValueByName("@gids", gids);
     manager.AddValueByName("@fields", fields);
     return new VKResponseBase(GetResponse("getById"), IsXMLResponse);
 }
Exemplo n.º 35
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();
        }
Exemplo n.º 36
0
 /// <summary>Возвращает список групп указанного пользователя.</summary>
 /// <param name="extended">Если указать в качестве этого параметра 1, то будет возвращена полная информация о группах пользователя</param>
 /// <param name="filter">Список фильтров сообществ, которые необходимо вернуть, перечисленные через запятую</param>
 /// <param name="fields">Список полей из информации о группах, которые необходимо получить</param>
 /// <returns>Ответ сервера в XML или JSON формате.</returns>
 public VKResponseBase Get(bool? extended = null, GroupsFilter? filter = null, GroupFields? fields = null)
 {
     return get(null, extended, filter, fields, null, null);
 }
Exemplo n.º 37
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            try
            {
                switch (this.DoType)
                {
                case "New":
                default:
                    MapDtl dtlN = new MapDtl();
                    dtlN = (MapDtl)this.Pub1.Copy(dtlN);
                    if (this.DoType == "New")
                    {
                        if (dtlN.IsExits)
                        {
                            this.Alert("已存在编号:" + dtlN.No);
                            return;
                        }
                    }
                    dtlN.FK_MapData = this.FK_MapData;
                    dtlN.GroupID    = 0;
                    dtlN.RowIdx     = 0;
                    GroupFields gfs1 = new GroupFields(this.FK_MapData);
                    if (gfs1.Count == 1)
                    {
                        GroupField gf = (GroupField)gfs1[0];
                        dtlN.GroupID = gf.OID;
                    }
                    else
                    {
                        dtlN.GroupID = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemIntVal;
                    }
                    dtlN.Insert();
                    if (btn.ID.Contains("AndClose"))
                    {
                        this.WinClose();
                        return;
                    }
                    this.Response.Redirect("MapDtl.aspx?DoType=Edit&FK_MapDtl=" + dtlN.No + "&FK_MapData=" + this.FK_MapData, true);
                    break;

                case "Edit":
                    MapDtl dtl = new MapDtl(this.FK_MapDtl);
                    dtl = (MapDtl)this.Pub1.Copy(dtl);
                    if (this.DoType == "New")
                    {
                        if (dtl.IsExits)
                        {
                            this.Alert("已存在编号:" + dtl.No);
                            return;
                        }
                    }
                    dtl.FK_MapData = this.FK_MapData;
                    GroupFields gfs = new GroupFields(dtl.FK_MapData);
                    if (gfs.Count > 1)
                    {
                        dtl.GroupID = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemIntVal;
                    }

                    if (this.DoType == "New")
                    {
                        dtl.Insert();
                    }
                    else
                    {
                        dtl.Update();
                    }

                    if (btn.ID.Contains("AndC"))
                    {
                        this.WinClose();
                        return;
                    }
                    this.Response.Redirect("MapDtl.aspx?DoType=Edit&FK_MapDtl=" + dtl.No + "&FK_MapData=" + this.FK_MapData, true);
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Alert(ex.Message);
            }
        }
Exemplo n.º 38
0
 /// <summary>Возвращает информацию о заданной группе или о нескольких группах.</summary>
 /// <param name="gids">ID групп, перечисленные через запятую, информацию о которых необходимо получить</param>
 /// <param name="fields">Список полей из информации о группах, которые необходимо получить</param>
 /// <returns>Ответ сервера в XML или JSON формате.</returns>
 public VKResponseBase GetById(IdList gids, GroupFields? fields = null)
 {
     return getById(gids, fields);
 }