public void AddFEnum()
        {
            this.Title = "增加新字段向导";
            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'>增加新字段向导</a> - <a href='SysEnum.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' ><img src='../Img/Btn/New.gif' />新建枚举</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("编号(点击增加到表单)");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTDTitle();
            this.Pub1.AddTREnd();

            BP.Sys.SysEnumMains sems = new SysEnumMains();
            QueryObject         qo   = new QueryObject(sems);

            this.Pub2.BindPageIdx(qo.GetCount(), pageSize, this.PageIdx, "Do.aspx?DoType=AddSysEnum&MyPK=" + this.MyPK + "&Idx=&GroupField");
            qo.DoQuery("No", pageSize, this.PageIdx);

            bool is1 = false;
            int  Idx = 0;

            foreach (BP.Sys.SysEnumMain sem in sems)
            {
                BP.Web.Controls.DDL ddl = null;
                try
                {
                    ddl = new BP.Web.Controls.DDL();
                    ddl.BindSysEnum(sem.No);
                }
                catch
                {
                    sem.Delete();
                }
                Idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(Idx);
                this.Pub1.AddTD("<a  href=\"javascript:AddEnum('" + this.MyPK + "','" + this.Idx + "','" + sem.No + "')\" >" + sem.No + "</a>");
                this.Pub1.AddTD(sem.Name);
                this.Pub1.AddTD("[<a href='SysEnum.aspx?DoType=Edit&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&RefNo=" + sem.No + "' >编辑</a>]");
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "枚举值编辑";
        if (this.DoType == "Del")
        {
            MapAttrs attrs = new MapAttrs();
            attrs.Retrieve(MapAttrAttr.UIBindKey, this.RefNo);

            this.UCSys1.AddEasyUiPanelInfoBegin("删除确认", "icon-delete");

            if (attrs.Count != 0)
            {
                //this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
                //this.UCSys1.Add("此枚举值已经被其它的字段所引用,您不能删除它。");
                //this.UCSys1.AddH2("<a href='EnumList.aspx' >返回列表</a>");
                //this.UCSys1.AddFieldSetEnd();
                this.UCSys1.Add("<b>此枚举值已经被其它的字段所引用,您不能删除它。</b>");
                this.UCSys1.Add("<a class='easyui-linkbutton' data-options=\"iconCls:'icon-back'\" href='EnumList.aspx?T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "' >返回列表</a>");
                this.UCSys1.AddEasyUiPanelInfoEnd();
                return;
            }

            //this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
            SysEnumMain m = new SysEnumMain(this.RefNo);
            this.UCSys1.AddEasyUiLinkButton("确定删除:" + m.Name + "?", "EnumList.aspx?RefNo=" + this.RefNo + "&DoType=DelReal&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"),
                                            "icon-delete");
            this.UCSys1.AddSpace(1);
            this.UCSys1.AddEasyUiLinkButton("取消", "EnumList.aspx?T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"),
                                            "icon-undo");
            this.UCSys1.AddEasyUiPanelInfoEnd();
            return;
        }

        if (this.DoType == "DelReal")
        {
            SysEnumMain m = new SysEnumMain();
            m.No = this.RefNo;
            m.Delete();
            SysEnums ses = new SysEnums();
            ses.Delete(SysEnumAttr.EnumKey, this.RefNo);
            //this.Response.Redirect("EnumList.aspx", true);
            this.Response.Redirect("EnumList.aspx?T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"), true);
            return;
        }

        if (this.DoType == "New")
        {
            this.BindNew();
            return;
        }

        if (this.RefNo != null)
        {
            this.BindRefNo();
            return;
        }

        //this.UCSys1.AddTable();
        //this.UCSys1.AddCaptionLeftTX("<img src='./../../Img/Btn/Home.gif' border=0/>列表 - <a href='EnumList.aspx?DoType=New' ><img border=0 src='./../../Img/Btn/New.gif' >新建</a>");
        this.UCSys1.AddTableNormal();
        this.UCSys1.AddTRGroupTitle(5,
                                    "<b>列表</b> - <a href='EnumList.aspx?DoType=New&T=" +
                                    DateTime.Now.ToString("yyyyMMddHHmmssfff") +
                                    "'>新建</a>");
        this.UCSys1.AddTR();
        this.UCSys1.AddTDGroupTitleCenter("序");
        this.UCSys1.AddTDGroupTitle("编号");
        this.UCSys1.AddTDGroupTitle("名称");
        this.UCSys1.AddTDGroupTitle("信息");
        this.UCSys1.AddTDGroupTitle("操作");
        this.UCSys1.AddTREnd();

        SysEnumMains sems = new SysEnumMains();

        sems.RetrieveAll();
        int i = 0;

        foreach (SysEnumMain se in sems)
        {
            i++;
            //this.UCSys1.AddTR();
            this.UCSys1.AddTR(i % 2 == 0);
            this.UCSys1.AddTDIdx(i);
            this.UCSys1.AddTD(se.No);
            this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No + "&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"), se.Name);
            this.UCSys1.AddTD(se.CfgVal);
            //this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No + "&DoType=Del", "<img src='./../../Img/Btn/Delete.gif' border=0 />删除");
            this.UCSys1.AddTDBegin();
            this.UCSys1.AddEasyUiLinkButton("删除", "EnumList.aspx?RefNo=" + se.No + "&DoType=Del&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"), "icon-delete");
            this.UCSys1.AddTDEnd();
            this.UCSys1.AddTREnd();
        }
        this.UCSys1.AddTableEnd();
    }
示例#3
0
        public override object Do()
        {
            string msg = "";

            #region 检查数据文件是否完整.
            string path = "C:\\CCFlowTemplete";
            if (System.IO.Directory.Exists(path) == false)
            {
                msg += "@错误:约定的目录不存在服务器" + path + ",请把从ccflow备份的文件放入" + path;
            }

            //PortTables.
            string file = path + "\\PortTables.xml";
            if (System.IO.File.Exists(file) == false)
            {
                msg += "@错误:约定的文件不存在," + file;
            }

            //SysTables.
            file = path + "\\SysTables.xml";
            if (System.IO.File.Exists(file) == false)
            {
                msg += "@错误:约定的文件不存在," + file;
            }

            //FlowTables.
            file = path + "\\FlowTables.xml";
            if (System.IO.File.Exists(file) == false)
            {
                msg += "@错误:约定的文件不存在," + file;
            }
            #endregion 检查数据文件是否完整.

            #region 1 装载流程基础表数据.
            DataSet ds = new DataSet();
            ds.ReadXml(path + "\\FlowTables.xml");

            //流程类别.
            FlowSorts sorts = new FlowSorts();
            sorts.ClearTable();
            DataTable dt = ds.Tables["WF_FlowSort"];
            // sorts = QueryObject.InitEntitiesByDataTable(sorts, dt, null) as FlowSorts;
            foreach (FlowSort item in sorts)
            {
                item.DirectInsert(); //插入数据.
            }
            #endregion 1 装载流程基础表数据.

            #region 2 组织结构.
            ds = new DataSet();
            ds.ReadXml(path + "\\PortTables.xml");

            //Port_Emp.
            Emps emps = new Emps();
            emps.ClearTable();
            dt   = ds.Tables["Port_Emp"];
            emps = QueryObject.InitEntitiesByDataTable(emps, dt, null) as Emps;
            foreach (Emp item in emps)
            {
                item.DirectInsert(); //插入数据.
            }

            //Depts.
            Depts depts = new Depts();
            depts.ClearTable();
            dt    = ds.Tables["Port_Dept"];
            depts = QueryObject.InitEntitiesByDataTable(depts, dt, null) as Depts;
            foreach (Dept item in depts)
            {
                item.DirectInsert(); //插入数据.
            }

            //Stations.
            Stations stas = new Stations();
            stas.ClearTable();
            dt   = ds.Tables["Port_Station"];
            stas = QueryObject.InitEntitiesByDataTable(stas, dt, null) as Stations;
            foreach (Station item in stas)
            {
                item.DirectInsert(); //插入数据.
            }


            //EmpDepts.
            EmpDepts eds = new EmpDepts();
            eds.ClearTable();
            dt  = ds.Tables["Port_EmpDept"];
            eds = QueryObject.InitEntitiesByDataTable(eds, dt, null) as EmpDepts;
            foreach (EmpDept item in eds)
            {
                item.DirectInsert(); //插入数据.
            }

            //EmpStations.
            EmpStations ess = new EmpStations();
            ess.ClearTable();
            dt  = ds.Tables["Port_EmpStation"];
            ess = QueryObject.InitEntitiesByDataTable(ess, dt, null) as EmpStations;
            foreach (EmpStation item in ess)
            {
                item.DirectInsert(); //插入数据.
            }
            #endregion 2 组织结构.

            #region 3 恢复系统数据.
            ds = new DataSet();
            ds.ReadXml(path + "\\SysTables.xml");

            //枚举Main.
            SysEnumMains sems = new SysEnumMains();
            sems.ClearTable();
            dt   = ds.Tables["Sys_EnumMain"];
            sems = QueryObject.InitEntitiesByDataTable(sems, dt, null) as SysEnumMains;
            foreach (SysEnumMain item in sems)
            {
                item.DirectInsert(); //插入数据.
            }

            //枚举.
            SysEnums ses = new SysEnums();
            ses.ClearTable();
            dt  = ds.Tables["Sys_Enum"];
            ses = QueryObject.InitEntitiesByDataTable(ses, dt, null) as SysEnums;
            foreach (SysEnum item in ses)
            {
                item.DirectInsert(); //插入数据.
            }

            ////Sys_FormTree.
            //BP.Sys.SysFormTrees sfts = new SysFormTrees();
            //sfts.ClearTable();
            //dt = ds.Tables["Sys_FormTree"];
            //sfts = QueryObject.InitEntitiesByDataTable(sfts, dt, null) as SysFormTrees;
            //foreach (SysFormTree item in sfts)
            //{
            //    try
            //    {
            //       item.DirectInsert(); //插入数据.
            //    }
            //    catch
            //    {
            //    }
            //}
            #endregion 3 恢复系统数据.

            #region 4.备份表单相关数据.
            if (1 == 2)
            {
                string pathOfTables = path + "\\SFTables";
                System.IO.Directory.CreateDirectory(pathOfTables);
                SFTables tabs = new SFTables();
                tabs.RetrieveAll();
                foreach (SFTable item in tabs)
                {
                    if (item.No.Contains("."))
                    {
                        continue;
                    }

                    string sql = "SELECT * FROM " + item.No;
                    ds = new DataSet();
                    ds.Tables.Add(BP.DA.DBAccess.RunSQLReturnTable(sql));
                    ds.WriteXml(pathOfTables + "\\" + item.No + ".xml");
                }
            }
            #endregion 4 备份表单相关数据.

            #region 5.恢复表单数据.
            //删除所有的流程数据.
            MapDatas mds = new MapDatas();
            mds.RetrieveAll();
            foreach (MapData fl in mds)
            {
                //if (fl.FK_FormTree.Length > 1 || fl.FK_FrmSort.Length > 1)
                //    continue;
                fl.Delete(); //删除流程.
            }

            //清除数据.
            SysFormTrees fss = new SysFormTrees();
            fss.ClearTable();

            // 调度表单文件。
            string          frmPath = path + "\\Form";
            DirectoryInfo   dirInfo = new DirectoryInfo(frmPath);
            DirectoryInfo[] dirs    = dirInfo.GetDirectories();
            foreach (DirectoryInfo item in dirs)
            {
                if (item.FullName.Contains(".svn"))
                {
                    continue;
                }

                string[] fls = System.IO.Directory.GetFiles(item.FullName);
                if (fls.Length == 0)
                {
                    continue;
                }

                SysFormTree fs = new SysFormTree();
                fs.No       = item.Name.Substring(0, item.Name.IndexOf('.'));
                fs.Name     = item.Name.Substring(item.Name.IndexOf('.'));
                fs.ParentNo = "0";
                fs.Insert();

                foreach (string f in fls)
                {
                    try
                    {
                        msg += "@开始调度表单模板文件:" + f;
                        System.IO.FileInfo info = new System.IO.FileInfo(f);
                        if (info.Extension != ".xml")
                        {
                            continue;
                        }

                        ds = new DataSet();
                        ds.ReadXml(f);

                        MapData md = MapData.ImpMapData(ds, false);
                        md.FK_FrmSort = fs.No;
                        md.Update();
                    }
                    catch (Exception ex)
                    {
                        msg += "@调度失败,文件:" + f + ",异常信息:" + ex.Message;
                    }
                }
            }
            #endregion 5.恢复表单数据.

            #region 6.恢复流程数据.
            //删除所有的流程数据.
            Flows flsEns = new Flows();
            flsEns.RetrieveAll();
            foreach (Flow fl in flsEns)
            {
                fl.DoDelete(); //删除流程.
            }

            dirInfo = new DirectoryInfo(path + "\\Flow\\");
            dirs    = dirInfo.GetDirectories();

            //删除数据.
            FlowSorts fsRoots = new FlowSorts();
            fsRoots.ClearTable();

            //生成流程树.
            FlowSort fsRoot = new FlowSort();
            fsRoot.No       = "99";
            fsRoot.Name     = "流程树";
            fsRoot.ParentNo = "0";
            fsRoot.DirectInsert();

            foreach (DirectoryInfo dir in dirs)
            {
                if (dir.FullName.Contains(".svn"))
                {
                    continue;
                }

                string[] fls = System.IO.Directory.GetFiles(dir.FullName);
                if (fls.Length == 0)
                {
                    continue;
                }

                FlowSort fs = new FlowSort();
                fs.No       = dir.Name.Substring(0, dir.Name.IndexOf('.'));
                fs.Name     = dir.Name.Substring(3);
                fs.ParentNo = fsRoot.No;
                fs.Insert();

                foreach (string filePath in fls)
                {
                    msg += "@开始调度流程模板文件:" + filePath;
                    Flow myflow = BP.WF.Flow.DoLoadFlowTemplate(fs.No, filePath, ImpFlowTempleteModel.AsTempleteFlowNo);
                    msg += "@流程:" + myflow.Name + "装载成功。";

                    System.IO.FileInfo info = new System.IO.FileInfo(filePath);
                    myflow.Name = info.Name.Replace(".xml", "");
                    if (myflow.Name.Substring(2, 1) == ".")
                    {
                        myflow.Name = myflow.Name.Substring(3);
                    }

                    myflow.DirectUpdate();
                }
            }
            #endregion 6.恢复流程数据.

            BP.DA.Log.DefaultLogWriteLineInfo(msg);

            //删除多余的空格.
            BP.WF.DTS.DeleteBlankGroupField dts = new DeleteBlankGroupField();
            dts.Do();

            //执行生成签名.
            GenerSiganture gs = new GenerSiganture();
            gs.Do();

            return(msg);
        }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "枚举值编辑";
        if (this.DoType == "Del")
        {
            MapAttrs attrs = new MapAttrs();
            attrs.Retrieve(MapAttrAttr.UIBindKey, this.RefNo);
            if (attrs.Count != 0)
            {
                this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
                this.UCSys1.Add("此枚举值已经被其它的字段所引用,您不能删除它。");
                this.UCSys1.AddH2("<a href='EnumList.aspx' >返回列表</a>");
                this.UCSys1.AddFieldSetEnd();
                return;
            }

            this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
            SysEnumMain m = new SysEnumMain(this.RefNo);
            this.UCSys1.AddH2("<a href='EnumList.aspx?RefNo=" + this.RefNo + "&DoType=DelReal' >删除:" + m.Name + " 确认.</a>");
            this.UCSys1.AddFieldSetEnd();
            return;
        }

        if (this.DoType == "DelReal")
        {
            SysEnumMain m = new SysEnumMain();
            m.No = this.RefNo;
            m.Delete();
            SysEnums ses = new SysEnums();
            ses.Delete(SysEnumAttr.EnumKey, this.RefNo);
            this.Response.Redirect("EnumList.aspx", true);
            return;
        }

        if (this.DoType == "New")
        {
            this.BindNew();
            return;
        }

        if (this.RefNo != null)
        {
            this.BindRefNo();
            return;
        }

        this.UCSys1.AddTable();
        this.UCSys1.AddCaptionLeftTX("<img src='./../../Img/Btn/Home.gif' border=0/>列表 - <a href='EnumList.aspx?DoType=New' ><img border=0 src='./../../Img/Btn/New.gif' >新建</a>");
        this.UCSys1.AddTR();
        this.UCSys1.AddTDTitle("序");
        this.UCSys1.AddTDTitle("编号");
        this.UCSys1.AddTDTitle("名称");
        this.UCSys1.AddTDTitle("信息");
        this.UCSys1.AddTDTitle("操作");
        this.UCSys1.AddTREnd();

        SysEnumMains sems = new SysEnumMains();

        sems.RetrieveAll();
        int i = 0;

        foreach (SysEnumMain se in sems)
        {
            i++;
            this.UCSys1.AddTR();
            this.UCSys1.AddTDIdx(i);
            this.UCSys1.AddTD(se.No);
            this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No, se.Name);
            this.UCSys1.AddTD(se.CfgVal);
            this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No + "&DoType=Del", "<img src='./../../Img/Btn/Delete.gif' border=0 />删除");
            this.UCSys1.AddTREnd();
        }
        this.UCSys1.AddTableEnd();
    }