Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BillTemplates templetes = new BillTemplates();

            templetes.Retrieve(BillTemplateAttr.NodeID, this.FK_Node);
            if (templetes.Count == 0)
            {
                this.WinCloseWithMsg("当前节点上没有绑定单据模板。");
                return;
            }

            if (templetes.Count == 1)
            {
                PrintDocV3(templetes[0] as BillTemplate);
                return;
            }

            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("请选择要打印的单据");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("单据编号");
            this.Pub1.AddTDTitle("单据名称");
            this.Pub1.AddTDTitle("打印");
            this.Pub1.AddTREnd();

            foreach (BillTemplate en in templetes)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTD(en.No);
                this.Pub1.AddTD(en.Name);
                this.Pub1.AddTD("<a href='PrintDoc.aspx?WorkID=" + this.WorkID + "&FK_Node=" + this.FK_Node + "&FK_Bill=" + en.No + "&FK_Flow=" + this.FK_Flow + "' >打印</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();

            if (this.FK_Bill != null)
            {
                BillTemplate templete = new BillTemplate(this.FK_Bill);

                if (templete.HisBillFileType == BillFileType.RuiLang)
                {
                    this.PrintDocV4(templete);
                }
                else
                {
                    this.PrintDocV2(templete);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建单据目录
        /// </summary>
        public override void Do()
        {
            if (true)//此方法暂时排除,不需要创建目录。
            {
                return;
            }
            Depts       Depts = new Depts();
            QueryObject qo    = new QueryObject(Depts);

            //      qo.AddWhere("Grade", " < ", 4);
            qo.DoQuery();

            BillTemplates funcs = new BillTemplates();

            funcs.RetrieveAll();


            string path = BP.WF.Glo.FlowFileBill;
            string year = DateTime.Now.Year.ToString();

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

            if (System.IO.Directory.Exists(path + "\\\\" + year) == false)
            {
                System.IO.Directory.CreateDirectory(path + "\\\\" + year);
            }


            foreach (Dept Dept in Depts)
            {
                if (System.IO.Directory.Exists(path + "\\\\" + year + "\\\\" + Dept.No) == false)
                {
                    System.IO.Directory.CreateDirectory(path + "\\\\" + year + "\\\\" + Dept.No);
                }

                foreach (BillTemplate func in funcs)
                {
                    if (System.IO.Directory.Exists(path + "\\\\" + year + "\\\\" + Dept.No + "\\\\" + func.No) == false)
                    {
                        System.IO.Directory.CreateDirectory(path + "\\\\" + year + "\\\\" + Dept.No + "\\\\" + func.No);
                    }
                }
            }
        }
        void btn_Del_Click(object sender, EventArgs e)
        {
            BillTemplate t = new BillTemplate();

            t.No = this.RefNo;
            t.Delete();

            #region 更新节点信息。
            BP.WF.Node    nd      = new BP.WF.Node(this.NodeID);
            string        Billids = "";
            BillTemplates tmps    = new BillTemplates(nd);
            foreach (BillTemplate tmp in tmps)
            {
                Billids += "@" + tmp.No;
            }
            nd.HisBillIDs = Billids;
            nd.Update();
            #endregion 更新节点信息。
            this.Response.Redirect("Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID, true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "节点单据设计"; //"节点单据设计";
            switch (this.DoType)
            {
            case "Edit":
                BillTemplate bk1 = new BillTemplate(this.RefNo);
                bk1.NodeID = this.NodeID;
                this.DoNew(bk1);
                return;

            case "New":
                BillTemplate bk = new BillTemplate();
                bk.NodeID = this.RefOID;
                this.DoNew(bk);
                return;

            case "EditType":
                EditTypes();
                return;

            default:
                break;
            }

            BillTemplates Bills = new BillTemplates(this.NodeID);

            if (Bills.Count == 0)
            {
                this.Response.Redirect("Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=New", true);
                return;
            }

            BP.WF.Node nd = new BP.WF.Node(this.NodeID);
            this.Title = nd.Name + " - " + "单据管理";  //单据管理
            this.Ucsys1.AddTable();
            if (this.RefNo == null)
            {
                this.Ucsys1.AddCaptionLeft("<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=New'><img src='../Img/Btn/New.gif' border=0/>新建</a> -<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=EditType'><img src='../Img/Btn/Edit.gif' border=0/>类别维护</a>");
            }
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("IDX");
            this.Ucsys1.AddTDTitle("编号");
            this.Ucsys1.AddTDTitle("名称");
            this.Ucsys1.AddTDTitle("操作");
            this.Ucsys1.AddTREnd();
            int i = 0;

            foreach (BillTemplate Bill in Bills)
            {
                i++;
                this.Ucsys1.AddTR();
                this.Ucsys1.AddTDIdx(i);

                this.Ucsys1.AddTD(Bill.No);
                string fileUrl = "";
                //../WorkOpt/GridEdit.aspx?grf=" +Bill.Url + ".grf&t="+DateTime.Now.ToString("yyMMddhh:mm:ss")+" target='_blank'
                if (Bill.HisBillFileType == BillFileType.RuiLang)
                {
                    string name = Bill.Url;

                    name = name.Replace('\\', '-');

                    //if (name.Split('\\').Count() > 2)
                    //{
                    //    string tempName = "";
                    //    foreach (string single in name.Split('\\'))
                    //    {
                    //        tempName += single + "-";
                    //    }
                    //    name = tempName.Substring(0, tempName.Length - 1);
                    //}
                    fileUrl = "<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID +
                              "&DoType=Edit&RefNo=" + Bill.No +
                              "'><img src='../Img/Btn/Edit.gif' border=0/编辑/a>|<a href='../../../DataUser/CyclostyleFile/" +
                              Bill.Url + ".grf'><img src='../Img/Btn/Save.gif' border=0/> 模板下载</a>|<a href='javascript:openEidt(\"" + name + "\")'  ><img src='../Img/Btn/Edit.gif' />编辑模版</a>";
                }
                else
                {
                    fileUrl = "<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID +
                              "&DoType=Edit&RefNo=" + Bill.No +
                              "'><img src='../Img/Btn/Edit.gif' border=0/编辑/a>|<a href='../../DataUser/CyclostyleFile/" +
                              Bill.Url + ".rtf'><img src='../Img/Btn/save.gif' border=0/> 模板下载</a>";
                }
                this.Ucsys1.AddTD("<img src='../Img/Btn/Word.gif' >" + Bill.Name);
                this.Ucsys1.AddTD(fileUrl);
                this.Ucsys1.AddTREnd();
            }
            this.Ucsys1.AddTableEnd();
        }
        void btn_Click(object sender, EventArgs e)
        {
            HtmlInputFile file = this.Ucsys1.FindControl("f") as HtmlInputFile;
            BillTemplate  bt   = new BillTemplate();

            bt.NodeID = this.NodeID;
            BP.WF.Node nd = new BP.WF.Node(this.NodeID);
            if (this.RefNo != null)
            {
                bt.No = this.RefNo;
                bt.Retrieve();
                bt             = this.Ucsys1.Copy(bt) as BillTemplate;
                bt.NodeID      = this.NodeID;
                bt.FK_BillType = this.Ucsys1.GetDDLByID("DDL_BillType").SelectedItemStringVal;
                if (file.Value == null || file.Value.Trim() == "")
                {
                    bt.Update();
                    this.Alert("保存成功");
                    return;
                }

                if (bt.HisBillFileType == BillFileType.RuiLang)
                {
                    if (file.Value.ToLower().Contains(".grf") == false)
                    {
                        this.Alert("@错误,非法的 grf 格式文件。");
                        return;
                    }
                }
                else
                {
                    if (file.Value.ToLower().Contains(".rtf") == false)
                    {
                        this.Alert("@错误,非法的 rtf 格式文件。");
                        return;
                    }
                }
                string temp     = "";
                string tempName = "";
                if (bt.HisBillFileType == BillFileType.RuiLang)
                {
                    tempName = "Temp.grf";
                    temp     = BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\Temp.grf";
                    file.PostedFile.SaveAs(temp);
                }
                else
                {
                    tempName = "Temp.rtf";
                    temp     = BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\Temp.rtf";
                    file.PostedFile.SaveAs(temp);
                }



                //检查文件是否正确。
                try
                {
                    string[] paras = BP.DA.Cash.GetBillParas_Gener(tempName, nd.HisFlow.HisGERpt.EnMap.Attrs);
                }
                catch (Exception ex)
                {
                    this.Ucsys2.AddMsgOfWarning("错误信息", ex.Message);
                    return;
                }
                string fullFile = FileFullPath(file.PostedFile.FileName, bt);//BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\" + bt.No + ".rtf";
                System.IO.File.Copy(temp, fullFile, true);
                bt.Update();
                return;
            }
            bt = this.Ucsys1.Copy(bt) as BillTemplate;

            if (file.Value != null)
            {
                if (bt.HisBillFileType == BillFileType.RuiLang)
                {
                    if (file.Value.ToLower().Contains(".grf") == false)
                    {
                        this.Alert("@错误,非法的 grf 格式文件。");
                        // this.Alert("@错误,非法的 rtf 格式文件。");
                        return;
                    }
                }
                else
                {
                    if (file.Value.ToLower().Contains(".rtf") == false)
                    {
                        this.Alert("@错误,非法的 rtf 格式文件。");
                        // this.Alert("@错误,非法的 rtf 格式文件。");
                        return;
                    }
                }
            }
            else
            {
                this.Alert("请上传文件。");
                // this.Alert("@错误,非法的 rtf 格式文件。");
                return;
            }

            /* 如果包含这二个字段。*/
            string fileName = file.PostedFile.FileName;

            fileName = fileName.Substring(fileName.LastIndexOf("\\") + 1);
            if (bt.Name == "")
            {
                bt.Name = fileName.Replace(".rtf", "");
                bt.Name = fileName.Replace(".grf", "");
            }

            try
            {
                bt.No = BP.Tools.chs2py.convert(bt.Name);
                if (bt.IsExits)
                {
                    bt.No = bt.No + "." + BP.DA.DBAccess.GenerOID().ToString();
                }
            }
            catch
            {
                bt.No = BP.DA.DBAccess.GenerOID().ToString();
            }
            string tmp     = "";
            string tmpName = "";

            if (bt.HisBillFileType == BillFileType.RuiLang)
            {
                tmpName = "Temp.grf";
                tmp     = BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\Temp.grf";
                file.PostedFile.SaveAs(tmp);
            }
            else
            {
                tmpName = "Temp.rtf";
                tmp     = BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\Temp.rtf";
                file.PostedFile.SaveAs(tmp);
            }


            //检查文件是否正确。
            try
            {
                string[] paras1 = BP.DA.Cash.GetBillParas_Gener(tmpName, nd.HisFlow.HisGERpt.EnMap.Attrs);
            }
            catch (Exception ex)
            {
                this.Ucsys2.AddMsgOfWarning("Error:", ex.Message);
                return;
            }

            string fullFile1 = FileFullPath(fileName, bt);//BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\" + bt.No + ".rtf";

            System.IO.File.Copy(tmp, fullFile1, true);
            // file.PostedFile.SaveAs(fullFile1);
            bt.FK_BillType = this.Ucsys1.GetDDLByID("DDL_BillType").SelectedItemStringVal;
            bt.Insert();

            #region 更新节点信息。
            string        Billids = "";
            BillTemplates tmps    = new BillTemplates(nd);
            foreach (BillTemplate Btmp in tmps)
            {
                Billids += "@" + Btmp.No;
            }
            nd.HisBillIDs = Billids;
            nd.Update();
            #endregion 更新节点信息。

            this.Response.Redirect("Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID, true);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// view work.
        /// </summary>
        public void BindTrack_ViewWork()
        {
            string appPath = this.Request.ApplicationPath;
            Track  tk      = new Track(this.FK_Flow, this.MyPK);
            Node   nd      = new Node(tk.NDFrom);
            Work   wk      = nd.HisWork;

            wk.OID = tk.WorkID;
            if (wk.RetrieveFromDBSources() == 0)
            {
                this.UCEn1.AddFieldSet("打开(" + nd.Name + ")错误");
                this.UCEn1.AddH1("当前的节点数据已经被删除!!!<br> 造成此问题出现的原因如下。");
                this.UCEn1.AddBR("1、当前节点数据被非法删除。");
                this.UCEn1.AddBR("2、节点数据是退回人与被退回人中间的节点,这部分节点数据查看不支持。");
                this.UCEn1.AddFieldSetEnd();
                return;
            }

            GenerWorkFlow gwf = new GenerWorkFlow();

            gwf.WorkID = wk.OID;
            if (gwf.RetrieveFromDBSources() == 0)
            {
            }
            else
            {
                if (gwf.FK_Node == wk.NodeID)
                {
                    this.UCEn1.AddFieldSet(wk.EnDesc);
                    this.UCEn1.AddH1("当工作(" + nd.Name + ")未完成,您不能查看它的工作日志。");
                    this.UCEn1.AddFieldSetEnd();
                    return;
                }
            }

            if (nd.HisFlow.IsMD5 && wk.IsPassCheckMD5() == false)
            {
                this.UCEn1.AddFieldSet("打开(" + nd.Name + ")错误");
                this.UCEn1.AddH1("当前的节点数据已经被篡改,请报告管理员。");
                this.UCEn1.AddFieldSetEnd();
                return;
            }

            this.UCEn1.IsReadonly = true;
            Frms frms = nd.HisFrms;

            if (frms.Count == 0)
            {
                if (nd.HisFormType == FormType.FreeForm)
                {
                    /* 自由表单 */
                    this.UCEn1.Add("<div id=divCCForm >");
                    this.UCEn1.BindCCForm(wk, "ND" + nd.NodeID, true); //, false, false, null);
                    if (wk.WorkEndInfo.Length > 2)
                    {
                        this.UCEn1.Add(wk.WorkEndInfo);
                    }
                    this.UCEn1.Add("</div>");
                }

                if (nd.HisFormType == FormType.FixForm)
                {
                    /*傻瓜表单*/
                    this.UCEn1.IsReadonly = true;
                    this.UCEn1.BindColumn4(wk, "ND" + nd.NodeID); //, false, false, null);
                    if (wk.WorkEndInfo.Length > 2)
                    {
                        this.UCEn1.Add(wk.WorkEndInfo);
                    }
                }

                BillTemplates bills = new BillTemplates();
                bills.Retrieve(BillTemplateAttr.NodeID, nd.NodeID);
                if (bills.Count >= 1)
                {
                    string title = "";
                    foreach (BillTemplate item in bills)
                    {
                        title += "<img src='/WF/Img/Btn/Word.gif' border=0/>" + item.Name + "</a>";
                    }

                    string urlr = appPath + "WF/WorkOpt/PrintDoc.aspx?FK_Node=" + nd.NodeID + "&FID=" + tk.FID + "&WorkID=" + tk.WorkID + "&FK_Flow=" + tk.FK_Flow;
                    this.UCEn1.Add("<p><a  href=\"javascript:WinOpen('" + urlr + "','dsdd');\"  />" + title + "</a></p>");
                    //this.UCEn1.Add("<a href='' target=_blank><img src='/WF/Img/Btn/Word.gif' border=0/>" + bt.Name + "</a>");
                }
            }
            else
            {
                /* 涉及到多个表单的情况...*/
                if (nd.HisFormType != FormType.DisableIt)
                {
                    Frm myfrm = new Frm();
                    myfrm.No          = "ND" + nd.NodeID;
                    myfrm.Name        = wk.EnDesc;
                    myfrm.HisFormType = nd.HisFormType;

                    FrmNode fnNode = new FrmNode();
                    fnNode.FK_Frm  = myfrm.No;
                    fnNode.IsEdit  = true;
                    fnNode.IsPrint = false;
                    switch (nd.HisFormType)
                    {
                    case FormType.FixForm:
                        fnNode.HisFrmType = FrmType.Column4Frm;
                        break;

                    case FormType.FreeForm:
                        fnNode.HisFrmType = FrmType.CCForm;
                        break;

                    case FormType.SelfForm:
                        fnNode.HisFrmType = FrmType.Url;
                        break;

                    default:
                        throw new Exception("出现了未判断的异常。");
                    }
                    myfrm.HisFrmNode = fnNode;
                    frms.AddEntity(myfrm, 0);
                }

                Int64 fid = this.FID;
                if (this.FID == 0)
                {
                    fid = tk.WorkID;
                }

                if (frms.Count == 1)
                {
                    /* 如果禁用了节点表单,并且只有一个表单的情况。*/
                    Frm     frm = (Frm)frms[0];
                    FrmNode fn  = frm.HisFrmNode;
                    string  src = "";
                    src = fn.FrmUrl + ".aspx?FK_MapData=" + frm.No + "&FID=" + fid + "&IsEdit=0&IsPrint=0&FK_Node=" + nd.NodeID + "&WorkID=" + tk.WorkID;
                    this.UCEn1.Add("\t\n <DIV id='" + frm.No + "' style='width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left;' >");
                    this.UCEn1.Add("\t\n <iframe ID='F" + frm.No + "' src='" + src + "' frameborder=0  style='position:absolute;width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left;'  leftMargin='0'  topMargin='0'  /></iframe>");
                    this.UCEn1.Add("\t\n </DIV>");
                }
                else
                {
                    #region 载入相关文件.
                    this.Page.RegisterClientScriptBlock("sg",
                                                        "<link href='./Style/Frm/Tab.css' rel='stylesheet' type='text/css' />");

                    this.Page.RegisterClientScriptBlock("s2g4",
                                                        "<script language='JavaScript' src='./Style/Frm/jquery.min.js' ></script>");

                    this.Page.RegisterClientScriptBlock("sdf24j",
                                                        "<script language='JavaScript' src='./Style/Frm/jquery.idTabs.min.js' ></script>");

                    this.Page.RegisterClientScriptBlock("sdsdf24j",
                                                        "<script language='JavaScript' src='./Style/Frm/TabClick.js' ></script>");
                    #endregion 载入相关文件.

                    this.UCEn1.Clear();
                    this.UCEn1.Add("<div  style='clear:both' ></div>");
                    this.UCEn1.Add("\t\n<div  id='usual2' class='usual' >");  //begain.

                    #region 输出标签.
                    this.UCEn1.Add("\t\n <ul  class='abc' style='background:red;border-color: #800000;border-width: 10px;' >");
                    foreach (Frm frm in frms)
                    {
                        FrmNode fn  = frm.HisFrmNode;
                        string  src = "";
                        src = fn.FrmUrl + ".aspx?FK_MapData=" + frm.No + "&FID=" + fid + "&IsEdit=0&IsPrint=0&FK_Node=" + nd.NodeID + "&WorkID=" + tk.WorkID;
                        this.UCEn1.Add("\t\n<li><a href=\"#" + frm.No + "\" onclick=\"TabClick('" + frm.No + "','" + src + "');\" >" + frm.Name + "</a></li>");
                    }
                    this.UCEn1.Add("\t\n </ul>");
                    #endregion 输出标签.

                    #region 输出表单 iframe 内容.
                    foreach (Frm frm in frms)
                    {
                        FrmNode fn = frm.HisFrmNode;
                        this.UCEn1.Add("\t\n <DIV id='" + frm.No + "' style='width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left;' >");
                        string src = "loading.htm";
                        this.UCEn1.Add("\t\n <iframe ID='F" + frm.No + "' src='" + src + "' frameborder=0  style='position:absolute;width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left;'  leftMargin='0'  topMargin='0'   /></iframe>");
                        this.UCEn1.Add("\t\n </DIV>");
                    }
                    #endregion 输出表单 iframe 内容.

                    this.UCEn1.Add("\t\n</div>"); // end  usual2

                    // 设置选择的默认值.
                    this.UCEn1.Add("\t\n<script type='text/javascript'>");
                    this.UCEn1.Add("\t\n  $(\"#usual2 ul\").idTabs(\"" + frms[0].No + "\");");
                    this.UCEn1.Add("\t\n</script>");
                }
            }
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "节点单据设计";   //"节点单据设计";
            switch (this.DoType)
            {
            case "Edit":
                BillTemplate bk1 = new BillTemplate(this.RefNo);
                bk1.NodeID = this.NodeID;
                this.DoNew(bk1);
                return;

            case "New":
                BillTemplate bk = new BillTemplate();
                bk.NodeID = this.RefOID;
                this.DoNew(bk);
                return;

            case "EditType":
                EditTypes();
                return;

            default:
                break;
            }

            BillTemplates Bills = new BillTemplates(this.NodeID);

            if (Bills.Count == 0)
            {
                this.Response.Redirect("Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=New", true);
                return;
            }

            BP.WF.Node nd = new BP.WF.Node(this.NodeID);
            this.Title = nd.Name + " - " + "单据管理";  //单据管理
            this.Ucsys1.AddTable();
            if (this.RefNo == null)
            {
                this.Ucsys1.AddCaptionLeft("<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=New'><img src='/WF/Img/Btn/New.gif' border=0/>新建</a> -<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=EditType'><img src='/WF/Img/Btn/Edit.gif' border=0/>类别维护</a>");
            }
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("IDX");
            this.Ucsys1.AddTDTitle("编号");
            this.Ucsys1.AddTDTitle("名称");
            this.Ucsys1.AddTDTitle("操作");
            this.Ucsys1.AddTREnd();
            int i = 0;

            foreach (BillTemplate Bill in Bills)
            {
                i++;
                this.Ucsys1.AddTR();
                this.Ucsys1.AddTDIdx(i);

                this.Ucsys1.AddTD(Bill.No);
                this.Ucsys1.AddTD("<img src='/WF/Img/Btn/Word.gif' >" + Bill.Name);
                this.Ucsys1.AddTD("<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=Edit&RefNo=" + Bill.No + "'><img src='/WF/Img/Btn/Edit.gif' border=0/编辑/a>|<a href='../../DataUser/CyclostyleFile/" + Bill.No + ".rtf'><img src='/WF/Img/Btn/save.gif' border=0/> 模板下载</a>");
                this.Ucsys1.AddTREnd();
            }
            this.Ucsys1.AddTableEnd();
        }
        /// <summary>
        /// 打开工作处理器,仅仅查看,不能修改。
        /// </summary>
        public void BindTrack_ViewWorkForm()
        {
            string appPath = this.Request.ApplicationPath;
            Node   nd      = null;
            Track  tk      = new Track();

            tk.FK_Flow = this.FK_Flow;
            tk.NDFrom  = this.FK_Node;

            tk.WorkID = this.WorkID;
            if (this.MyPK != null)
            {
                tk = new Track(this.FK_Flow, this.MyPK);
                nd = new Node(tk.NDFrom);
            }
            else
            {
                nd = new Node(this.FK_Node);
            }

            Flow  fl     = new Flow(this.FK_Flow);
            Int64 workid = 0;

            if (nd.HisRunModel == RunModel.SubThread)
            {
                workid = tk.FID;
            }
            else
            {
                workid = tk.WorkID;
            }

            Int64 fid = this.FID;

            if (this.FID == 0)
            {
                fid = tk.FID;
            }

            DataTable ndrpt = DBAccess.RunSQLReturnTable("SELECT PFlowNo,PWorkID FROM " + fl.PTable + " WHERE OID=" + workid);

            string urlExt = "&PFlowNo=" + ndrpt.Rows[0]["PFlowNo"] + "&PWorkID=" + ndrpt.Rows[0]["PWorkID"] + "&IsToobar=0&IsHidden=true";

            urlExt += "&From=CCFlow&TruckKey=" + tk.GetValStrByKey("MyPK");

            if (nd.HisFormType == NodeFormType.SDKForm || nd.HisFormType == NodeFormType.SelfForm)
            {
                if (nd.FormUrl.Contains("?"))
                {
                    this.Response.Redirect(nd.FormUrl + "&WorkID=" + tk.WorkID + "&FK_Node=" + nd.NodeID + "&FK_Flow=" + nd.FK_Flow + "&FID=" + fid + urlExt, true);
                }
                else
                {
                    this.Response.Redirect(nd.FormUrl + "?WorkID=" + tk.WorkID + "&FK_Node=" + nd.NodeID + "&FK_Flow=" + nd.FK_Flow + "&FID=" + fid + urlExt, true);
                }

                if (nd.HisFormType == NodeFormType.SDKForm)
                {
                    if (nd.FormUrl.Contains("?"))
                    {
                        this.Response.Redirect(nd.FormUrl + "&WorkID=" + tk.WorkID + "&FK_Node=" + nd.NodeID + "&FK_Flow=" + nd.FK_Flow + "&FID=" + fid + urlExt, true);
                    }
                    else
                    {
                        this.Response.Redirect(nd.FormUrl + "?WorkID=" + tk.WorkID + "&FK_Node=" + nd.NodeID + "&FK_Flow=" + nd.FK_Flow + "&FID=" + fid + urlExt, true);
                    }
                    return;
                }

                this.Response.Redirect(nd.FormUrl + "&WorkID=" + tk.WorkID + "&FK_Node=" + nd.NodeID + "&FK_Flow=" + nd.FK_Flow + "&FID=" + fid + urlExt, true);
                return;
            }

            Work wk = nd.HisWork;

            wk.OID = tk.WorkID;
            if (wk.RetrieveFromDBSources() == 0)
            {
                GERpt rtp = nd.HisFlow.HisGERpt;
                rtp.OID = this.WorkID;
                if (rtp.RetrieveFromDBSources() == 0)
                {
                    this.UCEn1.AddFieldSet("打开(" + nd.Name + ")错误");
                    this.UCEn1.AddH1("当前的节点数据已经被删除!!!<br> 造成此问题出现的原因如下。");
                    this.UCEn1.AddBR("1、当前节点数据被非法删除。");
                    this.UCEn1.AddBR("2、节点数据是退回人与被退回人中间的节点,这部分节点数据查看不支持。");
                    this.UCEn1.AddH1("技术信息:表" + wk.EnMap.PhysicsTable + " WorkID=" + this.WorkID);
                    this.UCEn1.AddFieldSetEnd();
                    return;
                }
                wk.Row = rtp.Row;
            }

            GenerWorkFlow gwf = new GenerWorkFlow();

            gwf.WorkID = wk.OID;

            if (nd.HisFlow.IsMD5 && wk.IsPassCheckMD5() == false)
            {
                this.UCEn1.AddFieldSet("打开(" + nd.Name + ")错误");
                this.UCEn1.AddH1("当前的节点数据已经被篡改,请报告管理员。");
                this.UCEn1.AddFieldSetEnd();
                return;
            }
            this.InitToolbar(false, appPath);
            this.UCEn1.IsReadonly = true;
            Frms frms = nd.HisFrms;

            if (frms.Count == 0)
            {
                if (nd.HisFormType == NodeFormType.FreeForm)
                {
                    MapData map = new MapData(nd.NodeFrmID);
                    /* 自由表单 */
                    Width = map.MaxRight + map.MaxLeft * 2 + 10 + "";
                    if (float.Parse(Width) < 500)
                    {
                        Width = "900";
                    }
                    Height = map.MaxEnd + "";
                    BtnLab btnLab = new BtnLab(FK_Node);

                    BtnWord = btnLab.WebOfficeEnable + "";

                    this.UCEn1.Add("<div id=divCCForm style='width:" + Width + "px;height:" + Height + "px' >");
                    this.UCEn1.BindCCForm(wk, nd.NodeFrmID, true, 0, false); //, false, false, null);
                    this.UCEn1.Add("</div>");
                }

                if (nd.HisFormType == NodeFormType.FixForm)
                {
                    MapData map = new MapData(nd.NodeFrmID);
                    if (map.TableWidth.Contains("px"))
                    {
                        Width = map.TableWidth.Replace("px", "");
                    }
                    else
                    {
                        Width = map.TableWidth + "";
                    }
                    if (map.TableWidth.Equals("100%"))
                    {
                        Width = "900";
                    }

                    this.UCEn1.Add("<div id=divCCForm style='width:" + Width + "px;height:" + map.FrmH + "px;overflow-x:scroll;' >");
                    /*傻瓜表单*/
                    this.UCEn1.IsReadonly = true;
                    this.UCEn1.BindColumn4(wk, nd.NodeFrmID); //, false, false, null);
                    //if (wk.WorkEndInfo.Length > 2)
                    //    this.UCEn1.Add(wk.WorkEndInfo);
                    this.UCEn1.Add("</div>");
                }



                BillTemplates bills = new BillTemplates();
                bills.Retrieve(BillTemplateAttr.NodeID, nd.NodeID);
                if (bills.Count >= 1)
                {
                    string title = "";
                    foreach (BillTemplate item in bills)
                    {
                        title += "<img src='/WF/Img/Btn/Word.gif' border=0/>" + item.Name + "</a>";
                    }

                    string urlr = appPath + "WF/WorkOpt/PrintDoc.aspx?FK_Node=" + nd.NodeID + "&FID=" + fid + "&WorkID=" + tk.WorkID + "&FK_Flow=" + nd.FK_Flow;
                    this.UCEn1.Add("<p><a  href=\"javascript:WinOpen('" + urlr + "','dsdd');\"  />" + title + "</a></p>");
                    //this.UCEn1.Add("<a href='' target=_blank><img src='/WF/Img/Btn/Word.gif' border=0/>" + bt.Name + "</a>");
                }
            }
            else
            {
                /* 涉及到多个表单的情况...*/
                if (nd.HisFormType == NodeFormType.SheetTree)
                {
                    Response.Redirect(appPath + "WF/FlowFormTree/FlowFormTreeView.aspx?WorkID=" + tk.WorkID + "&FK_Flow=" + nd.FK_Flow + "&FID=" + fid + "&FK_Node=" + nd.NodeID + "&CWorkID=" + this.CWorkID);
                }
                else if (nd.HisFormType != NodeFormType.DisableIt)
                {
                    Frm myfrm = new Frm();
                    myfrm.No             = "ND" + nd.NodeID;
                    myfrm.Name           = wk.EnDesc;
                    myfrm.HisFormRunType = (FormRunType)(int)nd.HisFormType;

                    FrmNode fnNode = new FrmNode();
                    fnNode.FK_Frm  = myfrm.No;
                    fnNode.IsEdit  = true;
                    fnNode.IsPrint = false;
                    switch (nd.HisFormType)
                    {
                    case NodeFormType.FixForm:
                        fnNode.HisFrmType = FrmType.Column4Frm;
                        break;

                    case NodeFormType.FreeForm:
                        fnNode.HisFrmType = FrmType.FreeFrm;
                        break;

                    case NodeFormType.SelfForm:
                        fnNode.HisFrmType = FrmType.Url;
                        break;

                    default:
                        throw new Exception("出现了未判断的异常。");
                    }
                    myfrm.HisFrmNode = fnNode;
                    frms.AddEntity(myfrm, 0);
                }
                if (frms.Count == 1)
                {
                    /* 如果禁用了节点表单,并且只有一个表单的情况。*/
                    Frm     frm = (Frm)frms[0];
                    FrmNode fn  = frm.HisFrmNode;
                    string  src = "";
                    src = fn.FrmUrl + ".aspx?FK_MapData=" + frm.No + "&FID=" + fid + "&IsEdit=0&IsPrint=0&FK_Node=" + nd.NodeID + "&WorkID=" + tk.WorkID + "&CWorkID=" + this.CWorkID;
                    this.UCEn1.Add("\t\n <DIV id='" + frm.No + "' style='width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left; background-color:white;margin:0;padding:0;' >");
                    this.UCEn1.Add("\t\n <iframe ID='F" + frm.No + "' src='" + src + "' frameborder=0  style='margin:0;padding:0;width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left;'  leftMargin='0'  topMargin='0'  /></iframe>");
                    this.UCEn1.Add("\t\n </DIV>");
                }
                else
                {
                    Frm frmFirst = null;
                    foreach (Frm frm in frms)
                    {
                        if (frmFirst == null)
                        {
                            frmFirst = frm;
                        }

                        if (frmFirst.FrmW < frm.FrmW)
                        {
                            frmFirst = frm;
                        }
                    }

                    #region 载入相关文件.
                    this.Page.RegisterClientScriptBlock("sg",
                                                        "<link href='./Style/Frm/Tab.css' rel='stylesheet' type='text/css' />");

                    this.Page.RegisterClientScriptBlock("s2g4",
                                                        "<script language='JavaScript' src='./Style/Frm/jquery.min.js' ></script>");

                    this.Page.RegisterClientScriptBlock("sdf24j",
                                                        "<script language='JavaScript' src='./Style/Frm/jquery.idTabs.min.js' ></script>");

                    this.Page.RegisterClientScriptBlock("sdsdf24j",
                                                        "<script language='JavaScript' src='./Style/Frm/TabClick.js' ></script>");
                    #endregion 载入相关文件.

                    this.UCEn1.Clear();
                    this.UCEn1.Add("<div  style='clear:both' ></div>");                                                                                             //
                    this.UCEn1.Add("\t\n<div  id='usual2' class='usual' style='width:" + frmFirst.FrmW + "px;height:auto;margin:0 auto;background-color:white;'>"); //begain.

                    #region 输出标签.
                    this.UCEn1.Add("\t\n <ul  class='abc' style='background:red;border-color: #800000;border-width: 10px;' >");
                    foreach (Frm frm in frms)
                    {
                        FrmNode fn  = frm.HisFrmNode;
                        string  src = "";
                        src = fn.FrmUrl + ".aspx?FK_MapData=" + frm.No + "&FID=" + fid + "&IsEdit=0&IsPrint=0&FK_Node=" + nd.NodeID + "&WorkID=" + tk.WorkID + "&CWorkID=" + this.CWorkID + "&FK_Flow=" + this.FK_Flow;//edited by liuxc,2015-6-17
                        this.UCEn1.Add("\t\n<li><a href=\"#" + frm.No + "\" onclick=\"TabClick('" + frm.No + "','" + src + "');\" >" + frm.Name + "</a></li>");
                    }
                    this.UCEn1.Add("\t\n </ul>");
                    #endregion 输出标签.


                    #region 输出表单 iframe 内容.
                    foreach (Frm frm in frms)
                    {
                        FrmNode fn = frm.HisFrmNode;
                        this.UCEn1.Add("\t\n <DIV id='" + frm.No + "' style='width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left;margin:0px;padding:0px;' >");
                        string src = "loading.htm";
                        this.UCEn1.Add("\t\n <iframe ID='F" + frm.No + "' src='" + src + "' frameborder=0  style='margin:0px;padding:0px;width:" + frm.FrmW + "px; height:" + frm.FrmH + "px;text-align: left;'  leftMargin='0'  topMargin='0'   /></iframe>");
                        this.UCEn1.Add("\t\n </DIV>");
                    }
                    #endregion 输出表单 iframe 内容.

                    this.UCEn1.Add("\t\n</div>"); // end  usual2

                    // 设置选择的默认值.
                    this.UCEn1.Add("\t\n<script type='text/javascript'>");
                    this.UCEn1.Add("\t\n  $(\"#usual2 ul\").idTabs(\"" + frms[0].No + "\");");
                    this.UCEn1.Add("\t\n</script>");
                }
            }
        }