Exemplo n.º 1
0
        private string GetPhoto(string workID, string fk_flow, string fk_node)
        {
            string   json = null;
            FrmNodes fns  = new FrmNodes(fk_flow, int.Parse(fk_node));

            List <PhotoEntity> photoEntities = new List <PhotoEntity>();

            foreach (FrmNode fn in fns)
            {
                string sql = string.Format("select EnPk,ImgPath from Sys_FrmImg where FK_MapData ='{0}' and ImgPath is not null UNION ALL  select v1.EnPK ,v2.Tag1 as ImgPath  from Sys_FrmImg v1 left join Sys_FrmEleDB v2 on v1.MyPK = v2.RefPKVal  where v1.FK_MapData='{0}' and EleID='{1}'", fn.FK_Frm, workID);

                System.Data.DataTable table = DBAccess.RunSQLReturnTable(sql);

                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        photoEntities.Add(new PhotoEntity()
                        {
                            Name = row[0].ToString(), Value = row[1].ToString()
                        });
                    }
                }
            }


            json = JsonConvert.SerializeObject(photoEntities);

            return(json);
        }
Exemplo n.º 2
0
        void btn_SavePowerOrders_Click(object sender, EventArgs e)
        {
            FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);

            foreach (FrmNode fn in fns)
            {
                fn.IsEdit     = this.Pub1.GetCBByID("CB_IsEdit_" + fn.FK_Frm).Checked;
                fn.IsPrint    = this.Pub1.GetCBByID("CB_IsPrint_" + fn.FK_Frm).Checked;
                fn.Idx        = int.Parse(this.Pub1.GetTextBoxByID("TB_Idx_" + fn.FK_Frm).Text);
                fn.HisFrmType = (BP.Sys.FrmType) this.Pub1.GetDDLByID("DDL_FrmType_" + fn.FK_Frm).SelectedItemIntVal;

                //权限控制方案.
                fn.FrmSln  = this.Pub1.GetDDLByID("DDL_Sln_" + fn.FK_Frm).SelectedItemIntVal;
                fn.WhoIsPK = (WhoIsPK)this.Pub1.GetDDLByID("DDL_WhoIsPK_" + fn.FK_Frm).SelectedItemIntVal;

                fn.FK_Flow = this.FK_Flow;
                fn.FK_Node = this.FK_Node;
                //fn.FK_Frm =

                fn.MyPK = fn.FK_Frm + "_" + fn.FK_Node + "_" + fn.FK_Flow;

                fn.Update();
            }
            this.Response.Redirect("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow, true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 表单方案
        /// </summary>
        /// <returns></returns>
        public string BindFrms_Init()
        {
            //注册这个枚举,防止第一次运行出错.
            BP.Sys.SysEnums ses = new SysEnums("FrmEnableRole");

            string text = "";

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

            //FrmNodeExt fns = new FrmNodeExt(this.FK_Flow, this.FK_Node);

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

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

            if (isHaveNDFrm == false)
            {
                FrmNode fn = new FrmNode();
                fn.FK_Flow = this.FK_Flow;
                fn.FK_Frm  = "ND" + this.FK_Node;
                fn.FK_Node = this.FK_Node;

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

            //组合这个实体才有外键信息.
            FrmNodeExts fnes = new FrmNodeExts();
            foreach (FrmNode fn in fns)
            {
                MapData md = new MapData();
                md.No = fn.FK_Frm;
                if (md.IsExits == false)
                {
                    fn.Delete();  //说明该表单不存在了,就需要把这个删除掉.
                    continue;
                }

                FrmNodeExt myen = new FrmNodeExt(fn.MyPK);
                fnes.AddEntity(myen);
            }

            //把json数据返回过去.
            return(fnes.ToJson());
        }
Exemplo n.º 4
0
        void btn_SaveFlowFrms_Click(object sender, EventArgs e)
        {
            FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);
            MapDatas mds = new MapDatas();

            mds.Retrieve(MapDataAttr.AppType, (int)AppType.Application);

            //BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

            string ids = ",";

            foreach (MapData md in mds)
            {
                CheckBox cb = this.Pub1.GetCBByID("CB_" + md.No);
                if (cb == null || cb.Checked == false)
                {
                    continue;
                }
                ids += md.No + ",";
            }

            //删除已经删除的。
            foreach (FrmNode fn in fns)
            {
                if (ids.Contains("," + fn.FK_Frm + ",") == false)
                {
                    fn.Delete();
                    continue;
                }
            }

            // 增加集合中没有的。
            string[] strs = ids.Split(',');
            foreach (string s in strs)
            {
                if (string.IsNullOrEmpty(s))
                {
                    continue;
                }
                if (fns.Contains(FrmNodeAttr.FK_Frm, s))
                {
                    continue;
                }

                FrmNode fn = new FrmNode();
                fn.FK_Frm  = s;
                fn.FK_Flow = this.FK_Flow;
                fn.FK_Node = this.FK_Node;
                fn.Save();
            }
            this.Response.Redirect("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow, true);
        }
Exemplo n.º 5
0
        void btn_SavePowerOrders_Click(object sender, EventArgs e)
        {
            FrmNodes fns = new FrmNodes(this.FK_Node);

            foreach (FrmNode fn in fns)
            {
                fn.IsEdit  = this.Pub1.GetCBByID("CB_IsEdit_" + fn.FK_Frm).Checked;
                fn.IsPrint = this.Pub1.GetCBByID("CB_IsPrint_" + fn.FK_Frm).Checked;
                fn.FrmType = this.Pub1.GetDDLByID("DDL_FrmType_" + fn.FK_Frm).SelectedItemIntVal;
                fn.Update();
            }
            this.Response.Redirect("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node, true);
        }
Exemplo n.º 6
0
        private string GetDtlCountFlow(string flow, string node)
        {
            FrmNodes          fns  = new FrmNodes(flow, int.Parse(node));
            List <TempEntity> list = new List <TempEntity>();

            foreach (FrmNode fn in fns)
            {
                list.Add(new TempEntity()
                {
                    Name = fn.FK_Frm
                });
            }
            return(JsonConvert.SerializeObject(list));
        }
Exemplo n.º 7
0
        public void BindCopy()
        {
            FrmNodes fns = new FrmNodes();

            fns.Retrieve(FrmNodeAttr.FK_Flow, this.FK_Flow, FrmNodeAttr.FK_Frm, this.FK_MapData);

            bool isHave = false;

            this.Pub2.AddHR();
            this.Pub2.AddH3("点击选择要copy的节点.");
            this.Pub2.AddUL();
            foreach (FrmNode fn in fns)
            {
                if (fn.FK_Frm != this.FK_MapData)
                {
                    continue;
                }

                if (fn.FK_Node.ToString() == this.FK_Node)
                {
                    continue;
                }

                if (fn.FrmSln == 0)
                {
                    continue;
                }

                BP.WF.Node nd = new BP.WF.Node(fn.FK_Node);

                string lab = "第" + nd.Step + "步:" + nd.NodeID + " - " + nd.Name;
                this.Pub2.AddLi("<a href='Sln.aspx?FK_MapData=" + this.FK_MapData + "&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&DoType=DoCopy&FromNode=" + fn.FK_Node + "' >" + lab + "</a>");
                isHave = true;
            }
            this.Pub2.AddULEnd();

            this.Pub2.AddFieldSet("执行须知");
            this.Pub2.AddUL();
            this.Pub2.AddLi("1, 您将要执行权限方案的copy, 如果copy成功系统将会把您指定的该表单上的定义权限完全copy到当前节点上来.");
            this.Pub2.AddLi("2, copy到现在节点的权限包括:附件、字段、明细表.");
            this.Pub2.AddLi("3, copy到将执行覆盖操作,以前的设置将会被删除重新覆盖.");
            this.Pub2.AddLi("4, 其他表单的权限,之后同表单,并且权限方案为自定义,才能被列出来。");
            this.Pub2.AddULEnd();
            this.Pub2.AddFieldSetEnd();

            if (isHave == false)
            {
                this.Pub2.AddFieldSet("提示", " <font color=red>没有对应的表单绑定</font>.");
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 保存流程表单
        /// </summary>
        /// <returns></returns>
        public string BindFrmsDtl_Save()
        {
            try
            {
                string formNos = this.context.Request["formNos"];

                FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);
                //删除已经删除的。
                foreach (FrmNode fn in fns)
                {
                    if (formNos.Contains("," + fn.FK_Frm + ",") == false)
                    {
                        fn.Delete();
                        continue;
                    }
                }

                // 增加集合中没有的。
                string[] strs = formNos.Split(',');
                foreach (string s in strs)
                {
                    if (DataType.IsNullOrEmpty(s))
                    {
                        continue;
                    }
                    if (fns.Contains(FrmNodeAttr.FK_Frm, s))
                    {
                        continue;
                    }

                    FrmNode fn = new FrmNode();
                    fn.FK_Frm  = s;
                    fn.FK_Flow = this.FK_Flow;
                    fn.FK_Node = this.FK_Node;

                    fn.MyPK = fn.FK_Frm + "_" + fn.FK_Node + "_" + fn.FK_Flow;

                    fn.Save();
                }
                return("保存成功.");
            }
            catch (Exception ex)
            {
                return("err:保存失败." + ex.Message);
            }
        }
Exemplo n.º 9
0
        private string GetChildDtlCount(string fk_flow, string fk_node)
        {
            FrmNodes          fns  = new FrmNodes(fk_flow, int.Parse(fk_node));
            List <TempEntity> list = new List <TempEntity>();

            foreach (FrmNode fn in fns)
            {
                MapDtls mdtls = new MapDtls(fn.FK_Frm);

                foreach (MapDtl single in mdtls)
                {
                    list.Add(new TempEntity()
                    {
                        Name = single.PTable
                    });
                }
            }
            return(JsonConvert.SerializeObject(list));
        }
Exemplo n.º 10
0
        void btn_SavePowerOrders_Click(object sender, EventArgs e)
        {
            //删除以前绑定的值.
            FrmNodes fnds = new FrmNodes();

            fnds.Delete(FrmNodeAttr.FK_Flow, this.FK_Flow,
                        FrmNodeAttr.FK_Frm, this.FK_MapData);

            FrmNode fn = null;

            foreach (Node nd in nds)
            {
                //节点没有选中,后面的明细项目选中也不执行保存
                bool isCheckCurNd = this.Pub1.GetCBByID("CB_NodeName_" + nd.NodeID.ToString()).Checked;
                if (!isCheckCurNd)
                {
                    continue;
                }

                fn = new FrmNode();

                //    fn.IsEdit = this.Pub1.GetCBByID("CB_IsEdit_" + nd.NodeID.ToString()).Checked;
                fn.IsPrint = this.Pub1.GetCBByID("CB_IsPrint_" + nd.NodeID.ToString()).Checked;

                //是否启
                fn.IsEnableLoadData = this.Pub1.GetCBByID("CB_IsEnableLoadData_" + nd.NodeID.ToString()).Checked;

                //权限控制方案.
                fn.FrmSln  = this.Pub1.GetDDLByID("DDL_Sln_" + nd.NodeID.ToString()).SelectedItemIntVal;
                fn.WhoIsPK = (WhoIsPK)this.Pub1.GetDDLByID("DDL_WhoIsPK_" + nd.NodeID.ToString()).SelectedItemIntVal;

                fn.FK_Flow = this.FK_Flow;
                fn.FK_Node = nd.NodeID;
                fn.FK_Frm  = this.FK_MapData;

                fn.MyPK = fn.FK_Frm + "_" + fn.FK_Node + "_" + fn.FK_Flow;

                fn.Insert();
            }

            this.Response.Redirect("BindingForms.aspx?FK_MapData=" + this.FK_MapData + "&FK_Flow=" + this.FK_Flow);
        }
Exemplo n.º 11
0
        private void AddChildNode(string parentNo, MapDatas mds, FrmNodes fns)
        {
            SysFormTrees formTrees = new SysFormTrees();
            QueryObject  objInfo   = new QueryObject(formTrees);

            objInfo.AddWhere(SysFormTreeAttr.ParentNo, parentNo);
            objInfo.addOrderBy(SysFormTreeAttr.Name);
            objInfo.DoQuery();

            int idx = 0;

            foreach (SysFormTree fs in formTrees)
            {
                idx++;
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD(md.Name);
                    this.Pub1.AddTD(md.PTable);
                    this.Pub1.AddTREnd();
                }
                AddChildNode(fs.No, mds, fns);
            }
        }
Exemplo n.º 12
0
        void btn_SavePowerOrders_Click(object sender, EventArgs e)
        {
            string tfModel = SystemConfig.AppSettings["TreeFrmModel"];

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

            foreach (FrmNode fn in fns)
            {
                //  fn.IsEdit = this.Pub1.GetCBByID("CB_IsEdit_" + fn.FK_Frm).Checked;
                fn.IsPrint = this.Pub1.GetCBByID("CB_IsPrint_" + fn.FK_Frm).Checked;

                //是否启
                fn.IsEnableLoadData = this.Pub1.GetCBByID("CB_IsEnableLoadData_" + fn.FK_Frm).Checked;

                fn.Idx = int.Parse(this.Pub1.GetTextBoxByID("TB_Idx_" + fn.FK_Frm).Text);
                //fn.HisFrmType = (BP.Sys.FrmType)this.Pub1.GetDDLByID("DDL_FrmType_" + fn.FK_Frm).SelectedItemIntVal;
                if (tfModel == "1")
                {
                    if (currND.IsStartNode == false)
                    {
                        fn.GuanJianZiDuan = this.Pub1.GetDDLByID("DDL_Attr_" + fn.FK_Frm).SelectedValue;
                    }
                }

                //表单启用规则. 去掉了 2016-05-11 使用连接替代.
                // fn.FrmEnableRoleInt = this.Pub1.GetDDLByID("DDL_FrmEnableRole_" + fn.FK_Frm).SelectedItemIntVal;

                //权限控制方案.
                fn.FrmSln  = this.Pub1.GetDDLByID("DDL_Sln_" + fn.FK_Frm).SelectedItemIntVal;
                fn.WhoIsPK = (WhoIsPK)this.Pub1.GetDDLByID("DDL_WhoIsPK_" + fn.FK_Frm).SelectedItemIntVal;


                fn.FK_Flow = this.FK_Flow;
                fn.FK_Node = this.FK_Node;

                fn.MyPK = fn.FK_Frm + "_" + fn.FK_Node + "_" + fn.FK_Flow;

                if (fn.HisFrmType == FrmType.WordFrm || fn.HisFrmType == FrmType.ExcelFrm)
                {
                    fn.TempleteFile = this.Pub1.GetDDLByID("DDL_File_" + fn.FK_Frm).SelectedItemStringVal;
                }

                // add  for hainan 2016.3.25 增加1对N.
                if (nd.HisRunModel == RunModel.FL || nd.HisRunModel == RunModel.FHL)
                {
                    fn.Is1ToN = this.Pub1.GetCBByID("CB_Is1ToN_" + fn.FK_Frm).Checked;
                    if (fn.Is1ToN == true)
                    {
                        /*检查该表单里是否具有FID的隐藏字段,如果没有系统自动给他增加上.*/
                        MapAttrs attrs = new MapAttrs(fn.FK_Frm);
                        if (attrs.Contains("KeyOfEn", "FID") == false)
                        {
                            MapAttr attr = new MapAttr();
                            attr.MyPK       = fn.FK_Frm + "_FID";
                            attr.FK_MapData = fn.FK_Frm;
                            attr.KeyOfEn    = "FID";
                            attr.LGType     = FieldTypeS.Normal;
                            attr.UIVisible  = false;
                            attr.MyDataType = BP.DA.DataType.AppInt;
                            attr.Insert();
                        }
                    }
                }

                if (nd.HisRunModel == RunModel.SubThread)
                {
                    fn.HuiZong = this.Pub1.GetDDLByID("DDL_HuiZong_" + fn.FK_Frm).SelectedItemStringVal;
                }

                fn.Update();
            }
            this.Response.Redirect("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow, true);
        }
Exemplo n.º 13
0
        public void BindList()
        {
            string text = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                this.Pub1.AddTDEnd();

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

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

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

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

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

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

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

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

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

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

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

                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();

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

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

            text = "<input type=button onclick=\"javascript:window.close();\" value='关闭'  class=Btn />";
            this.Pub1.Add(text);
        }
Exemplo n.º 14
0
        private string GetFlowFormTree()
        {
            //add root
            BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree();
            root.No       = "00";
            root.ParentNo = "0";
            root.Name     = "目录";
            root.NodeType = "root";
            appFlowFormTree.Clear();
            appFlowFormTree.AddEntity(root);

            #region 添加表单及文件夹

            //节点表单
            string     tfModel = SystemConfig.AppSettings["TreeFrmModel"];
            BP.WF.Node nd      = new BP.WF.Node(this.FK_Node);

            FrmNodes    frmNodes = new FrmNodes();
            QueryObject qo       = new QueryObject(frmNodes);
            qo.AddWhere(FrmNodeAttr.FK_Node, this.FK_Node);
            qo.addAnd();
            qo.AddWhere(FrmNodeAttr.FK_Flow, this.FK_Flow);
            //如果配置了启用关键字段,一下会判断绑定的独立表单中的关键字段是否有数据,没有就不会被显示
            // add  by  海南  zqp
            if (tfModel == "1")
            {
                //针对合流点与分合流节点有效
                //获取独立表单的字段
                MapDatas mdes  = new MapDatas();
                string   mypks = "";
                if (nd.IsStartNode == false)
                {
                    qo.addOrderBy(FrmNodeAttr.Idx);
                    qo.DoQuery();
                    foreach (FrmNode fn in frmNodes)
                    {
                        if (fn.HisFrmType == FrmType.Column4Frm || fn.HisFrmType == FrmType.FreeFrm)
                        {
                            mdes.Retrieve(MapDataAttr.No, fn.FK_Frm);
                            //根据设置的关键字段是否有值,进行判断
                            foreach (MapData md in mdes)
                            {
                                Paras ps = new Paras();
                                ps.SQL = "SELECT " + fn.GuanJianZiDuan + " FROM " + md.PTable + " WHERE "
                                         + " OID=" + SystemConfig.AppCenterDBVarStr + "OID";
                                if (this.FID == 0)
                                {
                                    ps.Add("OID", this.WorkID);
                                }
                                else
                                {
                                    ps.Add("OID", this.FID);
                                }
                                try
                                {
                                    DataTable dtmd  = BP.DA.DBAccess.RunSQLReturnTable(ps);
                                    string    dtVal = dtmd.Rows[0]["" + fn.GuanJianZiDuan + ""].ToString();
                                    if (string.IsNullOrWhiteSpace(dtVal))
                                    {
                                        mypks = mypks + "'" + md.No + "',";
                                    }
                                }
                                catch (Exception ex)
                                {
                                    mypks = mypks + "'" + md.No + "',";
                                }
                            }
                        }
                    }
                    mypks = mypks.TrimEnd(',');
                    if (!string.IsNullOrWhiteSpace(mypks))
                    {
                        //添加查询条件
                        qo = new QueryObject(frmNodes);
                        qo.AddWhere(FrmNodeAttr.FK_Node, this.FK_Node);
                        qo.addAnd();
                        qo.AddWhere(FrmNodeAttr.FK_Flow, this.FK_Flow);
                        qo.addAnd();
                        qo.AddWhere(FrmNodeAttr.FK_Frm + " not in(" + mypks + ")");
                        qo.addOrderBy(FrmNodeAttr.Idx);
                        qo.DoQuery();
                    }
                }
                else
                {
                    qo.addOrderBy(FrmNodeAttr.Idx);
                    qo.DoQuery();
                }
            }
            else
            {
                qo.addOrderBy(FrmNodeAttr.Idx);
                qo.DoQuery();
            }
            //文件夹
            SysFormTrees formTrees = new SysFormTrees();
            formTrees.RetrieveAll(SysFormTreeAttr.Name);

            //所有表单集合
            MapDatas mds = new MapDatas();
            mds.RetrieveInSQL("SELECT FK_Frm FROM WF_FrmNode WHERE FK_Node=" + this.FK_Node);

            foreach (FrmNode frmNode in frmNodes)
            {
                #region 增加判断是否启用规则.
                switch (frmNode.FrmEnableRole)
                {
                case FrmEnableRole.Allways:
                    break;

                case FrmEnableRole.WhenHaveData:     //判断是否有数据.
                    MapData md = new MapData(frmNode.FK_Frm);
                    if (DBAccess.RunSQLReturnValInt("SELECT COUNT(*) as Num FROM " + md.PTable + " WHERE OID=" + this.WorkID) == 0)
                    {
                        continue;
                    }
                    break;

                case FrmEnableRole.WhenHaveFrmPara:     //判断是否有参数.
                    string frms = this.Request.QueryString["Frms"];
                    if (frms != null && frms.Contains(frmNode.FK_Frm) == true)
                    {
                        /*包含这个表单.*/
                    }
                    else
                    {
                        continue;
                    }
                    break;

                case FrmEnableRole.ByFrmFields:
                    throw new Exception("@这种类型的判断,ByFrmFields 还没有完成。");

                case FrmEnableRole.BySQL:      // 按照SQL的方式.
                    string mysql = frmNode.FrmEnableExp.Clone() as string;
                    mysql = mysql.Replace("@OID", this.WorkID.ToString());
                    mysql = mysql.Replace("@WorkID", this.WorkID.ToString());

                    mysql = mysql.Replace("@NodeID", this.FK_Node.ToString());
                    mysql = mysql.Replace("@FK_Node", this.FK_Node.ToString());

                    mysql = mysql.Replace("@FK_Flow", this.FK_Flow);

                    if (DBAccess.RunSQLReturnValFloat(mysql) <= 0)
                    {
                        continue;
                    }
                    break;

                case FrmEnableRole.Disable:      // 如果禁用了,就continue出去..
                    continue;

                default:
                    throw new Exception("@没有判断的规则." + frmNode.FrmEnableRole);
                }
                #endregion

                #region 检查是否有没有目录的表单?
                bool isHave = false;
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree == "")
                    {
                        isHave = true;
                        break;
                    }
                }

                string treeNo = "0";
                if (isHave && mds.Count == 1)
                {
                    treeNo = "0";
                }
                else if (isHave == true)
                {
                    foreach (MapData md in mds)
                    {
                        if (md.FK_FormTree != "")
                        {
                            treeNo = md.FK_FormTree;
                            break;
                        }
                    }
                }
                #endregion 检查是否有没有目录的表单?

                foreach (MapData md in mds)
                {
                    if (frmNode.FK_Frm != md.No)
                    {
                        continue;
                    }

                    #warning 这里有错误, 如果是节点表单的话,就没有这个值,没有这个值就绑定不到表单树,代国强解决.
                    if (md.FK_FormTree == "")
                    {
                        md.FK_FormTree = treeNo;
                    }

                    foreach (SysFormTree formTree in formTrees)
                    {
                        if (md.FK_FormTree != formTree.No)
                        {
                            continue;
                        }
                        if (appFlowFormTree.Contains("No", formTree.No) == false)
                        {
                            BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree();
                            nodeFolder.No       = formTree.No;
                            nodeFolder.ParentNo = root.No;
                            nodeFolder.Name     = formTree.Name;
                            nodeFolder.NodeType = "folder";
                            appFlowFormTree.AddEntity(nodeFolder);
                        }
                    }
                    //检查必填项
                    bool        IsNotNull  = false;
                    FrmFields   formFields = new FrmFields();
                    QueryObject obj        = new QueryObject(formFields);
                    obj.AddWhere(FrmFieldAttr.FK_Node, this.FK_Node);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.FK_MapData, md.No);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.IsNotNull, "1");
                    obj.DoQuery();
                    if (formFields != null && formFields.Count > 0)
                    {
                        IsNotNull = true;
                    }

                    BP.WF.Template.FlowFormTree nodeForm = new BP.WF.Template.FlowFormTree();
                    nodeForm.No       = md.No;
                    nodeForm.ParentNo = md.FK_FormTree;
                    nodeForm.Name     = md.Name;
                    nodeForm.NodeType = IsNotNull ? "form|1" : "form|0";
                    nodeForm.IsEdit   = Convert.ToString(Convert.ToInt32(frmNode.IsEdit));
                    appFlowFormTree.AddEntity(nodeForm);
                }
            }
            #endregion

            //扩展工具,显示位置为表单树类型
            NodeToolbars extToolBars = new NodeToolbars();
            QueryObject  info        = new QueryObject(extToolBars);
            info.AddWhere(NodeToolbarAttr.FK_Node, this.FK_Node);
            info.addAnd();
            info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Tree);
            info.DoQuery();

            foreach (NodeToolbar item in extToolBars)
            {
                string url = "";
                if (string.IsNullOrEmpty(item.Url))
                {
                    continue;
                }

                url = item.Url;

                BP.WF.Template.FlowFormTree formTree = new BP.WF.Template.FlowFormTree();
                formTree.No       = item.OID.ToString();
                formTree.ParentNo = "01";
                formTree.Name     = item.Title;
                formTree.NodeType = "tools|0";
                if (!string.IsNullOrEmpty(item.Target) && item.Target.ToUpper() == "_BLANK")
                {
                    formTree.NodeType = "tools|1";
                }

                formTree.Url = url;
                appFlowFormTree.AddEntity(formTree);
            }
            TansEntitiesToGenerTree(appFlowFormTree, root.No, "");
            return(appendMenus.ToString());
        }
Exemplo n.º 15
0
        public void BindFlowFrms()
        {
            FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);

            this.Pub1.AddH2("流程表单绑定");
            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("物理表");
            this.Pub1.AddTDTitle("权限");
            this.Pub1.AddTREnd();

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

            MapDatas    mds     = new MapDatas();
            QueryObject obj_mds = new QueryObject(mds);

            obj_mds.AddWhere(MapDataAttr.AppType, (int)AppType.Application);
            obj_mds.addOrderBy(MapDataAttr.Name);
            obj_mds.DoQuery();
            //FrmSorts fss = new FrmSorts();
            //fss.RetrieveAll();
            SysFormTrees formTrees = new SysFormTrees();
            QueryObject  objInfo   = new QueryObject(formTrees);

            objInfo.AddWhere(SysFormTreeAttr.ParentNo, "0");
            objInfo.addOrderBy(SysFormTreeAttr.Name);
            objInfo.DoQuery();

            int idx = 0;

            foreach (SysFormTree fs in formTrees)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTDB("colspan=4", fs.Name);
                this.Pub1.AddTREnd();
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD("<a href='../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "'  target=_blank>" + md.Name + "</a>");
                    this.Pub1.AddTD(md.PTable);

                    if (cb.Checked)
                    {
                        this.Pub1.AddTD("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\">字段</a>|<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\">附件</a>");
                    }
                    else
                    {
                        this.Pub1.AddTD();
                    }
                    //this.Pub1.AddTD(md.Designer);
                    //this.Pub1.AddTD(md.DesignerUnit);
                    //this.Pub1.AddTD(md.DesignerContact);
                    this.Pub1.AddTREnd();
                }
                AddChildNode(fs.No, mds, fns);
            }
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFlowFrms_Click);
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=5", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
        public void BindList()
        {
            string text = "";

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

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


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



            int idx = 1;

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

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

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


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

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

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

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

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

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

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

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

                this.Pub1.AddTDEnd();

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

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

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

                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();

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

            Button btn = new Button();

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

            text = "<input type=button onclick=\"javascript:window.close();\" value='关闭'  class=Btn />";
            this.Pub1.Add(text);
        }
Exemplo n.º 17
0
        private string GetDataByType(string fk_flow, string fk_node, string workID, string getType)
        {
            FrmNodes fns = new FrmNodes(fk_flow, int.Parse(fk_node));

            string result = "{";

            if (getType != "MainPage")
            {
                foreach (FrmNode fn in fns)
                {
                    MapDtls mdtls = new MapDtls(fn.FK_Frm);

                    foreach (MapDtl dtl in mdtls)
                    {
                        if (dtl.PTable.Equals(getType))
                        {
                            GEDtls ens = new GEDtls(dtl.No);
                            ens.Retrieve(GEDtlAttr.RefPK, workID);
                            result += "\"" + dtl.PTable + "\":" +
                                      JsonConvert.SerializeObject(ens.ToDataTableField()) + "}";
                            break;
                        }
                    }
                }
            }
            else
            {
                foreach (FrmNode fn in fns)
                {
                    GEEntity ge       = new GEEntity(fn.FK_Frm, workID);
                    string   tempJson = JsonConvert.SerializeObject(ge.Row);

                    tempJson = tempJson.TrimStart('{');
                    tempJson = tempJson.TrimEnd('}');

                    result += tempJson + ",";
                }
                result = result.TrimEnd(',') + "}";
            }
            //foreach (FrmNode fn in fns)
            //{
            //    if (fn.FK_Frm == name)
            //    {
            //        GEEntity ge = new GEEntity(fn.FK_Frm, workID);
            //        if (getType == "MainPage")
            //        {
            //            result = JsonConvert.SerializeObject(ge.Row);
            //        }
            //        else
            //        {
            //            result = JsonConvert.SerializeObject(ge.Row);
            //            result = result.Substring(0, result.Length - 1);
            //            MapDtls mdtls = new MapDtls(fn.FK_Frm);

            //            foreach (MapDtl dtl in mdtls)
            //            {
            //                if (dtl.PTable.Equals(getType))
            //                {

            //                    GEDtls ens = new GEDtls(dtl.No);
            //                    ens.Retrieve(GEDtlAttr.RefPK, workID);
            //                    result += ",\"" + dtl.PTable + "\":" +
            //                              JsonConvert.SerializeObject(ens.ToDataTableField()) + "}";
            //                    break;
            //                }
            //            }
            //        }
            //        break;
            //    }
            //}
            return(result);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 编辑权限与顺序
        /// </summary>
        public void BindEditPowerOrder()
        {
            this.Pub1.AddH2("表单权限与显示顺序");
            this.Pub1.AddHR();

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

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

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

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

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

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

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

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

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

                this.Pub1.AddTREnd();
            }

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

            btn.ID       = "Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);
            this.Pub1.AddTD("colspan=8", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 执行功能.
            if (this.IsPostBack == false)
            {
                switch (this.DoType)
                {
                case "Up":
                    FrmNode fnU = new FrmNode(this.MyPK);
                    fnU.DoUp();
                    break;

                case "Down":
                    FrmNode fnD = new FrmNode(this.MyPK);
                    fnD.DoDown();
                    break;

                case "DelFrm":
                    FrmNodes fnsR = new FrmNodes();
                    if (fnsR.Retrieve(FrmNodeAttr.FK_Frm, this.FK_MapData) != 0)
                    {
                        this.Alert("此表单已经被多个流程节点(" + fnsR.Count + ")绑定,所以您不能删除它。");
                    }
                    else
                    {
                        MapData md = new MapData();
                        md.No = this.FK_MapData;
                        md.Delete();
                    }
                    break;

                case "Del":
                    FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);
                    foreach (FrmNode fn in fns)
                    {
                        if (fn.FK_Frm == this.FK_MapData)
                        {
                            fn.Delete();
                            break;
                        }
                    }
                    break;

                case "Add":
                    FrmNode fnN = new FrmNode();
                    fnN.FK_Frm  = this.FK_MapData;
                    fnN.FK_Node = this.FK_Node;
                    fnN.FK_Flow = this.FK_Flow;
                    fnN.Save();
                    break;

                default:
                    break;
                }
            }
            #endregion 执行功能.

            switch (this.ShowType)
            {
            case "Frm":
                this.BindFrm();
                this.Title = "表单";
                break;

            case "FrmLib":
            case "FrmLab":
                this.BindFrmLib();
                this.Title = "表单库";
                break;

            case "FlowFrms":
                this.BindFlowFrms();
                this.Title = "流程表单";
                break;

            case "FrmSorts":
                this.BindFrmSorts();
                this.Title = "流程类别";
                break;

            case "EditPowerOrder":     //编辑权限与顺序.
                this.BindEditPowerOrder();
                break;

            default:
                break;
            }

            this.BindLeft();
        }
Exemplo n.º 20
0
        public void BindFlowFrms()
        {
            FrmNodes fns = new FrmNodes(this.FK_Node);

            this.Pub1.AddH2("流程表单绑定 - 请打钩要绑定的表单,然后点保存按钮。");
            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("物理表");
            this.Pub1.AddTREnd();

            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            MapDatas   mds = new MapDatas();

            mds.Retrieve(MapDataAttr.AppType, (int)AppType.Application);

            FrmSorts fss = new FrmSorts();

            fss.RetrieveAll();
            int idx = 0;

            foreach (FrmSort fs in fss)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTDB("colspan=3", fs.Name);
                this.Pub1.AddTREnd();
                foreach (MapData md in mds)
                {
                    if (md.FK_FrmSort != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD(md.Name);
                    this.Pub1.AddTD(md.PTable);
                    //this.Pub1.AddTD(md.Designer);
                    //this.Pub1.AddTD(md.DesignerUnit);
                    //this.Pub1.AddTD(md.DesignerContact);
                    this.Pub1.AddTREnd();
                }
            }
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFlowFrms_Click);
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=5", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Exemplo n.º 21
0
        public void SelectedFrm()
        {
            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

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

            this.Pub1.AddTable("align=left");
            this.Pub1.AddCaption("设置节点:(" + nd.Name + ")绑定的表单");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("表/视图");
            this.Pub1.AddTREnd();

            MapDatas    mds     = new MapDatas();
            QueryObject obj_mds = new QueryObject(mds);

            obj_mds.AddWhere(MapDataAttr.AppType, (int)AppType.Application);
            obj_mds.addOrderBy(MapDataAttr.Name);
            obj_mds.DoQuery();

            SysFormTrees formTrees = new SysFormTrees();
            QueryObject  objInfo   = new QueryObject(formTrees);

            objInfo.AddWhere(SysFormTreeAttr.ParentNo, "0");
            objInfo.addOrderBy(SysFormTreeAttr.Name);
            objInfo.DoQuery();

            int idx = 0;

            foreach (SysFormTree fs in formTrees)
            {
                idx++;
                this.Pub1.AddTRSum();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD("colspan=4", fs.Name);
                this.Pub1.AddTREnd();
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    if (cb.Checked)
                    {
                        this.Pub1.AddTDB("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" ><b>" + md.Name + "</b></a>");
                        this.Pub1.AddTDB(md.PTable);
                    }
                    else
                    {
                        this.Pub1.AddTD("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>");
                        this.Pub1.AddTD(md.PTable);
                    }
                    this.Pub1.AddTREnd();
                }
                AddChildNode(fs.No, mds, fns);
            }
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "保存并设置绑定方案属性";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFlowFrms_Click);
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=4", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Exemplo n.º 22
0
        /// <summary>
        /// 获取流程表单树
        /// </summary>
        /// <returns></returns>
        private string GetFlowFormTree()
        {
            string flowId      = getUTF8ToString("flowId");
            string parentNo    = getUTF8ToString("parentno");
            string isFirstLoad = getUTF8ToString("isFirstLoad");

            //获取子节点内容
            SysFormTrees flowFormTrees = new SysFormTrees();
            QueryObject  objInfo       = new QueryObject(flowFormTrees);

            objInfo.AddWhere("ParentNo", parentNo);
            objInfo.addOrderBy("Idx");
            objInfo.DoQuery();

            if (isFirstLoad == "true")
            {
                SysFormTree   formTree = new SysFormTree("0");
                StringBuilder appSend  = new StringBuilder();
                appSend.Append("[");
                appSend.Append("{");
                appSend.Append("\"id\":\"0\"");
                appSend.Append(",\"text\":\"" + formTree.Name + "\"");

                appSend.Append(",iconCls:\"icon-0\"");
                appSend.Append(",\"children\":");
                appSend.Append("[");
                //获取节点下的表单
                SysForms    sysForms     = new SysForms();
                QueryObject objFlowForms = new QueryObject(sysForms);
                objFlowForms.AddWhere(SysFormAttr.FK_FormTree, parentNo);
                objFlowForms.addOrderBy(SysFormAttr.Name);
                objFlowForms.DoQuery();

                //添加子项文件夹
                foreach (SysFormTree item in flowFormTrees)
                {
                    //获取已选择项
                    FrmNodes    flowForms   = new FrmNodes();
                    QueryObject objFlowForm = new QueryObject(flowForms);
                    objFlowForm.AddWhere("FK_Flow", flowId);
                    objFlowForm.addAnd();
                    objFlowForm.AddWhere("FK_FlowFormTree", item.No);
                    objFlowForm.DoQuery();

                    if (flowForms != null && flowForms.Count > 0)
                    {
                    }
                }
                //添加表单
                foreach (SysForm sysForm in sysForms)
                {
                    appSend.Append("{");
                    appSend.Append("\"id\":\"0\"");
                    appSend.Append(",\"text\":\"" + formTree.Name + "\"");

                    appSend.Append(",iconCls:\"icon-3\"");
                    appSend.Append("},");
                }
                appSend.Append("]");
                appSend.Append("}");
                appSend.Append("]");
                return(appSend.ToString());
            }

            return("");
        }
        public void PrintBill()
        {
            BP.WF.Node nd   = new BP.WF.Node(this.FK_Node);
            string     path = ApplicationPath + "\\DataUser\\CyclostyleFile\\FlowFrm\\" + nd.FK_Flow + "\\" + nd.NodeID + "\\";

            if (System.IO.Directory.Exists(path) == false)
            {
                this.Pub1.AddMsgOfWarning("获取模版错误", "模版文件没有找到。" + path);
                return;
            }

            string[] fls  = System.IO.Directory.GetFiles(path);
            string   file = fls[int.Parse(this.BillIdx)];

            file = file.Replace(ApplicationPath + @"DataUser\CyclostyleFile", "");

            FileInfo finfo           = new FileInfo(file);
            string   tempName        = finfo.Name.Split('.')[0];
            string   tempNameChinese = finfo.Name.Split('.')[1];

            string toPath = ApplicationPath + @"DataUser\Bill\FlowFrm\" + DateTime.Now.ToString("yyyyMMdd") + "\\";

            if (System.IO.Directory.Exists(toPath) == false)
            {
                System.IO.Directory.CreateDirectory(toPath);
            }

            // string billFile = toPath + "\\" + tempName + "." + this.FID + ".doc";
            string billFile = toPath + "\\" + Server.UrlDecode(tempNameChinese) + "." + this.WorkID + ".doc";

            BP.Pub.RTFEngine engine = new BP.Pub.RTFEngine();
            if (tempName.ToLower() == "all")
            {
                /* 说明要从所有的流程表单上取数据.*/
                FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);
                foreach (FrmNode fn in fns)
                {
                    GEEntity ge = new GEEntity(fn.FK_Frm, this.WorkID);
                    engine.AddEn(ge);
                    MapDtls mdtls = new MapDtls(fn.FK_Frm);
                    foreach (MapDtl dtl in mdtls)
                    {
                        GEDtls enDtls = dtl.HisGEDtl.GetNewEntities as GEDtls;
                        enDtls.Retrieve(GEDtlAttr.RefPK, this.WorkID);
                        engine.EnsDataDtls.Add(enDtls);
                    }
                }

                // 增加主表.
                GEEntity myge = new GEEntity("ND" + nd.NodeID, this.WorkID);
                engine.AddEn(myge);
                MapDtls mymdtls = new MapDtls("ND" + nd.NodeID);
                foreach (MapDtl dtl in mymdtls)
                {
                    GEDtls enDtls = dtl.HisGEDtl.GetNewEntities as GEDtls;
                    enDtls.Retrieve(GEDtlAttr.RefPK, this.WorkID);
                    engine.EnsDataDtls.Add(enDtls);
                }

                // engine.MakeDoc(file, toPath, tempName + "." + this.WorkID + ".doc", null, false);
                engine.MakeDoc(file, toPath, Server.UrlDecode(tempNameChinese) + "." + this.WorkID + ".doc", null, false);
            }
            else
            {
                // 增加主表.
                GEEntity myge = new GEEntity(tempName, this.WorkID);
                engine.HisGEEntity = myge;
                engine.AddEn(myge);

                MapDtls mymdtls = new MapDtls(tempName);
                foreach (MapDtl dtl in mymdtls)
                {
                    GEDtls enDtls = dtl.HisGEDtl.GetNewEntities as GEDtls;
                    enDtls.Retrieve(GEDtlAttr.RefPK, this.WorkID);
                    engine.EnsDataDtls.Add(enDtls);
                }
                //engine.MakeDoc(file, toPath, tempName + "." + this.FID + ".doc", null, false);
                engine.MakeDoc(file, toPath, Server.UrlDecode(tempNameChinese) + "." + this.WorkID + ".doc", null, false);
            }


            #region 保存单据,以方便查询.
            Bill bill = new Bill();
            bill.MyPK    = this.FID + "_" + this.WorkID + "_" + this.FK_Node + "_" + this.BillIdx;
            bill.WorkID  = this.WorkID;
            bill.FK_Node = this.FK_Node;
            bill.FK_Dept = WebUser.FK_Dept;
            bill.FK_Emp  = WebUser.No;

            bill.Url      = "/DataUser/Bill/FlowFrm/" + DateTime.Now.ToString("yyyyMMdd") + "/" + Server.UrlDecode(tempNameChinese) + "." + this.WorkID + ".doc";
            bill.FullPath = toPath + file;

            bill.RDT     = DataType.CurrentDataTime;
            bill.FK_NY   = DataType.CurrentYearMonth;
            bill.FK_Flow = this.FK_Flow;
            if (this.WorkID != 0)
            {
                GenerWorkFlow gwf = new GenerWorkFlow();
                gwf.WorkID = this.WorkID;
                if (gwf.RetrieveFromDBSources() == 1)
                {
                    bill.Emps       = gwf.Emps;
                    bill.FK_Starter = gwf.Starter;
                    bill.StartDT    = gwf.RDT;
                    bill.Title      = gwf.Title;
                    bill.FK_Dept    = gwf.FK_Dept;
                }
            }

            try
            {
                bill.Insert();
            }
            catch
            {
                bill.Update();
            }
            #endregion



            BP.Sys.PubClass.OpenWordDocV2(billFile, tempNameChinese + ".doc");
        }
        private void InitContextMenues()
        {
            var MenuOidNodes = new ContextMenu();

            MenuOidNodes.MenuItems.Add("New", (_, __) =>
            {
                if (Project == null)
                {
                    return;
                }
                using (var f = new FrmNodes(Project.nodeSetups.ToArray()))
                {
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        Project.nodeSetups.Add(new NodeSetup(f.Result));
                        RefreshNodes();
                    }
                }
            });
            MenuOidNodes.MenuItems.Add("Edit", (_, __) =>
            {
                if (Project == null)
                {
                    return;
                }
                if (lbOidCodes.SelectedItem != null)
                {
                    using (var f = new FrmNodes(Project.nodeSetups.ToArray(), Project.nodeSetups[lbOidCodes.SelectedIndex]))
                    {
                        if (f.ShowDialog() == DialogResult.OK)
                        {
                            Project.nodeSetups[lbOidCodes.SelectedIndex] = (f.Result);
                            RefreshNodes();
                        }
                    }
                }
            });
            MenuOidNodes.MenuItems.Add("Delete", (_, __) =>
            {
                if (Project == null)
                {
                    return;
                }
                if (lbOidCodes.SelectedItem != null)
                {
                    List <SceneOid> sceneOids = new List <SceneOid>();;
                    if (Project.Scenes != null && Project.Scenes.Count > 0)
                    {
                        foreach (var scene in Project.Scenes)
                        {
                            sceneOids.AddRange(scene.SceneOids.Where(x => x.SetupName == lbOidCodes.SelectedItem.ToString()).ToList());
                        }
                    }

                    string existingSceneOids = sceneOids != null && sceneOids.Count > 0 ? ", Some scenes contains this OID polygons" : "";
                    if (MessageBox.Show(this, $"Delete {lbOidCodes.SelectedItem}{existingSceneOids}", "Delete Oid", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        Project.nodeSetups.RemoveAt(lbOidCodes.SelectedIndex);
                        if (Project.Scenes != null && Project.Scenes.Count > 0)
                        {
                            foreach (var scene in Project.Scenes)
                            {
                                scene.SceneOids.RemoveAll(x => x.SetupName == lbOidCodes.SelectedItem.ToString());
                            }
                        }
                        RefreshNodes();
                    }
                }
            });


            var MenuOidRegister = new ContextMenu();

            MenuOidRegister.MenuItems.Add("New", (_, __) =>
            {
                if (Project == null)
                {
                    return;
                }
                using (var f = new frmRegister(Project.oIDRegisters.ToArray(), null))
                {
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        Project.oIDRegisters.Add(f.Result);
                        RefreshOid();
                    }
                }
            });
            MenuOidRegister.MenuItems.Add("Edit", (_, __) =>
            {
                if (Project == null)
                {
                    return;
                }
                if (lbRegister.SelectedItem != null)
                {
                    using (var f = new frmRegister(Project.oIDRegisters.ToArray(), Project.oIDRegisters[lbRegister.SelectedIndex]))
                    {
                        if (f.ShowDialog() == DialogResult.OK)
                        {
                            RenameRegister(Project.oIDRegisters[lbRegister.SelectedIndex], f.Result);
                            Project.oIDRegisters[lbRegister.SelectedIndex] = (f.Result);

                            RefreshOid();
                            if (selectedOidNode != null)
                            {
                                LoadSetup(selectedOidNode);
                            }
                        }
                    }
                }
            });
            MenuOidRegister.MenuItems.Add("Delete", (_, __) =>
            {
                if (Project == null)
                {
                    return;
                }
                if (lbRegister.SelectedItem != null)
                {
                    if (MessageBox.Show(this, $"Delete {lbRegister.SelectedItem}", "Delete Register", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        DeleteRegister(Project.oIDRegisters[lbRegister.SelectedIndex]);

                        Project.oIDRegisters.Remove(Project.oIDRegisters[lbRegister.SelectedIndex]);
                        RefreshOid();
                        if (selectedOidNode != null)
                        {
                            LoadSetup(selectedOidNode);
                        }
                    }
                }
            });

            lbOidCodes.ContextMenu = MenuOidNodes;
            lbRegister.ContextMenu = MenuOidRegister;
        }
Exemplo n.º 25
0
        /// <summary>
        /// 获取表单库所有表单
        /// </summary>
        /// <returns></returns>
        public string BindForm_GenerForms()
        {
            //形成树
            FlowFormTrees appendFormTrees = new FlowFormTrees();
            //节点绑定表单
            FrmNodes frmNodes = new FrmNodes(this.FK_Flow, this.FK_Node);
            //所有表单类别
            SysFormTrees formTrees = new SysFormTrees();

            formTrees.RetrieveAll(SysFormTreeAttr.Idx);

            //根节点
            BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree();
            root.Name = "表单库";
            int i = root.Retrieve(FlowFormTreeAttr.ParentNo, 0);

            if (i != 0)
            {
                root.Name     = "表单库";
                root.No       = "1";
                root.NodeType = "root";
                root.Insert();
            }
            root.NodeType = "root";

            appendFormTrees.AddEntity(root);

            foreach (SysFormTree formTree in formTrees)
            {
                //已经添加排除
                if (appendFormTrees.Contains("No", formTree.No) == true)
                {
                    continue;
                }

                //根节点排除
                if (formTree.ParentNo.Equals("0"))
                {
                    root.No = formTree.No;
                    continue;
                }



                //文件夹
                BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree();
                nodeFolder.No       = formTree.No;
                nodeFolder.ParentNo = formTree.ParentNo;
                nodeFolder.Name     = formTree.Name;
                nodeFolder.NodeType = "folder";
                if (formTree.ParentNo.Equals("0"))
                {
                    nodeFolder.ParentNo = root.No;
                }
                appendFormTrees.AddEntity(nodeFolder);

                //表单
                MapDatas mapS = new MapDatas();
                mapS.RetrieveByAttr(MapDataAttr.FK_FormTree, formTree.No);
                if (mapS != null && mapS.Count > 0)
                {
                    foreach (MapData map in mapS)
                    {
                        BP.WF.Template.FlowFormTree formFolder = new BP.WF.Template.FlowFormTree();
                        formFolder.No       = map.No;
                        formFolder.ParentNo = map.FK_FormTree;
                        formFolder.Name     = map.Name + "[" + map.No + "]";
                        formFolder.NodeType = "form";
                        appendFormTrees.AddEntity(formFolder);
                    }
                }
            }

            string strCheckedNos = "";

            //设置选中
            foreach (FrmNode frmNode in frmNodes)
            {
                strCheckedNos += "," + frmNode.FK_Frm + ",";
            }
            //重置
            appendMenus.Clear();
            //生成数据
            TansEntitiesToGenerTree(appendFormTrees, root.No, strCheckedNos);
            return(appendMenus.ToString());
        }
Exemplo n.º 26
0
        public void PrintBill()
        {
            BP.WF.Node nd   = new BP.WF.Node(this.FK_Node);
            string     path = ApplicationPath + "\\DataUser\\CyclostyleFile\\FlowFrm\\" + nd.FK_Flow + "\\" + nd.NodeID + "\\";

            if (System.IO.Directory.Exists(path) == false)
            {
            }

            string[] fls  = System.IO.Directory.GetFiles(path);
            string   file = fls[int.Parse(this.BillIdx)];

            file = file.Replace(ApplicationPath + @"DataUser\CyclostyleFile", "");

            FileInfo finfo           = new FileInfo(file);
            string   tempName        = finfo.Name.Split('.')[0];
            string   tempNameChinese = finfo.Name.Split('.')[1];

            string toPath = ApplicationPath + @"DataUser\Bill\FlowFrm\" + DateTime.Now.ToString("yyyyMMdd") + "\\";

            if (System.IO.Directory.Exists(toPath) == false)
            {
                System.IO.Directory.CreateDirectory(toPath);
            }

            string billFile = toPath + "\\" + tempName + "." + this.FID + ".doc";

            BP.Rpt.RTF.RTFEngine engine = new BP.Rpt.RTF.RTFEngine();
            if (tempName.ToLower() == "all")
            {
                FrmNodes fns = new FrmNodes(this.FK_Node);
                foreach (FrmNode fn in fns)
                {
                    GEEntity ge = new GEEntity(fn.FK_Frm, this.WorkID);
                    engine.AddEn(ge);
                    MapDtls mdtls = new MapDtls(tempName);
                    foreach (MapDtl dtl in mdtls)
                    {
                        GEDtls enDtls = dtl.HisGEDtl.GetNewEntities as GEDtls;
                        enDtls.Retrieve(GEDtlAttr.RefPK, this.WorkID);
                        engine.EnsDataDtls.Add(enDtls);
                    }
                }

                // 增加主表.
                GEEntity myge = new GEEntity("ND" + nd.NodeID, this.WorkID);
                engine.AddEn(myge);
                MapDtls mymdtls = new MapDtls("ND" + nd.NodeID);
                foreach (MapDtl dtl in mymdtls)
                {
                    GEDtls enDtls = dtl.HisGEDtl.GetNewEntities as GEDtls;
                    enDtls.Retrieve(GEDtlAttr.RefPK, this.WorkID);
                    engine.EnsDataDtls.Add(enDtls);
                }
                engine.MakeDoc(file, toPath, tempName + "." + this.WorkID + ".doc", null, false);
            }
            else
            {
                // 增加主表.
                GEEntity myge = new GEEntity(tempName, this.FID);
                engine.HisGEEntity = myge;
                engine.AddEn(myge);

                MapDtls mymdtls = new MapDtls(tempName);
                foreach (MapDtl dtl in mymdtls)
                {
                    GEDtls enDtls = dtl.HisGEDtl.GetNewEntities as GEDtls;
                    enDtls.Retrieve(GEDtlAttr.RefPK, this.WorkID);
                    engine.EnsDataDtls.Add(enDtls);
                }
                engine.MakeDoc(file, toPath, tempName + "." + this.FID + ".doc", null, false);
            }

            BP.PubClass.OpenWordDocV2(billFile, tempNameChinese + ".doc");
        }
Exemplo n.º 27
0
        private string GetFlowFormTree()
        {
            string flowId = getUTF8ToString("flowId");
            string nodeId = getUTF8ToString("nodeId");

            //add root
            BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree();
            root.No       = "01";
            root.ParentNo = "0";
            root.Name     = "目录";
            root.NodeType = "root";
            appFlowFormTree.Clear();
            appFlowFormTree.AddEntity(root);

            #region 添加表单及文件夹

            //节点表单
            FrmNodes    frmNodes = new FrmNodes();
            QueryObject qo       = new QueryObject(frmNodes);
            qo.AddWhere(FrmNodeAttr.FK_Node, nodeId);
            qo.addAnd();
            qo.AddWhere(FrmNodeAttr.FK_Flow, flowId);
            qo.addOrderBy(FrmNodeAttr.Idx);
            qo.DoQuery();
            //文件夹
            SysFormTrees formTrees = new SysFormTrees();
            formTrees.RetrieveAll(SysFormTreeAttr.Name);
            //所有表单集合
            MapDatas mds = new MapDatas();
            mds.Retrieve(MapDataAttr.AppType, (int)AppType.Application);
            foreach (FrmNode frmNode in frmNodes)
            {
                foreach (MapData md in mds)
                {
                    if (frmNode.FK_Frm != md.No)
                    {
                        continue;
                    }

                    foreach (SysFormTree formTree in formTrees)
                    {
                        if (md.FK_FormTree != formTree.No)
                        {
                            continue;
                        }

                        if (!appFlowFormTree.Contains("No", formTree.No))
                        {
                            BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree();
                            nodeFolder.No       = formTree.No;
                            nodeFolder.ParentNo = root.No;
                            nodeFolder.Name     = formTree.Name;
                            nodeFolder.NodeType = "folder";
                            appFlowFormTree.AddEntity(nodeFolder);
                        }
                    }
                    //检查必填项
                    bool        IsNotNull  = false;
                    FrmFields   formFields = new FrmFields();
                    QueryObject obj        = new QueryObject(formFields);
                    obj.AddWhere(FrmFieldAttr.FK_Node, nodeId);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.FK_MapData, md.No);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.IsNotNull, "1");
                    obj.DoQuery();
                    if (formFields != null && formFields.Count > 0)
                    {
                        IsNotNull = true;
                    }

                    BP.WF.Template.FlowFormTree nodeForm = new BP.WF.Template.FlowFormTree();
                    nodeForm.No       = md.No;
                    nodeForm.ParentNo = md.FK_FormTree;
                    nodeForm.Name     = md.Name;
                    nodeForm.NodeType = IsNotNull ? "form|1" : "form|0";
                    appFlowFormTree.AddEntity(nodeForm);
                }
            }
            #endregion
            //扩展工具,显示位置为表单树类型
            NodeToolbars extToolBars = new NodeToolbars();
            QueryObject  info        = new QueryObject(extToolBars);
            info.AddWhere(NodeToolbarAttr.FK_Node, nodeId);
            info.addAnd();
            info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Tree);
            info.DoQuery();

            foreach (NodeToolbar item in extToolBars)
            {
                string url = "";
                if (string.IsNullOrEmpty(item.Url))
                {
                    continue;
                }

                url = item.Url;

                BP.WF.Template.FlowFormTree formTree = new BP.WF.Template.FlowFormTree();
                formTree.No       = item.OID.ToString();
                formTree.ParentNo = "01";
                formTree.Name     = item.Title;
                formTree.NodeType = "tools|0";
                if (!string.IsNullOrEmpty(item.Target) && item.Target.ToUpper() == "_BLANK")
                {
                    formTree.NodeType = "tools|1";
                }

                formTree.Url = url;
                appFlowFormTree.AddEntity(formTree);
            }
            TansEntitiesToGenerTree(appFlowFormTree, root.No, "");
            return(appendMenus.ToString());
        }
Exemplo n.º 28
0
        /// <summary>
        /// 编辑权限与顺序
        /// </summary>
        public void BindEditPowerOrder()
        {
            this.Pub1.AddH2("表单权限与显示顺序");
            this.Pub1.AddHR();
            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("显示方式");
            this.Pub1.AddTDTitle("是否可编辑?");
            this.Pub1.AddTDTitle("是否可打印");
            // this.Pub1.AddTDTitle("表单元素权限控制方案");
            this.Pub1.AddTDTitle("权限控制方案");

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

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

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

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

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


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

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

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


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

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

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

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

                this.Pub1.AddTDEnd();

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

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

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

                this.Pub1.AddTREnd();
            }

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

            btn.ID       = "Save";
            btn.Text     = "  Save  ";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);
            this.Pub1.AddTD("colspan=12", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }