Esempio n. 1
0
        /// <summary>
        /// 复制程序文件
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="stepName"></param>
        /// <param name="receiveUserID"></param>
        /// <param name="p_strProcessID"></param>
        /// <param name="p_strWorkItemID"></param>
        /// <returns></returns>
        private bool CopyProgramFileInfo(String ID, String p_strStepName, String p_strUserID, String p_strProcessID, String p_strWorkItemID, String p_strPoolID)
        {
            try
            {
                //选择的实体
                B_PF selectEntity = new B_PF();
                selectEntity.ID = int.Parse(ID); //ID赋值时自动装载实体

                //新实体
                B_PF newEntity = new B_PF();
                selectEntity.Clone(newEntity); //克隆实体
                newEntity.WorkItemID = p_strWorkItemID;

                //其他不同的属性
                newEntity.StepName      = p_strStepName;                                        //步骤
                newEntity.ReceiveUserID = p_strUserID;                                          //接收用户
                newEntity.D_StepStatus  = String.IsNullOrEmpty(p_strPoolID) ? "Assign" : "New"; //公办:New 其他:Assign
                return(newEntity.Save());
            }
            catch (Exception ex)
            {
                String e = ex.ToString();
                return(false);
            }
        }
Esempio n. 2
0
        private void SetBaseExportData(UC_Print ucPrint, B_PF cEntity)
        {
            //ucPrint.AttachFileList = cEntity.FileList;
            //ucPrint.Position = "主题词:";//(string)ucPrint.ExportData[2];
            //ucPrint.Mode = WriteMode.Up;

            ucPrint.ExportData.Add(cEntity.ApplyStyle);    //<col>申请类型:|right</col>
            //ucPrint.ExportData.Add(cEntity.ApplyReason);    //<col>申请原因:|right</col>
            //ucPrint.ExportData.Add(cEntity.RelationProgram);    //<col>可能受影响程序:|right</col>
            ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>程序名称:|right</col>
            ucPrint.ExportData.Add(cEntity.ProgramCode);   //<col>编码:|right</col>
            ucPrint.ExportData.Add(cEntity.Edition);       //<col>版次:|right</col>
        }
        private void Print_OnBeginExport(object sender, EventArgs e)
        {
            if (m_print == null || m_print.m_ls == null || m_print.m_ls.Count == 0)
            {
                return;
            }
            Print print = new Print();

            m_Entity            = m_print.m_CurrEntity as B_PF;
            m_Entity.ProcessID  = base.ProcessID;
            m_Entity.WorkItemID = base.WorkItemID;
            print.SetPrintBeginExport(m_print, m_Entity);
        }
        private string GetLastDate(UC_Print ucPrint, string StepName)
        {
            string sLastDate = "";

            if (base.IsPreview == false &&
                base.StepName == StepName &&
                B_PF.GetComment(base.ProcessID, base.WorkItemID, StepName).Rows.Count > 0)
            {
                sLastDate = ucPrint.CheckDateTime(B_PF.GetComment(base.ProcessID, base.WorkItemID, StepName).Rows[0]["FinishTime"].ToString());
            }

            return(sLastDate);
        }
Esempio n. 5
0
        protected void gvProgramFileList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowType != DataControlRowType.Footer && e.Row.RowType != DataControlRowType.Header)
            {
                FSLinkButton lnkbtnRestart = (FSLinkButton)e.Row.Cells[RESTART].FindControl("lnkbtnRestart");
                if (!B_PF.IsExistProgramFile(e.Row.Cells[KEY_ID].Text.ToString()) && !string.IsNullOrEmpty(e.Row.Cells[EDITION].Text.Replace("&nbsp;", "").Trim()))
                {
                    lnkbtnRestart.Visible = e.Row.Cells[ARCHIVESTATE].Text.Equals(ConstString.ProgramFile.PROGRAM_ARCHIVED) ||
                                            e.Row.Cells[ARCHIVESTATE].Text.Equals(ConstString.ProgramFile.PROGRAM_LOGOUT) ? false : true;

                    if (!string.IsNullOrEmpty(e.Row.Cells[FILES].Text.Replace("&nbsp;", "").ToString()))
                    {
                        lnkbtnRestart.Visible       = true;
                        lnkbtnRestart.Text          = "附件下载";
                        lnkbtnRestart.OnClientClick = "OpenDetailDialog(" + e.Row.Cells[KEY_ID].Text + ");";
                    }
                }//流程表中不存在程序文件并且版次不为空(未发起流程)
                //else if (!string.IsNullOrEmpty(e.Row.Cells[Files].Text.Replace("&nbsp;", "").ToString()))
                //{
                //    lnkbtnRestart.Visible = true;
                //    lnkbtnRestart.Text = "附件下载";
                //    lnkbtnRestart.OnClientClick = "OpenDetailDialog(" + e.Row.Cells[ID].Text + ");";
                //}
                else
                {
                    if (!string.IsNullOrEmpty(e.Row.Cells[FILES].Text.Replace("&nbsp;", "").ToString()))
                    {
                        lnkbtnRestart.Visible       = true;
                        lnkbtnRestart.Text          = "附件下载";
                        lnkbtnRestart.OnClientClick = "OpenDetailDialog(" + e.Row.Cells[KEY_ID].Text + ");";
                    }
                    else
                    {
                        lnkbtnRestart.Visible = false;
                    }

                    LinkButton lnkbtnCancel = e.Row.Cells[RESTART].FindControl("lnkbtnCancel") as LinkButton;

                    //已发起流程并且程序状态为“未完成”则显示撤销流程,否则不可撤销
                    if (e.Row.Cells[ARCHIVESTATE].Text != ConstString.ProgramFile.PROGRAM_ARCHIVED &&
                        string.IsNullOrEmpty(Server.HtmlDecode(e.Row.Cells[ARCHIVESTATE].Text).Trim()) == false)
                    {
                        lnkbtnCancel.Visible = true;
                    }
                    else
                    {
                        lnkbtnCancel.Visible = false;
                    }
                }
            }
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"].ToString()))
                {
                    B_PF pfEntity = new B_PF();
                    pfEntity.ID = int.Parse(Request.QueryString["ID"].ToString());

                    pfEntity = pfEntity.GetPFEntity(pfEntity.ID.ToString());
                    switch (Server.UrlDecode(Request.QueryString["column"].ToString().Trim()))
                    {
                    //case ProcessConstString.StepName.ProgramFile.STEP_WRITE:
                    //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.WriteComment);
                    //    break;
                    //case ProcessConstString.StepName.ProgramFile.STEP_CHECK:
                    //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.CheckComment);
                    //    break;
                    //case ProcessConstString.StepName.ProgramFile.STEP_AUDIT:
                    //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.AuditComment);
                    //    break;
                    //case ProcessConstString.StepName.ProgramFile.STEP_APPROVE:
                    //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.ApproveComment);
                    //    break;
                    //case ProcessConstString.StepName.ProgramFile.STEP_QG:
                    //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.QualityComment);
                    //    break;
                    case ProcessConstString.StepName.ProgramFile.STEP_WRITE:
                        lblInfo.Text = pfEntity.WriteComment;
                        break;

                    case ProcessConstString.StepName.ProgramFile.STEP_CHECK:
                        lblInfo.Text = pfEntity.CheckComment;
                        break;

                    case ProcessConstString.StepName.ProgramFile.STEP_AUDIT:
                        lblInfo.Text = pfEntity.AuditComment;
                        break;

                    case ProcessConstString.StepName.ProgramFile.STEP_APPROVE:
                        lblInfo.Text = pfEntity.ApproveComment;
                        break;

                    case ProcessConstString.StepName.ProgramFile.STEP_QG:
                        lblInfo.Text = pfEntity.QualityComment;
                        break;
                    }
                }
            }
        }
        private string GetPFComment(string StepName, string StepComment)
        {
            string sComment = "";

            if (base.IsPreview == false &&
                base.StepName == StepName &&
                !string.IsNullOrEmpty(StepComment))
            {
                sComment = StepComment + "\r\n" + B_PF.GetNotionComment(base.ProcessID, StepName);
            }
            else
            {
                sComment = B_PF.GetNotionComment(base.ProcessID, StepName);
            }
            return(sComment);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"].ToString()))
                {
                    B_PF pfEntity = new B_PF();
                    pfEntity.ID = int.Parse(Request.QueryString["ID"].ToString());

                    pfEntity = pfEntity.GetPFEntity(pfEntity.ID.ToString());
                    switch (Server.UrlDecode(Request.QueryString["column"].ToString().Trim()))
                    {
                        //case ProcessConstString.StepName.ProgramFile.STEP_WRITE:
                        //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.WriteComment);
                        //    break;
                        //case ProcessConstString.StepName.ProgramFile.STEP_CHECK:
                        //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.CheckComment);
                        //    break;
                        //case ProcessConstString.StepName.ProgramFile.STEP_AUDIT:
                        //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.AuditComment);
                        //    break;
                        //case ProcessConstString.StepName.ProgramFile.STEP_APPROVE:
                        //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.ApproveComment);
                        //    break;
                        //case ProcessConstString.StepName.ProgramFile.STEP_QG:
                        //    lblInfo.Text = SysString.TextToHtmlCode(pfEntity.QualityComment);
                        //    break;
                        case ProcessConstString.StepName.ProgramFile.STEP_WRITE:
                            lblInfo.Text = pfEntity.WriteComment;
                            break;
                        case ProcessConstString.StepName.ProgramFile.STEP_CHECK:
                            lblInfo.Text = pfEntity.CheckComment;
                            break;
                        case ProcessConstString.StepName.ProgramFile.STEP_AUDIT:
                            lblInfo.Text = pfEntity.AuditComment;
                            break;
                        case ProcessConstString.StepName.ProgramFile.STEP_APPROVE:
                            lblInfo.Text = pfEntity.ApproveComment;
                            break;
                        case ProcessConstString.StepName.ProgramFile.STEP_QG:
                            lblInfo.Text = pfEntity.QualityComment;
                            break;
                    }

                }
            }
        }
        private void ucPrint_OnAttachExport(object sender, EventArgs e)
        {
            UC_Print ucPrint = sender as UC_Print;
            Print    print   = new Print();
            B_PF     cEntity = null;

            //SetEntity(cEntity);
            if (base.IsPreview)
            {
                cEntity = base.EntityData != null ? base.EntityData as B_PF : new B_PF();
            }
            else
            {
                cEntity = this.ControlToEntity(false) as B_PF;
            }
            print.SetPrintAttachExport(ucPrint, cEntity);
        }
Esempio n. 10
0
 public void SetPrintAttachExport(UC_Print ucPrint, B_PF cEntity)
 {
     switch (ucPrint.FileName)
     {
         case "程序文件表单":
             //ucPrint.WriteContent("主题词:", WriteMode.Up, 1);
             //ucPrint.WriteAttach();
             break;
         case "管理程序变更申请表":
             ucPrint.WriteAttach();
             break;
         case "管理程序封面模板":
             ucPrint.WriteAttach();
             break;
         case "程序审查意见落实表":
             ucPrint.WriteAttach();
             break;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string processID = string.Empty;
                string stepName = string.Empty;
                string workItemID = string.Empty;
                string userID = string.Empty;
                string deptID = string.Empty;

                if (Request.QueryString["processID"] == null)
                { return; }
                else
                { processID = Request.QueryString["processID"].ToString(); }

                if (Request.QueryString["workItemID"] == null)
                { return; }
                else
                { workItemID = Request.QueryString["workItemID"].ToString(); }

                if (Request.QueryString["stepName"] == null)
                { return; }
                else
                { stepName = Request.QueryString["stepName"].ToString(); }

                if (Request.QueryString["userID"] == null)
                { return; }
                else
                { userID = Server.UrlDecode(Request.QueryString["userID"].ToString()); }

                if (Request.QueryString["deptID"] == null)
                { return; }
                else
                { deptID = Request.QueryString["deptID"].ToString(); }

                B_PF bllProFile = new B_PF();

                rptComment.DataSource = bllProFile.GetSignComment(processID, workItemID, stepName, userID, deptID);
                rptComment.DataBind();
            }
        }
        private void ucPrint_OnBeginExport(object sender, EventArgs e)
        {
            UC_Print ucPrint = sender as UC_Print;
            Print    print   = new Print();
            B_PF     cEntity = null;

            //SetEntity(cEntity);
            if (base.IsPreview)
            {
                cEntity = base.EntityData != null ? base.EntityData as B_PF : new B_PF();
            }
            else
            {
                cEntity = this.ControlToEntity(false) as B_PF;
            }
            cEntity.ProcessID  = base.ProcessID;
            cEntity.WorkItemID = base.WorkItemID;


            print.SetPrintBeginExport(ucPrint, cEntity);
        }
Esempio n. 13
0
        public void SetPrintAttachExport(UC_Print ucPrint, B_PF cEntity)
        {
            switch (ucPrint.FileName)
            {
            case "程序文件表单":
                //ucPrint.WriteContent("主题词:", WriteMode.Up, 1);
                //ucPrint.WriteAttach();
                break;

            case "管理程序变更申请表":
                ucPrint.WriteAttach();
                break;

            case "管理程序封面模板":
                ucPrint.WriteAttach();
                break;

            case "程序审查意见落实表":
                ucPrint.WriteAttach();
                break;
            }
        }
Esempio n. 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strProcessID = string.Empty;
                string strStepName  = string.Empty;
                string strWorkItem  = string.Empty;

                if (Request.QueryString["processID"] == null)
                {
                    return;
                }
                else
                {
                    strProcessID = Request.QueryString["processID"].ToString();
                }

                if (Request.QueryString["WorkItemID"] == null)
                {
                    return;
                }
                else
                {
                    strWorkItem = Request.QueryString["WorkItemID"].ToString();
                }

                if (Request.QueryString["stepName"] == null)
                {
                    return;
                }
                else
                {
                    strStepName = Request.QueryString["stepName"].ToString();
                }

                rptComment.DataSource = B_PF.GetComment(strProcessID, strWorkItem, strStepName);
                rptComment.DataBind();
            }
        }
        private string Devolve2DC(HN_OA2DC oaDev, B_PF enProFile, string strDraftDept, string dealUser, string sProcessName)
        {
            string sXml = "";

            FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode();
            FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode    fl = new HNDC_CFileNode();

            #region 开始生成Archive节点
            ar.System = "OA_" + base.IdentityID.ToString();
            string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            switch (ObjPlatForm)
            {
            case "DC":
                ar.SysFlag = "1";
                break;

            case "FC":
                ar.SysFlag = "2";
                break;

            default:
                ar.SysFlag = "1";
                break;
            }


            // 文件编码-程序编码
            ar.Code = enProFile.ProgramCode;
            // 编制单位-主办部门
            ar.FormationDept = strDraftDept;
            // 题名-程序名称
            ar.Title = enProFile.DocumentTitle;
            // 功能领域-程序子类
            ar.FunctionField = B_ProgramFileInfo.GetProSubTypeName(enProFile.ProgramFileID);
            // 版本-版次
            ar.Revision = enProFile.Edition;
            // 页数-总页数
            ar.DocPages = enProFile.TextPageSum;
            // 批准者-批准操作人
            ar.Authorizer = enProFile.ApproveName;
            // 生效日期-批准日期
            ar.AuthorizeTime = CheckDateTime(enProFile.ApproveDate.ToString());
            // 审核者-审核操作人
            ar.Auditby = enProFile.AuditName;
            // 审核日期-审核日期
            ar.AuditDate = CheckDateTime(enProFile.AuditDate.ToString());
            // 校核者-校核操作人
            ar.Checkthose = enProFile.CheckName;
            // 校核日期-校核日期
            ar.CheckDate = CheckDateTime(enProFile.CheckDate.ToString());
            // 编制人-编制操作人
            ar.Author = enProFile.WriteName;
            // 编制日期-编制日期
            ar.FormationTime = CheckDateTime(enProFile.WriteDate.ToString());


            //ar.FK_CategoryID = "903";
            // 公共常量
            //ar.GatherLevel = "件";
            //ar.D_StorageCarrierType = "纸质";
            //ar.Amount = "1";
            //ar.D_Language = "中文";
            ar.ElectronicDocumentCount = enProFile.FileList.Count.ToString();
            #endregion
            sXml = oaDev.GenOAArchiveNode(ar, sProcessName);

            /****开始生成File节点************************************************************************/
            #region 开始生成File节点
            fl.AuthorizeTime   = ar.AuthorizeTime;
            fl.Code            = ar.Code;
            fl.Code19          = ar.Code19;
            fl.D_FileStatus    = ar.D_FileStatus;
            fl.DocCodesExplain = "";
            fl.DocPages        = ar.DocPages;
            fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime;
            fl.Ext_1         = ar.Ext_1;
            fl.Ext_2         = ar.Ext_2;
            fl.Ext_3         = ar.Ext_3;
            fl.Ext_4         = ar.Ext_4;
            fl.Ext_5         = ar.Ext_5;
            fl.Title         = ar.Title;
            fl.FK_ArchiveID  = ar.FK_Archive;
            fl.FK_CategoryID = ar.FK_CategoryID;
            fl.FormationDept = ar.FormationDept;
            fl.FormationTime = ar.FormationTime;
            fl.Importer      = ar.Importer;
            fl.ImporterTime  = ar.ImporterTime;
            fl.OriginalID    = ar.OriginalID;
            fl.OtherTitle    = ar.OtherTitle;
            fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime;
            fl.RelatedCode = ar.RelatedCode;
            fl.Revision    = ar.Revision;
            #endregion
            sXml = oaDev.GenOAFileNode(fl);
            /****完成生成File节点************************************************************************/

            #region 始生成Attachment节点
            /****开始生成Attachment节点******************************************************************/
            string sServerWeb = oaDev.GetCfgNodeValues("/Devolve/Other/ServerWeb");
            //"http://172.29.128.239";
            //string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName");
            for (int i = 0; i < enProFile.FileList.Count; i++)
            {
                HNDC_CAttachmentNode at = new HNDC_CAttachmentNode();
                CFuJian file            = enProFile.FileList[i];

                at.DocumentName  = ProcessConstString.TemplateName.PROGRAM_FILE; //file.FileName;
                at.FK_FileID     = "";
                at.MakeDate      = "";
                at.MakeUnit      = "";
                at.PublishedTime = "";
                at.Remark        = "";

                at.ServerWeb = sServerWeb;
                Double iSize = 0;
                string sSize = file.Size.ToUpper();
                if (sSize.Contains("K"))
                {
                    sSize = sSize.Replace("K", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024;
                }
                if (sSize.Contains("M"))
                {
                    sSize = sSize.Replace("M", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024 * 1024;
                }
                at.Size     = ((int)iSize).ToString();
                at.TimeSize = "";
                at.Title    = file.Alias;
                at.Type     = file.Type;
                at.Url      = file.URL;

                sXml = oaDev.GenOAAttachmentNode(fl.FK_ArchiveID, at);
            }
            #endregion
            /****完成生成Attachment节点******************************************************************/

            return(sXml);
        }
        /// <summary>
        /// 程序文件 交办动作处理 
        /// </summary>
        /// <param name="p_strActionName"></param>
        /// <param name="entity"></param>
        protected ReturnInfo FormSubmitForProFile(Boolean bIsSave, String strActionName, String strParentTbID, String strStepStatus, EntityBase entity)
        {
            User l_objUser = null;
            ReturnInfo l_objReturnInfo = FormSave.SaveEntity(entity, this, bIsSave, this.SubAction, this.TemplateName);

            if (!l_objReturnInfo.IsSucess)
            {
                this.ShowMsgBox(this.Page, MsgType.VbExclamation, "表单保存出错,后续操作不能进行!" + l_objReturnInfo.ErrMessage);
                return l_objReturnInfo;
            }

            if (!bIsSave)
            {
                //处理交办人相关信息
                if (String.IsNullOrEmpty(strParentTbID))
                {
                    DataTable dt = B_PF.GetNextWorkItemIdForAssign(base.ProcessID);//当前ProcessID 父流程ID
                    EntityBase entitybase = base.EntityData != null ? base.EntityData : new EntityBase();
                    entitybase.AgentUserID = String.Empty;
                    entitybase.AgentUserName = String.Empty;
                    EntityBase entitybase2 = EntityFactory.CreateEntity2(base.TemplateName); ;
                    base.EntityData.Clone(entitybase2);
                    entitybase2.AgentUserID = String.Empty;
                    entitybase2.AgentUserName = String.Empty;

                    entitybase2.ProcessID = dt.Rows[0]["PROC_INST_ID"].ToString();
                    entitybase.ProcessID = dt.Rows[0]["PROC_INST_ID"].ToString();

                    entitybase2.WorkItemID = dt.Rows[0]["WORK_ITEM_ID"].ToString();
                    entitybase.WorkItemID = dt.Rows[0]["WORK_ITEM_ID"].ToString();

                    entitybase2.D_StepStatus = dt.Rows[0]["STATUS"].ToString();
                    entitybase.D_StepStatus = dt.Rows[0]["STATUS"].ToString();

                    entitybase2.ReceiveUserID = dt.Rows[0]["USER_ID"].ToString();
                    entitybase.ReceiveUserID = dt.Rows[0]["USER_ID"].ToString();

                    entitybase2.StepName = dt.Rows[0]["NAME"].ToString();
                    entitybase.StepName = dt.Rows[0]["NAME"].ToString();

                    entitybase2.SubmitAction = strActionName;
                    entitybase.SubmitAction = strActionName;

                    //接收人姓名
                    l_objUser = OAUser.GetUser(entitybase.ReceiveUserID);
                    if (l_objUser != null)
                    {
                        entitybase2.ReceiveUserName = l_objUser.Name;
                        entitybase.ReceiveUserName = l_objUser.Name;
                    }

                    entitybase2.FormsData = XmlUtility.SerializeXml(entitybase);
                    if (!entitybase2.Save())
                    {
                        l_objReturnInfo.IsSucess = false;
                        l_objReturnInfo.ErrMessage = SysString.GetErrorMsgs(entitybase2.ErrMsgs);

                        ILogger log = LoggerFactory.GetLogger(LogType.TxtFile, @"Log", "程序文件");
                        log.WriteLog("保存实体出错:" + l_objReturnInfo.ErrMessage);

                        return l_objReturnInfo;
                    }
                }//新增协助会签节点数据
                else
                {
                    B_PF pfEntity = new B_PF();
                    pfEntity.ID = int.Parse(strParentTbID);
                    pfEntity = XmlUtility.DeSerializeXml<B_PF>(pfEntity.FormsData);
                    pfEntity.ID = int.Parse(strParentTbID);
                    //清空子流程ProcessID,用于标识当部门领导自己提交表单撤销子流程(如果不为空,则需要注销子流程)
                    pfEntity.ChildProcessID = String.Empty;
                    pfEntity.AssistContent = (entity as B_PF).AssistContent;
                    pfEntity.FormsData = XmlUtility.SerializeXml(pfEntity);//.Replace("<ID>" + pfEntity.ID + "</ID>", "<ID>" + int.MinValue.ToString() + "</ID>");
                    if (!pfEntity.Save())
                    {
                        throw new Exception(pfEntity.ErrMsgs.ToString());
                    }
                    WorkFlowBase.CompleteWorkItem(base.WorkItemID, null);
                }//更新交办会签节点数据
            }

            l_objReturnInfo.IsSucess = true;
            return l_objReturnInfo;
        }
        private void DoWorkItem(Hashtable p_nvAttributes, Boolean p_blnIsProcessCreated)
        {
            B_FormsData l_busFormsData = null;
            try
            {
                if (!p_blnIsProcessCreated)
                {
                    //创建流程
                    WorkFlowBase.CreateProcess(this.TemplateName, this.ProcessID, p_nvAttributes);

                    //获取第一个节点并且完成。
                    l_busFormsData = new B_FormsData();
                    this.WorkItemID = l_busFormsData.GetFirstWorkItemID(this.ProcessID);

                    UpdateDBWorkItem(this.WorkItemID, true, "", "", "", this.StepName, true);

                    if (base.TemplateName.Contains("收文"))
                    {
                        WorkFlowBase.CompleteWorkItem(this.WorkItemID, p_nvAttributes);//完成第一个节点
                    }
                    if (base.TemplateName.Contains("会务费用报销单") || base.TemplateName.Contains("招待费报销单"))
                    {
                        WorkFlowBase.CompleteWorkItem(this.WorkItemID, p_nvAttributes);//完成第一个节点
                    }
                }
                else
                {
                    WorkFlowBase.CompleteWorkItem(this.WorkItemID, p_nvAttributes);//完成当前节点

                    if (base.TemplateName == ProcessConstString.TemplateName.PROGRAM_FILE &&
                       (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_DEPTSIGN ||
                        base.StepName == ProcessConstString.StepName.ProgramFile.STEP_LEADERSIGN))
                    {
                        EntityBase entitybase = ControlToEntity(false);

                        B_PF pfEntity = entitybase != null ? entitybase as B_PF : new B_PF();
                        List<String> strIDs = B_FormsData.GetMultiParapllelInfo(TableName.WorkItemsTableName.T_OA_HN_PF_WorkItems, base.ProcessID, base.StepName, pfEntity.TimesFlag);
                        foreach (String strID in strIDs)
                        {
                            B_PF entity = new B_PF();
                            //更新其它会签记录
                            entity.ID = Convert.ToInt32(strID);
                            entity = XmlUtility.DeSerializeXml<B_PF>(entity.FormsData);
                            entity.ID = Convert.ToInt32(strID);
                            entity.LeaderSignList = pfEntity.LeaderSignList;//领导已会签意见内容
                            entity.DeptSignList = B_PF.GetDeptSignList(entity.DeptSignList, strIDs);//部门已会签意见内容
                            entity.IsSignReject = pfEntity.IsSignReject;//是否否决

                            if (entity.WorkItemID == pfEntity.WorkItemID)
                            {
                                entity.D_StepStatus = "Completed";
                                entity.SubmitAction = this.SubAction;
                                entity.CommentList = pfEntity.CommentList;
                                //entity.DeptSignList = B_PF.GetDeptSignList(entity.DeptSignList, strIDs);
                            }//更新当前节点用户
                            entity.FormsData = XmlUtility.SerializeXml(entity);
                            if (!entity.Save())
                            {
                                throw new Exception(entity.ErrMsgs.ToString());
                            }
                        }
                        pfEntity.ID = int.MinValue;//清空ID
                    }

                    if (base.TemplateName == ProcessConstString.TemplateName.AFFILIATION &&
                       (base.StepName == ProcessConstString.StepName.WorkRelationStepName.STEP_DEPTSIGN))
                    {
                        EntityBase entitybase = ControlToEntity(false);

                        B_WorkRelation wrEntity = entitybase != null ? entitybase as B_WorkRelation : new B_WorkRelation();
                        List<String> strIDs = B_FormsData.GetMultiParapllelInfo(TableName.WorkItemsTableName.T_OA_WR_WorkItems, base.ProcessID, base.StepName, wrEntity.TimesFlag);
                        foreach (String strID in strIDs)
                        {
                            B_WorkRelation entity = new B_WorkRelation();
                            //更新其它会签记录
                            entity.ID = Convert.ToInt32(strID);
                            entity = XmlUtility.DeSerializeXml<B_WorkRelation>(entity.FormsData);
                            entity.ID = Convert.ToInt32(strID);
                            entity.DeptSignList = B_WorkRelation.GetDeptSignList(entity.DeptSignList, strIDs);//部门已会签意见内容
                            entity.IsSignReject = wrEntity.IsSignReject;//是否否决

                            if (entity.WorkItemID == wrEntity.WorkItemID)
                            {
                                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_SUBMIT)
                                {
                                    entity.D_StepStatus = "Completed";
                                }
                                entity.SubmitAction = this.SubAction;
                                entity.CommentList = wrEntity.CommentList;
                            }//更新当前节点用户
                            entity.FormsData = XmlUtility.SerializeXml(entity);
                            if (!entity.Save())
                            {
                                throw new Exception(entity.ErrMsgs.ToString());
                            }
                        }
                        wrEntity.ID = int.MinValue;//清空ID
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private ArrayList GeneratorTableData(int TblIndex, B_PF cEntity)//任金权 修改
        {
            ArrayList al = new ArrayList();
            B_PF      pf = new B_PF();

            switch (TblIndex)
            {
            case 2:
                List <M_ProgramFile.DeptSign> Dhqlist = new List <M_ProgramFile.DeptSign>();
                Dhqlist = this.ucBuMenHuiQian.UCGetHQList();
                for (int i = 0; i < Dhqlist.Count; i++)
                {
                    M_ProgramFile.DeptSign item = Dhqlist[i];
                    foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_DEPTSIGN, item.ID, string.Empty))
                    {
                        ArrayList tmp = new ArrayList();
                        tmp.Add(item.DeptName);
                        tmp.Add(yijian.Content);
                        tmp.Add(yijian.DealCondition);
                        al.Add(tmp);
                    }
                }
                ArrayList tmpEx                = new ArrayList();
                string    lsqkdeptyijian       = string.Empty;
                string    lsqkdeptyijianluoshi = string.Empty;
                foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_QG, this.wfQualityIDs.Text, string.Empty))
                {
                    //lsqkdeptyijian += yijian.Content + "\r\a";
                    //lsqkdeptyijianluoshi += yijian.DealCondition + "\r\a";
                    tmpEx = new ArrayList();
                    tmpEx.Add("质量保证处");
                    tmpEx.Add(yijian.Content);
                    tmpEx.Add(yijian.DealCondition);
                    al.Add(tmpEx);
                }
                break;

            case 3:
                List <M_ProgramFile.LeaderSign> lhqlist = new List <M_ProgramFile.LeaderSign>();
                lhqlist = this.ucLDHuiQian.UCGetHQList();
                for (int i = 0; i < lhqlist.Count; i++)
                {
                    M_ProgramFile.LeaderSign item = lhqlist[i];
                    foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_LEADERSIGN, item.ID, string.Empty))
                    {
                        ArrayList tmp = new ArrayList();
                        tmp.Add(yijian.UserName);
                        tmp.Add(yijian.Content);
                        tmp.Add(yijian.DealCondition);
                        al.Add(tmp);
                    }
                }
                tmpEx = new ArrayList();
                string lsqkpeopleyijian       = string.Empty;
                string lsqkpeopleyijianluoshi = string.Empty;
                if (!string.IsNullOrEmpty(this.ddlApprove.SelectedValue))
                {
                    foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_APPROVE, this.ddlApprove.SelectedValue, string.Empty))
                    {
                        //lsqkpeopleyijian += yijian.Content + "\r\a";
                        //lsqkpeopleyijianluoshi += yijian.DealCondition + "\r\a";
                        tmpEx = new ArrayList();
                        tmpEx.Add(yijian.UserName);
                        tmpEx.Add(yijian.Content);
                        tmpEx.Add(yijian.DealCondition);
                        al.Add(tmpEx);
                    }
                }
                break;

            case 5:
                if (cEntity.DeptSignList == null)
                {
                    break;
                }
                for (int i = 0; i < cEntity.DeptSignList.Count; i++)
                {
                    ArrayList tmp = new ArrayList();
                    M_ProgramFile.DeptSign item = cEntity.DeptSignList[i];
                    if (string.IsNullOrEmpty(item.Comment))
                    {
                        continue;
                    }
                    tmp.Add(item.DeptName);
                    tmp.Add(item.Comment);
                    tmp.Add(item.DealCondition);
                    al.Add(tmp);
                }
                break;
            }

            return(al);
        }
        private ArrayList GeneratorTableDataEx(UC_Print ucPrint, int TblIndex, B_PF cEntity)
        {
            ArrayList al  = new ArrayList();
            ArrayList tmp = new ArrayList();

            switch (TblIndex)
            {
            case 2:
                if (cEntity.DeptSignList == null)
                {
                    break;
                }

                //lsqkdeptyijian += yijian.Content + "\r\a";
                //lsqkdeptyijianluoshi += yijian.DealCondition + "\r\a";
                for (int i = 0; i < cEntity.DeptSignList.Count; i += 2)
                {
                    tmp = new ArrayList();
                    M_ProgramFile.DeptSign item = cEntity.DeptSignList[i];
                    tmp.Add(item.DeptName);
                    tmp.Add(item.Name);
                    tmp.Add(ucPrint.CheckDateTime(item.SubmitDate.ToShortDateString()));

                    if (cEntity.DeptSignList.Count <= i + 1)
                    {
                        tmp.Add("");
                        tmp.Add("");
                        tmp.Add("");
                        al.Add(tmp);
                        return(al);
                    }
                    item = cEntity.DeptSignList[i + 1];
                    tmp.Add(item.DeptName);
                    tmp.Add(item.Name);
                    tmp.Add(ucPrint.CheckDateTime(item.SubmitDate.ToShortDateString()));
                    al.Add(tmp);
                }
                break;

            case 3:
                if (cEntity.LeaderSignList == null)
                {
                    break;
                }
                for (int i = 0; i < cEntity.LeaderSignList.Count; i++)
                {
                    tmp = new ArrayList();
                    M_ProgramFile.LeaderSign item = cEntity.LeaderSignList[i];
                    tmp.Add(item.Name);
                    tmp.Add(ucPrint.CheckDateTime(item.Date.ToShortDateString()));
                    al.Add(tmp);
                }
                break;

            case 5:
                List <B_PF.ProgramFile> lst = B_PF.GetProgramFileEditionHistory(cEntity.ProgramCode, cEntity.ProgramFileID);
                if (lst == null)
                {
                    break;
                }
                for (int i = 0; i < lst.Count; i++)
                {
                    tmp = new ArrayList();
                    tmp.Add(lst[i].Edition);
                    tmp.Add(lst[i].Writer);
                    tmp.Add(lst[i].Approver);
                    tmp.Add(ucPrint.CheckDateTime(lst[i].FinishTime.ToShortDateString()));
                    tmp.Add(lst[i].Reason);
                    al.Add(tmp);
                }
                break;
            }
            return(al);
        }
        /// <summary>
        /// 提交按钮处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SubmitBtn_Click(object sender, EventArgs e)
        {
            try
            {
                //提交动作
                string strActionName = ((Button)sender).Text.Trim();
                base.SubAction = strActionName;

                string strErrMsg = string.Empty;
                string strMessage = string.Empty;
                string strErrMessage = string.Empty;

                #region 传阅
                if (strActionName == ProcessConstString.SubmitAction.ProgramFile.ACTION_CIRCULATE)
                {
                    if (string.IsNullOrEmpty(hfCirculateUserID.Value) && string.IsNullOrEmpty(hfCirculateDeptID.Value))
                    {
                        JScript.Alert(ConstString.PromptInfo.ACTION_CHECK_CIRCULATE, true);
                        return;
                    }
                    try
                    {
                        base.Circulate(hfCirculateDeptID.Value, "0", string.Empty, hfCirculateUserID.Value, "1", true, string.Empty, false);

                        string strDay = OAConfig.GetConfig("传阅有效期", "天数");
                        int day = string.IsNullOrEmpty(strDay) ? -1 : int.Parse(strDay);
                        wfCirculateDate.Text = DateTime.Now.AddDays(day).ToString();
                        if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_QG)
                        {
                            QualityCheck();
                        }//质保审查
                        else if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_AUDIT)
                        {
                            AuditCheck();
                        }//审核
                        JScript.Alert(ConstString.PromptInfo.ACTION_CIRCULATE_SUC, true);
                        return;
                    }
                    catch (Exception ex)
                    {
                        JScript.Alert(ex.ToString(), true);
                        return;
                    }
                }
                #endregion

                #region 添加多条意见
                //添加意见按钮事件
                if (strActionName == ProcessConstString.SubmitAction.ProgramFile.ACTION_ADD_COMMENT)
                {
                    this.pnlComment.Visible = true;
                    this.btnCancel.Visible = true;
                    this.btnConfirm.Visible = true;
                    this.btnAdd.Visible = false;
                    return;
                }
                //确定按钮事件
                if (strActionName == ProcessConstString.SubmitAction.ProgramFile.ACTION_CONFIRM)
                {
                    if (string.IsNullOrEmpty(txtInfo2.Text.Trim()))
                    {
                        JScript.Alert(ConstString.PromptInfo.ACTION_CHECK_ADD_COMMENT, true);
                        return;
                    }
                    if (txtInfo2.Text.Trim().Length > 500)
                    {
                        JScript.Alert(ConstString.PromptInfo.ACTION_CHECK_CONTENT_LEN500, true);
                        return;
                    }
                    if (string.IsNullOrEmpty(hfEditIndex.Value))
                    {
                        CYiJian objYj = new CYiJian();

                        objYj.Content = SysString.InputText(txtInfo2.Text.Trim());
                        objYj.FinishTime = DateTime.Now.ToString();
                        objYj.ID = base.IdentityID.ToString();
                        objYj.ViewName = base.StepName;

                        /*开始    流程代理         */
                        if (OAConfig.GetConfig(ConstString.Config.Section.Start_WORKFLOW_AGENT, ConstString.Config.Key.IS_START) == "1" && wfReceiveUserID.Text != CurrentUserInfo.UserName)
                        {
                            objYj.UserName = wfReceiveUserName.Text;
                            objYj.UserID = wfReceiveUserID.Text;
                        }
                        else
                        {
                            objYj.UserName = CurrentUserInfo.DisplayName;
                            objYj.UserID = CurrentUserInfo.UserName;
                        }
                        /*结束              */
                        objYj.DeptID = base.StepName == ProcessConstString.StepName.ProgramFile.STEP_DEPTSIGN ? B_PF.GetDeptIDByUserID(ucBuMenHuiQian.UCGetHQList(), objYj.UserID) : string.Empty;

                        YiJianInfoList.Add(objYj);
                        txtInfo2.Text = string.Empty;
                        trYiJianHead.Visible = YiJianInfoList.Count > 0 ? true : false; ;

                        rptComment.DataSource = YiJianInfoList;
                        rptComment.DataBind();
                    }//添加意见
                    else
                    {
                        int index = int.Parse(hfEditIndex.Value);
                        Label lblContent = rptComment.Items[index].FindControl("lblContent") as Label;
                        lblContent.Text = SysString.InputText(txtInfo2.Text);
                        YiJianInfoList[index].Content = lblContent.Text;

                        this.pnlComment.Visible = false;
                        this.btnCancel.Visible = false;
                        btnConfirm.Visible = false;
                        this.btnAdd.Visible = true;
                        txtInfo2.Text = string.Empty;
                        hfEditIndex.Value = string.Empty;
                    }//修改意见
                    return;
                }
                //取消按钮事件
                if (strActionName == ProcessConstString.SubmitAction.ProgramFile.ACTION_CANCLE)
                {
                    this.pnlComment.Visible = false;
                    this.btnCancel.Visible = false;
                    this.btnConfirm.Visible = false;
                    this.btnAdd.Visible = true;
                    txtInfo2.Text = string.Empty;
                    hfEditIndex.Value = string.Empty;
                    return;
                }
                #endregion

                #region 处理落实情况
                //编写节点 处理 质保、部门会签、领导会签、批准意见
                if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_WRITE && pnlDealSign.Visible == true)
                {
                    B_PF bllProFile = new B_PF();

                    List<M_ProgramFile.DeptSign> deptSignList = B_PF.GetDeptSignList(rptDept, ucBuMenHuiQian.UCGetHQList());//部门会签意见
                    List<M_ProgramFile.LeaderSign> leaderSignList = B_PF.GetLeaderSignList(rptLeader, ucLDHuiQian.UCGetHQList());//领导会签
                    List<M_ProgramFile.QualityCheck> qualityCheckList = B_PF.GetQualityCheckList(rptQG);//质保审查
                    List<M_ProgramFile.PiZhun> piZhunList = B_PF.GetPiZhunList(rptPiZhun);//批准意见
                    List<B_PF> entityList = B_PF.GetpfEntityList(deptSignList, leaderSignList, qualityCheckList, piZhunList);
                    if (!bllProFile.EnTransSave(entityList))
                    {
                        JScript.Alert(ConstString.PromptInfo.ACTION_SUBMIT_DEAL_FAIL, true);
                        return;
                    }//更新当前提交的意见落实情况

                }
                //质保审查节点 处理批准意见
                if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_QG)
                {
                    List<M_ProgramFile.PiZhun> piZhunList = B_PF.GetPiZhunList(rptPiZhun);//批准意见
                    if (piZhunList.Count > 0)
                    {
                        B_PF.UpdateApproveDealCondition(piZhunList);
                    }
                }

                #endregion

                //保存
                if (strActionName == ProcessConstString.SubmitAction.ACTION_SAVE_DRAFT)
                {
                    B_PF bllProFile = ControlToEntity(true) as B_PF;

                    //用于提示信息
                    bllProFile.IsFormSave = true;

                    bllProFile.SubmitAction = strActionName;
                    if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_ASSIST_SIGN)
                    {
                        ReturnInfo l_objReturnInfo = FormSubmitForProFile(true, strActionName, string.Empty, FSWFStatus.Assigned.ToString(), bllProFile as EntityBase);
                        if (!l_objReturnInfo.IsSucess)
                        {
                            return;
                        }
                        JScript.Alert(ConstString.PromptInfo.ACTION_SAVE_SUC, true);
                    }
                    else
                    {
                        base.FormSubmit(true, strActionName, null, bllProFile as EntityBase);
                    }
                }
                else
                {
                    B_PF bllProFile = ControlToEntity(false) as B_PF;
                    bllProFile.IsFormSave = false;
                    bllProFile.SubmitAction = strActionName;
                    //撤销
                    if (strActionName == ProcessConstString.SubmitAction.ACTION_CANCEL)
                    {
                        base.FormCancel(bllProFile as EntityBase);
                    }
                    else
                    {
                        //验证及提示
                        bllProFile.GetSubmitMessage(base.StepName, strActionName, bllProFile, ref strErrMessage, ref strMessage);
                        if (!string.IsNullOrEmpty(strErrMessage))
                        {
                            JScript.Alert(strErrMessage, true);
                            return;
                        }

                        //表单验证
                        strErrMsg = bllProFile.SeverCheck(StepName, bllProFile);

                        if (!string.IsNullOrEmpty(strErrMsg))
                        {
                            JScript.Alert(strErrMsg, true);
                            return;
                        }
                        else
                        {
                            #region 分发节点 点击分发完成按钮 执行分发
                            if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_SEND &&
                                base.SubAction == ProcessConstString.SubmitAction.ProgramFile.ACTION_SEND_COMPLETE)
                            {
                                if (string.IsNullOrEmpty(hfSendDeptID.Value) && string.IsNullOrEmpty(hfSendUserID.Value))
                                {
                                    JScript.Alert(ConstString.PromptInfo.ACTION_CHECK_SEND, true);
                                    return;
                                }
                                try
                                {
                                    base.Circulate(hfSendDeptID.Value, "0", string.Empty, hfSendUserID.Value, "1", true, string.Empty, false);
                                }
                                catch (Exception ex)
                                {
                                    JScript.Alert(ex.ToString(), true);
                                    return;
                                }
                            }
                            #endregion

                            #region 分发节点 点击归档按钮 执行归档
                            if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_SEND &&
                               base.SubAction == ProcessConstString.SubmitAction.ProgramFile.ACTION_ARCHIVE)
                            {
                                bllProFile.ProgramType1 = B_ProgramFileInfo.GetProTypeName(bllProFile.ProgramFileID);
                                bllProFile.ProgramType2 = B_ProgramFileInfo.GetProSubTypeName(bllProFile.ProgramFileID);
                                string strDeptName = OADept.GetDeptByDeptID(bllProFile.SendDeptID).Name;
                                string strRes = string.Empty;
                                try//renjinquan改
                                {
                                    string strArchiveResult = Devolve(bllProFile, strDeptName, CurrentUserInfo.DisplayName, out strRes);
                                    base.Devolved(base.ProcessID, base.TemplateName);
                                    JScript.Alert("归档成功!\\n流水号:" + strRes, true);
                                }
                                catch (Exception ex)
                                {
                                    base.WriteLog(ex.Message);
                                    JScript.Alert("归档失败!请查看配置是否正确!", true);
                                }
                                //Regex.IsMatch(strArchiveResult, @"^\d+$") ? ConstString.PromptInfo.ACTION_ARCHIVE_SUC : strArchiveResult, true);
                                return;
                            }
                            #endregion

                            #region 程序发起、分发节点 更新程序文件信息
                            if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_WRITE)
                            {
                                ReturnInfo retInfo = B_ProgramFileInfo.GetUpdateMsg(bllProFile, ConstString.ProgramFile.PROGRAM_UNFINISHED);
                                if (retInfo.IsSucess == false)
                                {
                                    JScript.Alert(retInfo.ErrMessage, true);
                                    return;
                                }

                            }
                            if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_SEND &&
                                base.SubAction == ProcessConstString.SubmitAction.ProgramFile.ACTION_SEND_COMPLETE)
                            {
                                ReturnInfo retInfo = new ReturnInfo();
                                if (bllProFile.ApplyStyle == ConstString.ProgramFile.PROGRAM_DELETE)
                                {
                                    B_ProgramFileInfo bllFileInfo = new B_ProgramFileInfo();
                                    retInfo = bllFileInfo.IsLogout(bllProFile, ConstString.ProgramFile.PROGRAM_LOGOUT);
                                }//已注销
                                else
                                {
                                    retInfo = B_ProgramFileInfo.GetUpdateMsg(bllProFile, ConstString.ProgramFile.PROGRAM_ARCHIVED);
                                }//已归档
                                if (retInfo.IsSucess == false)
                                {
                                    JScript.Alert(retInfo.ErrMessage, true);
                                    return;
                                }
                            }

                            #endregion

                            Hashtable nValues = new Hashtable();

                            #region 协助会签
                            if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_DEPTSIGN)
                            {
                                if (strActionName == ProcessConstString.SubmitAction.ProgramFile.ACTION_ASSIGN)
                                {
                                    nValues = bllProFile.GetProcNameValue(base.StepName, strActionName, bllProFile);
                                    string strSubProcInstID = GetCreateSubProcessID(ProcessConstString.TemplateName.PROGRAM_FILE_ASSIGN_SIGN, nValues);
                                    bllProFile.ChildProcessID = strSubProcInstID;
                                    ReturnInfo l_objReturnInfo = FormSubmitForProFile(false, strActionName, string.Empty, FSWFStatus.Assigned.ToString(), bllProFile as EntityBase);
                                    if (!l_objReturnInfo.IsSucess)
                                    {
                                        return;
                                    }
                                    this.ShowMsgBox(this.Page, MsgType.VbInformation, strMessage, base.EntryAction);
                                    return;
                                }//交办
                                if (!string.IsNullOrEmpty(bllProFile.ChildProcessID) && strActionName == ProcessConstString.SubmitAction.ACTION_SUBMIT)
                                {
                                    AgilePointWF ag = new AgilePointWF();
                                    WorkflowService api = ag.GetAPI();
                                    WFEvent wfEvnet = api.CancelProcInst(bllProFile.ChildProcessID);
                                    if (wfEvnet.Error != null)
                                    {
                                        JScript.Alert(wfEvnet.Error, true);
                                        return;
                                    }
                                    bllProFile.ChildProcessID = string.Empty;
                                }//存在交办子流程 继续提交 撤销子流程
                            }
                            if (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_ASSIST_SIGN)
                            {
                                if (strActionName == ProcessConstString.SubmitAction.ACTION_COMPLETE)
                                {
                                    ReturnInfo l_objReturnInfo = FormSubmitForProFile(false, strActionName, bllProFile.ParentTBID, FSWFStatus.Completed.ToString(), bllProFile as EntityBase);
                                    if (!l_objReturnInfo.IsSucess)
                                    {
                                        return;
                                    }
                                }
                                this.ShowMsgBox(this.Page, MsgType.VbInformation, strMessage, base.EntryAction);
                                return;
                            }

                            #endregion

                            //调用工作流
                            nValues = bllProFile.GetProcNameValue(base.StepName, strActionName, bllProFile);
                            base.FormSubmit(false, strActionName, nValues, bllProFile as EntityBase);
                        }
                    }
                }

                //流程节点结束提示
                if (!string.IsNullOrEmpty(strMessage))
                {
                    JScript.Alert(strMessage, true);
                }
            }
            catch (Exception ex)
            {
                JScript.Alert(ex.Message, true);
            }
        }
        private string Devolve2DC2(HN_OA2DC oaDev, B_PF enProFile, string strDraftDept, string dealUser, string sProcessName)
        {
            string sXml = "";

            List <FounderSoftware.ADIM.OA.OA2DC.DevKVItem> ls = oaDev.MapFunction("DC", sProcessName);

            FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode();
            FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode    fl = new HNDC_CFileNode();

            #region 开始生成Archive节点
            ar.System = "OA_" + base.IdentityID.ToString();
            string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            switch (ObjPlatForm)
            {
            case "DC":
                ar.SysFlag = "1";
                break;

            case "FC":
                ar.SysFlag = "2";
                break;

            default:
                ar.SysFlag = "1";
                break;
            }

            #region 根据DevolveConfig.xml配置参数设置Archive归档节点
            for (int i = 0; i < ls.Count; i++)
            {
                string skey  = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sKey;
                string sName = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sValue;
                string sType = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sType;
                ar.SetAttribute(skey, oaDev.PreHandel(enProFile, sName, sType) /*(entity.GetVal(sName) as string)*/);
            }
            ar.SetOAArchiveNode();
            // 其他节点处理应放置在SetOAArchiveNode方法之后
            // 编制单位-主办部门
            ar.FormationDept = strDraftDept;
            // 功能领域-程序子类
            ar.FunctionField = B_ProgramFileInfo.GetProSubTypeName(enProFile.ProgramFileID);

            //return Devolve2DP(oaDev, sDPID, ar);
            #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点

            ar.ElectronicDocumentCount = enProFile.FileList.Count.ToString();
            #endregion
            sXml = oaDev.GenOAArchiveNode(ar, sProcessName);

            /****开始生成File节点************************************************************************/
            #region 开始生成File节点
            fl.AuthorizeTime   = ar.AuthorizeTime;
            fl.Code            = ar.Code;
            fl.Code19          = ar.Code19;
            fl.D_FileStatus    = ar.D_FileStatus;
            fl.DocCodesExplain = "";
            fl.DocPages        = ar.DocPages;
            fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime;
            fl.Ext_1         = ar.Ext_1;
            fl.Ext_2         = ar.Ext_2;
            fl.Ext_3         = ar.Ext_3;
            fl.Ext_4         = ar.Ext_4;
            fl.Ext_5         = ar.Ext_5;
            fl.Title         = ar.Title;
            fl.FK_ArchiveID  = ar.FK_Archive;
            fl.FK_CategoryID = ar.FK_CategoryID;
            fl.FormationDept = ar.FormationDept;
            fl.FormationTime = ar.FormationTime;
            fl.Importer      = ar.Importer;
            fl.ImporterTime  = ar.ImporterTime;
            fl.OriginalID    = ar.OriginalID;
            fl.OtherTitle    = ar.OtherTitle;
            fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime;
            fl.RelatedCode = ar.RelatedCode;
            fl.Revision    = ar.Revision;
            #endregion
            sXml = oaDev.GenOAFileNode(fl);
            /****完成生成File节点************************************************************************/

            #region 始生成Attachment节点
            /****开始生成Attachment节点******************************************************************/
            string sServerWeb = oaDev.GetCfgNodeValues("/Devolve/Other/ServerWeb");
            //"http://172.29.128.239";
            //string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName");
            for (int i = 0; i < enProFile.FileList.Count; i++)
            {
                HNDC_CAttachmentNode at = new HNDC_CAttachmentNode();
                CFuJian file            = enProFile.FileList[i];

                at.DocumentName  = ProcessConstString.TemplateName.PROGRAM_FILE; //file.FileName;
                at.FK_FileID     = "";
                at.MakeDate      = "";
                at.MakeUnit      = "";
                at.PublishedTime = "";
                at.Remark        = "";

                at.ServerWeb = sServerWeb;
                Double iSize = 0;
                string sSize = file.Size.ToUpper();
                if (sSize.Contains("K"))
                {
                    sSize = sSize.Replace("K", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024;
                }
                if (sSize.Contains("M"))
                {
                    sSize = sSize.Replace("M", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024 * 1024;
                }
                at.Size     = ((int)iSize).ToString();
                at.TimeSize = "";
                at.Title    = file.Alias;
                at.Type     = file.Type;
                at.Url      = file.URL;

                sXml = oaDev.GenOAAttachmentNode(fl.FK_ArchiveID, at);
            }
            #endregion
            /****完成生成Attachment节点******************************************************************/

            return(sXml);
        }
        private string Devolve2DC2(HN_OA2DC oaDev, B_PF enProFile, string strDraftDept, string dealUser, string sProcessName)
        {
            string sXml = "";

            List<FounderSoftware.ADIM.OA.OA2DC.DevKVItem> ls = oaDev.MapFunction("DC", sProcessName);

            FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode();
            FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode();

            #region 开始生成Archive节点
            ar.System = "OA_" + base.IdentityID.ToString();
            string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            switch (ObjPlatForm)
            {
                case "DC":
                    ar.SysFlag = "1";
                    break;
                case "FC":
                    ar.SysFlag = "2";
                    break;
                default:
                    ar.SysFlag = "1";
                    break;
            }

            #region 根据DevolveConfig.xml配置参数设置Archive归档节点
            for (int i = 0; i < ls.Count; i++)
            {
                string skey = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sKey;
                string sName = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sValue;
                string sType = (ls[i] as FounderSoftware.ADIM.OA.OA2DC.DevKVItem).sType;
                ar.SetAttribute(skey, oaDev.PreHandel(enProFile, sName, sType)/*(entity.GetVal(sName) as string)*/);
            }
            ar.SetOAArchiveNode();
            // 其他节点处理应放置在SetOAArchiveNode方法之后
            // 编制单位-主办部门
            ar.FormationDept = strDraftDept;
            // 功能领域-程序子类
            ar.FunctionField = B_ProgramFileInfo.GetProSubTypeName(enProFile.ProgramFileID);

            //return Devolve2DP(oaDev, sDPID, ar);
            #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点

            ar.ElectronicDocumentCount = enProFile.FileList.Count.ToString();
            #endregion
            sXml = oaDev.GenOAArchiveNode(ar, sProcessName);

            /****开始生成File节点************************************************************************/
            #region 开始生成File节点
            fl.AuthorizeTime = ar.AuthorizeTime;
            fl.Code = ar.Code;
            fl.Code19 = ar.Code19;
            fl.D_FileStatus = ar.D_FileStatus;
            fl.DocCodesExplain = "";
            fl.DocPages = ar.DocPages;
            fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime;
            fl.Ext_1 = ar.Ext_1;
            fl.Ext_2 = ar.Ext_2;
            fl.Ext_3 = ar.Ext_3;
            fl.Ext_4 = ar.Ext_4;
            fl.Ext_5 = ar.Ext_5;
            fl.Title = ar.Title;
            fl.FK_ArchiveID = ar.FK_Archive;
            fl.FK_CategoryID = ar.FK_CategoryID;
            fl.FormationDept = ar.FormationDept;
            fl.FormationTime = ar.FormationTime;
            fl.Importer = ar.Importer;
            fl.ImporterTime = ar.ImporterTime;
            fl.OriginalID = ar.OriginalID;
            fl.OtherTitle = ar.OtherTitle;
            fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime;
            fl.RelatedCode = ar.RelatedCode;
            fl.Revision = ar.Revision;
            #endregion
            sXml = oaDev.GenOAFileNode(fl);
            /****完成生成File节点************************************************************************/

            #region 始生成Attachment节点
            /****开始生成Attachment节点******************************************************************/
            string sServerWeb = oaDev.GetCfgNodeValues("/Devolve/Other/ServerWeb");
            //"http://172.29.128.239";
            //string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName");
            for (int i = 0; i < enProFile.FileList.Count; i++)
            {
                HNDC_CAttachmentNode at = new HNDC_CAttachmentNode();
                CFuJian file = enProFile.FileList[i];

                at.DocumentName = ProcessConstString.TemplateName.PROGRAM_FILE; //file.FileName;
                at.FK_FileID = "";
                at.MakeDate = "";
                at.MakeUnit = "";
                at.PublishedTime = "";
                at.Remark = "";

                at.ServerWeb = sServerWeb;
                Double iSize = 0;
                string sSize = file.Size.ToUpper();
                if (sSize.Contains("K"))
                {
                    sSize = sSize.Replace("K", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024;
                }
                if (sSize.Contains("M"))
                {
                    sSize = sSize.Replace("M", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024 * 1024;
                }
                at.Size = ((int)iSize).ToString();
                at.TimeSize = "";
                at.Title = file.Alias;
                at.Type = file.Type;
                at.Url = file.URL;

                sXml = oaDev.GenOAAttachmentNode(fl.FK_ArchiveID, at);
            }
            #endregion
            /****完成生成Attachment节点******************************************************************/

            return sXml;
        }
Esempio n. 23
0
        /// <summary>
        /// 程序文件 交办动作处理
        /// </summary>
        /// <param name="p_strActionName"></param>
        /// <param name="entity"></param>
        protected ReturnInfo FormSubmitForProFile(Boolean bIsSave, String strActionName, String strParentTbID, String strStepStatus, EntityBase entity)
        {
            User       l_objUser       = null;
            ReturnInfo l_objReturnInfo = FormSave.SaveEntity(entity, this, bIsSave, this.SubAction, this.TemplateName);

            if (!l_objReturnInfo.IsSucess)
            {
                this.ShowMsgBox(this.Page, MsgType.VbExclamation, "表单保存出错,后续操作不能进行!" + l_objReturnInfo.ErrMessage);
                return(l_objReturnInfo);
            }

            if (!bIsSave)
            {
                //处理交办人相关信息
                if (String.IsNullOrEmpty(strParentTbID))
                {
                    DataTable  dt         = B_PF.GetNextWorkItemIdForAssign(base.ProcessID);//当前ProcessID 父流程ID
                    EntityBase entitybase = base.EntityData != null ? base.EntityData : new EntityBase();
                    entitybase.AgentUserID   = String.Empty;
                    entitybase.AgentUserName = String.Empty;
                    EntityBase entitybase2 = EntityFactory.CreateEntity2(base.TemplateName);;
                    base.EntityData.Clone(entitybase2);
                    entitybase2.AgentUserID   = String.Empty;
                    entitybase2.AgentUserName = String.Empty;

                    entitybase2.ProcessID = dt.Rows[0]["PROC_INST_ID"].ToString();
                    entitybase.ProcessID  = dt.Rows[0]["PROC_INST_ID"].ToString();

                    entitybase2.WorkItemID = dt.Rows[0]["WORK_ITEM_ID"].ToString();
                    entitybase.WorkItemID  = dt.Rows[0]["WORK_ITEM_ID"].ToString();

                    entitybase2.D_StepStatus = dt.Rows[0]["STATUS"].ToString();
                    entitybase.D_StepStatus  = dt.Rows[0]["STATUS"].ToString();

                    entitybase2.ReceiveUserID = dt.Rows[0]["USER_ID"].ToString();
                    entitybase.ReceiveUserID  = dt.Rows[0]["USER_ID"].ToString();

                    entitybase2.StepName = dt.Rows[0]["NAME"].ToString();
                    entitybase.StepName  = dt.Rows[0]["NAME"].ToString();

                    entitybase2.SubmitAction = strActionName;
                    entitybase.SubmitAction  = strActionName;

                    //接收人姓名
                    l_objUser = OAUser.GetUser(entitybase.ReceiveUserID);
                    if (l_objUser != null)
                    {
                        entitybase2.ReceiveUserName = l_objUser.Name;
                        entitybase.ReceiveUserName  = l_objUser.Name;
                    }

                    entitybase2.FormsData = XmlUtility.SerializeXml(entitybase);
                    if (!entitybase2.Save())
                    {
                        l_objReturnInfo.IsSucess   = false;
                        l_objReturnInfo.ErrMessage = SysString.GetErrorMsgs(entitybase2.ErrMsgs);

                        ILogger log = LoggerFactory.GetLogger(LogType.TxtFile, @"Log", "程序文件");
                        log.WriteLog("保存实体出错:" + l_objReturnInfo.ErrMessage);

                        return(l_objReturnInfo);
                    }
                }//新增协助会签节点数据
                else
                {
                    B_PF pfEntity = new B_PF();
                    pfEntity.ID = int.Parse(strParentTbID);
                    pfEntity    = XmlUtility.DeSerializeXml <B_PF>(pfEntity.FormsData);
                    pfEntity.ID = int.Parse(strParentTbID);
                    //清空子流程ProcessID,用于标识当部门领导自己提交表单撤销子流程(如果不为空,则需要注销子流程)
                    pfEntity.ChildProcessID = String.Empty;
                    pfEntity.AssistContent  = (entity as B_PF).AssistContent;
                    pfEntity.FormsData      = XmlUtility.SerializeXml(pfEntity);//.Replace("<ID>" + pfEntity.ID + "</ID>", "<ID>" + int.MinValue.ToString() + "</ID>");
                    if (!pfEntity.Save())
                    {
                        throw new Exception(pfEntity.ErrMsgs.ToString());
                    }
                    WorkFlowBase.CompleteWorkItem(base.WorkItemID, null);
                }//更新交办会签节点数据
            }

            l_objReturnInfo.IsSucess = true;
            return(l_objReturnInfo);
        }
Esempio n. 24
0
        private void SetBaseExportData(UC_Print ucPrint, B_PF cEntity)
        {
            //ucPrint.AttachFileList = cEntity.FileList;
            //ucPrint.Position = "主题词:";//(string)ucPrint.ExportData[2];
            //ucPrint.Mode = WriteMode.Up;

            ucPrint.ExportData.Add(cEntity.ApplyStyle);    //<col>申请类型:|right</col>
            //ucPrint.ExportData.Add(cEntity.ApplyReason);    //<col>申请原因:|right</col>
            //ucPrint.ExportData.Add(cEntity.RelationProgram);    //<col>可能受影响程序:|right</col>
            ucPrint.ExportData.Add(cEntity.DocumentTitle);    //<col>程序名称:|right</col>
            ucPrint.ExportData.Add(cEntity.ProgramCode);    //<col>编码:|right</col>
            ucPrint.ExportData.Add(cEntity.Edition);    //<col>版次:|right</col>
        }
Esempio n. 25
0
        public void SetPrintBeginExport(UC_Print ucPrint, B_PF cEntity)
        {
            switch (ucPrint.FileName)
            {
            case "程序文件表单":
                SetBaseExportData(ucPrint, cEntity);
                ucPrint.ExportData.Add(cEntity.CirculateSignDept);                 //<col>部门:|inner</col>
                ucPrint.ExportData.Add(cEntity.CirculateSignUserName);             //<col>人员:|inner</col>
                ucPrint.ExportData.Add(cEntity.CirculateDeptName);                 //<col>部门: |inner</col>
                ucPrint.ExportData.Add(cEntity.CirculateName);                     //<col>人员: |inner</col>
                ucPrint.ExportData.Add(cEntity.CirculateComment);                  //<col>意见:|right</col>

                ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //<col>附件:|down</col>
                break;

            case "管理程序变更申请表":
                if (cEntity.ProgramSort == "管理程序")
                {
                    ucPrint.ExportData.Add("管理程序变更申请表");   //<col>管理程序变更申请表|shift</col>
                    ucPrint.ExportData.Add("HN-LL431");    //<col>HN-LL431|shift</col>
                }
                if (cEntity.ProgramSort == "工作程序")
                {
                    ucPrint.ExportData.Add("工作程序变更申请表");   //<col>管理程序变更申请表|shift</col>
                    ucPrint.ExportData.Add("HN-LL432");    //<col>HN-LL431|shift</col>
                }
                if (cEntity.ProgramSort == "部门级管理程序")
                {
                    ucPrint.ExportData.Add("管理程序变更申请表");                                                                  //<col>管理程序变更申请表|shift</col>
                    ucPrint.ExportData.Add("HN-LL433");                                                                   //<col>HN-LL431|shift</col>
                }
                ucPrint.ExportData.Add(string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year); //<col>年份|shift</col>
                /*待定*/
                ucPrint.ExportData.Add(cEntity.SerialID);                                                                 //<col>序号|shift</col>
                ucPrint.ExportData.Add(cEntity.DocumentTitle);                                                            //<col>文件名称|right</col>
                ucPrint.ExportData.Add(cEntity.ProgramCode + " , " + cEntity.Edition);                                    //<col>编码版本|right</col>
                ucPrint.ExportData.Add(OADept.GetDeptName(cEntity.SendDeptID));                                           //<col>申请部门|right</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));                     //<col>申请日期|right</col>
                ucPrint.ExportData.Add(cEntity.ApplyStyle);                                                               //<col>申请类型|right</col>
                //ucPrint.ExportData.Add(cEntity.ApplyReason);                       //<col>原因:|inner</col>
                //ucPrint.ExportData.Add(cEntity.RelationProgram/*RelationDemand*/);                    //<col>可能受到影响的程序:|inner</col>
                ucPrint.ExportData.Add(cEntity.Drafter);                                                   //<col>申请人姓名|right</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));      //<col>日期|right</col>
                ucPrint.ExportData.Add(OAUser.GetDeptManager(cEntity.SendDeptID, ConstString.Grade.ZERO)); //<col>编制部门负责人姓名|right</col>
                //M_20100414 huangqi des:编写时间改为FirstDraftDate
                //begin
                if (cEntity.FirstDraftDate != DateTime.MinValue)
                {
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString()));         //<col>日期 |right</col>
                }
                else
                {
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));
                }
                //end

                //ucPrint.ExportData.Add(cEntity.QualityApproveComment
                //PF.GetNotionComment(cEntity.ProcessID, ConstString.ProcessStepName.PROGRAM_QUALITY)*/);                      //<col>意见:|inner</col>
                ucPrint.ExportData.Add(cEntity.AuditName);                                              //<col>审核人姓名|right</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString()));   //<col>日期  |right</col>
                ucPrint.ExportData.Add(cEntity.QualityNames);                                           //<col>质保处负责人姓名|right</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.QualityDate.ToShortDateString())); //<col>日期   |right</col>
                ucPrint.ExportData.Add("该程序已经更新发布");                                                    //<col>网页更新结果:|inner</col>
                /*待定*/
                ucPrint.ExportData.Add("" /*OAList.GetUserNameByWorkItemID(cEntity.WorkItemID)*/);      //<col>信息文档处操作人姓名|right</col>
                //ucPrint.ExportData.Add(string.IsNullOrEmpty(cEntity.SendDate.ToShortDateString()) ?
                //    DateTime.Now.ToShortDateString() : ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())
                //    );                                        //<col>日期    |right</col>

                ucPrint.ExportData.Add(string.IsNullOrEmpty(ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())) ?
                                       DateTime.Now.ToShortDateString() : ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())); //<col>日期    |right</col>

                ucPrint.AttachFileList = cEntity.FileList;
                ucPrint.Position       = "可能受到影响的程序:";//(string)ucPrint.ExportData[2];
                ucPrint.Mode           = WriteMode.Up;
                break;

            case "管理程序封面模板":
                if (cEntity.ProgramSort == "管理程序")
                {
                    ucPrint.ExportData.Add("管理程序");        //<col>管理程序|shift</col>
                    //ucPrint.ExportData.Add("HN-LL431-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>HN编码:|right</col>
                }
                if (cEntity.ProgramSort == "工作程序")
                {
                    ucPrint.ExportData.Add("工作程序");        //<col>管理程序|shift</col>
                    //ucPrint.ExportData.Add("HN-LL432-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>HN编码:|right</col>
                    cEntity.QualityNames = "";
                }
                if (cEntity.ProgramSort == "部门级管理程序")
                {
                    ucPrint.ExportData.Add("管理程序");        //<col>管理程序|shift</col>
                    //ucPrint.ExportData.Add("HN-LL433-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>HN编码:|right</col>
                }
                ucPrint.ExportData.Add(cEntity.ProgramCode);
                ucPrint.ExportData.Add(cEntity.Edition);        //<col>版次:|right</col>
                ucPrint.ExportData.Add(cEntity.DocumentTitle);  //<col>程序名称|shift</col>
                if (cEntity.ApproveDate.ToShortDateString() == DateTime.MinValue.ToShortDateString())
                {
                    ucPrint.ExportData.Add("");
                    ucPrint.ExportData.Add("");
                }
                else
                {
                    ucPrint.ExportData.Add(cEntity.ApproveName);                                            //<col>批准实施:|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ApproveDate.ToShortDateString())); //<col>生效日期:|right</col>
                }
                ucPrint.ExportData.Add(cEntity.WriteName);                                                  //<col>编制姓名|shift</col>
                //M_20100414 huangqi des:编写时间改为FirstDraftDate
                //begin
                if (cEntity.FirstDraftDate != DateTime.MinValue)
                {
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString()));         //<col>日期 |shift</col>
                }
                else
                {
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));
                }
                //end
                ucPrint.ExportData.Add(cEntity.CheckName);                                              //<col>校核姓名|shift</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.CheckDate.ToShortDateString()));   //<col>校核日期|shift</col>
                ucPrint.ExportData.Add(cEntity.AuditName);                                              //<col>审核姓名|shift</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString()));   //<col>审核日期|shift</col>
                ucPrint.ExportData.Add(cEntity.QualityNames);                                           //<col>质保姓名|shift</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.QualityDate.ToShortDateString())); //<col>质保日期|shift</col>
                ucPrint.ExportData.Add(OADept.GetDeptName(cEntity.SendDeptID));                         //<col>程序编制部门:|shift</col>

                ucPrint.AttachFileList = cEntity.FileList;
                //ucPrint.Position = "";//(string)ucPrint.ExportData[2];
                //ucPrint.Mode = WriteMode.Up;
                break;

            case "程序审查意见落实表":
                //string num = "";
                //if (cEntity.ProgramSort == "管理程序")
                //{
                //    num = "HN-LL431-";
                //}
                //if (cEntity.ProgramSort == "工作程序")
                //{
                //    num = "HN-LL432-";
                //}
                //if (cEntity.ProgramSort == "部门级管理程序")
                //{
                //    num = "HN-LL433-";
                //}
                //ucPrint.ExportData.Add(num + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>年份|shift</col>
                ucPrint.ExportData.Add(cEntity.ProgramCode);
                ///*待定*/
                ucPrint.ExportData.Add("");                                             //<col>第|right</col>
                ucPrint.ExportData.Add(cEntity.DocumentTitle);                          //<col>程序名称:|inner</col>
                ucPrint.ExportData.Add(cEntity.ProgramCode + "    " + cEntity.Edition); //<col>程序编码和版本:|inner</col>

                //renjinquan+
                //if (cEntity.ProgramSort == "管理程序")
                //{
                //    //ucPrint.ExportData.Add("管理程序");    //<col>管理程序|shift</col>
                //    ucPrint.ExportData.Add("HN-LL431"+"    " + cEntity.Edition);    //<col>HN编码:|right</col>
                //}
                //if (cEntity.ProgramSort == "工作程序")
                //{
                //    //ucPrint.ExportData.Add("工作程序");    //<col>管理程序|shift</col>
                //    ucPrint.ExportData.Add("HN-LL432"+"    " + cEntity.Edition);    //<col>HN编码:|right</col>
                //}
                //if (cEntity.ProgramSort == "部门级管理程序")
                //{
                //    //ucPrint.ExportData.Add("管理程序");    //<col>管理程序|shift</col>
                //    ucPrint.ExportData.Add("HN-LL433"+"    " + cEntity.Edition);    //<col>HN编码:|right</col>
                //}

                //ucPrint.ExportData.Add(cEntity.RelationDemand);    //<col>对相关程序修订要求或建议:|inner</col>
                //ucPrint.ExportData.Add(cEntity.RelationProgram/*cEntity.DocumentTitle + "" + cEntity.ProgramCode*/);    //<col>相关程序名称和编码:|inner</col>
                //ucPrint.ExportData.Add(cEntity.ApproveName);    //<col>批准|right</col>
                //ucPrint.ExportData.Add(cEntity.ApproveDate.ToShortDateString());    //<col>日期|right</col>
                ucPrint.ExportData.Add(cEntity.AuditName);                                            //<col>审核|right</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString())); //<col>日期 |right</col>
                ucPrint.ExportData.Add(cEntity.CheckName);                                            //<col>校核|right</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.CheckDate.ToShortDateString())); //<col>日期  |right</col>
                ucPrint.ExportData.Add(cEntity.WriteName);                                            //<col>编制|right</col>
                //M_20100414 huangqi des:编写时间改为FirstDraftDate
                //begin
                if (cEntity.FirstDraftDate != DateTime.MinValue)
                {
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString()));         //<col>日期 |right</col>
                }
                else
                {
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));
                }
                //end
                ucPrint.AttachFileList = cEntity.FileList;
                //ucPrint.Position = "";//(string)ucPrint.ExportData[2];
                //ucPrint.Mode = WriteMode.Up;
                break;
            }
        }
Esempio n. 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string processID  = string.Empty;
                string stepName   = string.Empty;
                string workItemID = string.Empty;
                string userID     = string.Empty;
                string deptID     = string.Empty;

                if (Request.QueryString["processID"] == null)
                {
                    return;
                }
                else
                {
                    processID = Request.QueryString["processID"].ToString();
                }

                if (Request.QueryString["workItemID"] == null)
                {
                    return;
                }
                else
                {
                    workItemID = Request.QueryString["workItemID"].ToString();
                }

                if (Request.QueryString["stepName"] == null)
                {
                    return;
                }
                else
                {
                    stepName = Request.QueryString["stepName"].ToString();
                }

                if (Request.QueryString["userID"] == null)
                {
                    return;
                }
                else
                {
                    userID = Server.UrlDecode(Request.QueryString["userID"].ToString());
                }

                if (Request.QueryString["deptID"] == null)
                {
                    return;
                }
                else
                {
                    deptID = Request.QueryString["deptID"].ToString();
                }

                B_PF bllProFile = new B_PF();

                rptComment.DataSource = bllProFile.GetSignComment(processID, workItemID, stepName, userID, deptID);
                rptComment.DataBind();
            }
        }
        private void ucPrint_OnExtraExport(object sender, EventArgs e)
        {
            UC_Print ucPrint  = sender as UC_Print;
            B_PF     cEntity  = null;
            B_PF     cEntity2 = null;

            if (base.IdentityID == 0)
            {
                cEntity2 = this.ControlToEntity(false) as B_PF;
            }
            else
            {
                cEntity2 = base.EntityData != null ? base.EntityData as B_PF : new B_PF();
            }

            cEntity = this.ControlToEntity(false) as B_PF;

            switch (ucPrint.FileName)
            {
                #region  序文件表单
            case "程序文件表单":
                //Print print = new Print();
                // 批准人
                ucPrint.Write("操作人", cEntity.ApproveName, WordMgr.WriteMode.Down, 1);
                ucPrint.Write("同意/否决", cEntity2.ApproverIsAgree, WordMgr.WriteMode.Down, 1);
                ucPrint.Write("意见", GetPFComment(ProcessConstString.StepName.ProgramFile.STEP_APPROVE, cEntity.ApproveComment), WordMgr.WriteMode.Down, 1);
                if (string.IsNullOrEmpty(lblApproveDate.Text))
                {
                    ucPrint.Write("日期", GetLastDate(ucPrint, ProcessConstString.StepName.ProgramFile.STEP_APPROVE) /*ucPrint.CheckDateTime(cEntity.ApproveDate.ToShortDateString())*/, WordMgr.WriteMode.Down, 1);
                }
                else
                {
                    ucPrint.Write("日期", ucPrint.CheckDateTime(lblApproveDate.Text.ToString()), WordMgr.WriteMode.Down, 1);
                }

                // 质保审查
                if (cEntity.ProgramSort != "工作程序")
                {
                    ucPrint.Write("操作人", cEntity.QualityNames, WordMgr.WriteMode.Down, 2);
                    ucPrint.Write("同意/否决", cEntity2.QualityIsAgree, WordMgr.WriteMode.Down, 2);
                    ucPrint.Write("意见", GetPFComment(ProcessConstString.StepName.ProgramFile.STEP_QG, cEntity.QualityComment), WordMgr.WriteMode.Down, 2);
                    if (string.IsNullOrEmpty(lblQGDate.Text))
                    {
                        ucPrint.Write("日期", GetLastDate(ucPrint, ProcessConstString.StepName.ProgramFile.STEP_QG), WordMgr.WriteMode.Down, 2);
                    }
                    else
                    {
                        ucPrint.Write("日期", ucPrint.CheckDateTime(lblQGDate.Text.ToString()), WordMgr.WriteMode.Down, 2);
                    }
                }

                // 审核
                ucPrint.Write("操作人", cEntity.AuditName, WordMgr.WriteMode.Down, 3);
                ucPrint.Write("同意/否决", cEntity2.AuditorIsAgree, WordMgr.WriteMode.Down, 3);
                ucPrint.Write("意见", GetPFComment(ProcessConstString.StepName.ProgramFile.STEP_AUDIT, cEntity.AuditComment), WordMgr.WriteMode.Down, 3);
                if (string.IsNullOrEmpty(lblAuditDate.Text))
                {
                    ucPrint.Write("日期", GetLastDate(ucPrint, ProcessConstString.StepName.ProgramFile.STEP_AUDIT), WordMgr.WriteMode.Down, 3);
                }
                else
                {
                    ucPrint.Write("日期", ucPrint.CheckDateTime(lblAuditDate.Text.ToString()), WordMgr.WriteMode.Down, 3);
                }

                // 校对
                ucPrint.Write("操作人", cEntity.CheckName, WordMgr.WriteMode.Down, 4);
                ucPrint.Write("同意/否决", cEntity2.CheckerIsAgree, WordMgr.WriteMode.Down, 4);
                ucPrint.Write("意见", GetPFComment(ProcessConstString.StepName.ProgramFile.STEP_CHECK, cEntity.CheckComment), WordMgr.WriteMode.Down, 4);
                if (string.IsNullOrEmpty(lblCheckDate.Text))
                {
                    ucPrint.Write("日期", GetLastDate(ucPrint, ProcessConstString.StepName.ProgramFile.STEP_CHECK), WordMgr.WriteMode.Down, 4);
                }
                else
                {
                    ucPrint.Write("日期", ucPrint.CheckDateTime(lblCheckDate.Text.ToString()), WordMgr.WriteMode.Down, 4);
                }

                // 编写
                ucPrint.Write("操作人", cEntity.WriteName, WordMgr.WriteMode.Down, 5);
                ucPrint.Write("同意/否决", cEntity2.WriterIsAgree, WordMgr.WriteMode.Down, 5);
                ucPrint.Write("意见", GetPFComment(ProcessConstString.StepName.ProgramFile.STEP_WRITE, cEntity.WriteComment), WordMgr.WriteMode.Down, 5);
                //M_20100414 huangqi des:编写时间改为FirstDraftDate
                //begin
                if (cEntity2.FirstDraftDate == DateTime.MinValue)    //string.IsNullOrEmpty(lblWriteDate.Text))
                {
                    if (cEntity2.DraftDate == DateTime.MinValue)
                    {
                        ucPrint.Write("日期", "", WordMgr.WriteMode.Down, 5);
                    }
                    else
                    {
                        ucPrint.Write("日期", cEntity2.DraftDate.ToShortDateString(), WordMgr.WriteMode.Down, 5);
                    }
                }
                else
                {
                    ucPrint.Write("日期", cEntity2.FirstDraftDate.ToShortDateString(), WordMgr.WriteMode.Down, 5);
                }
                //end
                ////////////////////////////////////////////////////////////////////////////////////////
                ArrayList al1 = new ArrayList();
                if (cEntity.DeptSignList == null)
                {
                    goto LEADERSIGN;
                }
                for (int i = 0; i < cEntity.DeptSignList.Count; i++)
                {
                    ArrayList tmp = new ArrayList();
                    M_ProgramFile.DeptSign item = cEntity.DeptSignList[i];
                    tmp.Add(item.DeptName);
                    tmp.Add(item.Name);
                    tmp.Add(item.IsAgree);
                    tmp.Add(ucPrint.CheckDateTime(item.SubmitDate.ToShortDateString()));
                    tmp.Add(item.Comment);
                    tmp.Add(item.DealCondition);
                    tmp.Add(ucPrint.CheckDateTime(item.DealDate.ToShortDateString()));
                    al1.Add(tmp);
                }
                //al1.AddRange(cEntity.DeptSignList);
                ucPrint.WriteTable(2, al1);
                //////////////////////////////////////////////////////////////////////////////////////////
LEADERSIGN:
                ArrayList al2 = new ArrayList();
                if (cEntity.LeaderSignList == null)
                {
                    break;
                }
                for (int i = 0; i < cEntity.LeaderSignList.Count; i++)
                {
                    ArrayList tmp = new ArrayList();
                    M_ProgramFile.LeaderSign item = cEntity.LeaderSignList[i];
                    tmp.Add(item.Name);
                    tmp.Add(item.IsAgree);
                    tmp.Add(ucPrint.CheckDateTime(item.Date.ToShortDateString()));
                    tmp.Add(item.Comment);
                    tmp.Add(item.DealCondition);
                    tmp.Add(ucPrint.CheckDateTime(item.DealDate.ToShortDateString()));
                    al2.Add(tmp);
                }
                //al2.AddRange(cEntity.LeaderSignList);
                ucPrint.WriteTable(3, al2);
                break;
                #endregion

                #region  序审查意见落实表
            case "程序审查意见落实表":
                ArrayList al22 = new ArrayList();
                al22 = GeneratorTableData(2, cEntity);
                ucPrint.WriteTable(2, al22);
                ArrayList al3 = new ArrayList();
                al3 = GeneratorTableData(3, cEntity);
                ucPrint.WriteTable(3, al3);
                //ArrayList al5 = new ArrayList();
                //al5 = GeneratorTableData(5, cEntity);
                //ucPrint.WriteTable(5, al5);
                break;
                #endregion

                #region 管理程序封面模板
            case "管理程序封面模板":
                ArrayList alPage1  = new ArrayList();
                ArrayList newarr   = new ArrayList();
                ArrayList childarr = new ArrayList();
                alPage1 = GeneratorTableDataEx(ucPrint, 2, cEntity);
                int curr = -1;
                for (int i = 0; i < alPage1.Count; i++)
                {
                    for (int j = 0; j < 6; j++)
                    {
                        newarr.Add((alPage1[i] as ArrayList)[j].ToString());
                        if ((alPage1[i] as ArrayList)[j].ToString() == "质量保证处")
                        {
                            curr = i * 6 + j;
                        }
                    }
                }
                if (curr != -1)
                {
                    childarr.Add(newarr[curr].ToString());
                    childarr.Add(newarr[curr + 1].ToString());
                    childarr.Add(newarr[curr + 2].ToString());
                    newarr.RemoveRange(curr, 3);
                    newarr.Insert(0, childarr[0].ToString());
                    newarr.Insert(1, childarr[1].ToString());
                    newarr.Insert(2, childarr[2].ToString());
                    alPage1 = new ArrayList();
                    for (int k = 0; k < newarr.Count; k += 6)
                    {
                        childarr = new ArrayList();

                        childarr.Add(newarr[k].ToString());
                        childarr.Add(newarr[k + 1].ToString());
                        childarr.Add(newarr[k + 2].ToString());
                        childarr.Add(newarr[k + 3].ToString());
                        childarr.Add(newarr[k + 4].ToString());
                        childarr.Add(newarr[k + 5].ToString());
                        alPage1.Add(childarr);
                    }
                }
                ucPrint.WriteTable(2, alPage1);

                ArrayList alPage2 = new ArrayList();
                alPage2 = GeneratorTableDataEx(ucPrint, 3, cEntity);
                ucPrint.WriteTable(3, alPage2);

                ArrayList alPage3 = new ArrayList();
                alPage3 = GeneratorTableDataEx(ucPrint, 5, cEntity);
                ucPrint.WriteTable(5, alPage3);

                string[] value = { cEntity.DocumentTitle, cEntity.ProgramCode, cEntity.Edition };
                ucPrint.WriteHeaderFooter("程序名称", value, WordMgr.WriteMode.Shift);

                if (alPage1.Count == 0)
                {
                    ucPrint.DeleteString("部门会签表(排列不分先后)");
                    ucPrint.DeleteTable(2);
                    if (alPage2.Count == 0)
                    {
                        ucPrint.DeleteString("公司领导审定");
                        ucPrint.DeleteTable(2);

                        if (!cEntity.IsProgramCompanCheck)
                        {
                            ucPrint.DeleteString("中国核电工程有限公司会签");
                            ucPrint.DeleteTable(2);
                        }
                    }
                }
                else if (alPage2.Count == 0)
                {
                    ucPrint.DeleteString("公司领导审定");
                    ucPrint.DeleteTable(3);

                    if (!cEntity.IsProgramCompanCheck)
                    {
                        ucPrint.DeleteString("中国核电工程有限公司会签");
                        ucPrint.DeleteTable(3);
                    }
                }
                else
                {
                    if (!cEntity.IsProgramCompanCheck)
                    {
                        ucPrint.DeleteString("中国核电工程有限公司会签");
                        ucPrint.DeleteTable(4);
                    }
                }

                break;
                #endregion
            }

            switch (ucPrint.FileName)
            {
            case "程序审查意见落实表":
                ucPrint.BatchAddPicture("程序文件", "程序审查意见落实表", cEntity2);
                break;

            case "程序文件表单":
                ucPrint.BatchAddPicture("程序文件", "程序文件表单", cEntity2);
                break;

            case "管理程序封面模板":
                ucPrint.BatchAddPicture("程序文件", "管理程序封面模板", cEntity2);
                break;
            }
        }
        /// <summary>
        /// 复制程序文件
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="stepName"></param>
        /// <param name="receiveUserID"></param>
        /// <param name="p_strProcessID"></param>
        /// <param name="p_strWorkItemID"></param>
        /// <returns></returns>
        private bool CopyProgramFileInfo(String ID, String p_strStepName, String p_strUserID, String p_strProcessID, String p_strWorkItemID, String p_strPoolID)
        {
            try
            {
                //选择的实体
                B_PF selectEntity = new B_PF();
                selectEntity.ID = int.Parse(ID); //ID赋值时自动装载实体

                //新实体
                B_PF newEntity = new B_PF();
                selectEntity.Clone(newEntity); //克隆实体
                newEntity.WorkItemID = p_strWorkItemID;

                //其他不同的属性
                newEntity.StepName = p_strStepName; //步骤
                newEntity.ReceiveUserID = p_strUserID; //接收用户
                newEntity.D_StepStatus = String.IsNullOrEmpty(p_strPoolID) ? "Assign" : "New";//公办:New 其他:Assign
                return newEntity.Save();
            }
            catch (Exception ex)
            {
                String e = ex.ToString();
                return false;
            }
        }
Esempio n. 29
0
        public void SetPrintBeginExport(UC_Print ucPrint, B_PF cEntity)
        {
            switch (ucPrint.FileName)
            {
                case "程序文件表单":
                    SetBaseExportData(ucPrint, cEntity);
                    ucPrint.ExportData.Add(cEntity.CirculateSignDept);    //<col>部门:|inner</col>
                    ucPrint.ExportData.Add(cEntity.CirculateSignUserName);        //<col>人员:|inner</col>
                    ucPrint.ExportData.Add(cEntity.CirculateDeptName);    //<col>部门: |inner</col>
                    ucPrint.ExportData.Add(cEntity.CirculateName);//<col>人员: |inner</col>
                    ucPrint.ExportData.Add(cEntity.CirculateComment);       //<col>意见:|right</col>

                    ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList));     //<col>附件:|down</col>
                    break;
                case "管理程序变更申请表":
                    if (cEntity.ProgramSort == "管理程序")
                    {
                        ucPrint.ExportData.Add("管理程序变更申请表");//<col>管理程序变更申请表|shift</col>
                        ucPrint.ExportData.Add("HN-LL431");//<col>HN-LL431|shift</col>
                    }
                    if (cEntity.ProgramSort == "工作程序")
                    {
                        ucPrint.ExportData.Add("工作程序变更申请表");//<col>管理程序变更申请表|shift</col>
                        ucPrint.ExportData.Add("HN-LL432");//<col>HN-LL431|shift</col>
                    }
                    if (cEntity.ProgramSort == "部门级管理程序")
                    {
                        ucPrint.ExportData.Add("管理程序变更申请表");//<col>管理程序变更申请表|shift</col>
                        ucPrint.ExportData.Add("HN-LL433");//<col>HN-LL431|shift</col>
                    }
                    ucPrint.ExportData.Add(string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year);  //<col>年份|shift</col>
                    /*待定*/
                    ucPrint.ExportData.Add(cEntity.SerialID);                          //<col>序号|shift</col>
                    ucPrint.ExportData.Add(cEntity.DocumentTitle);                       //<col>文件名称|right</col>
                    ucPrint.ExportData.Add(cEntity.ProgramCode + " , " + cEntity.Edition);//<col>编码版本|right</col>
                    ucPrint.ExportData.Add(OADept.GetDeptName(cEntity.SendDeptID)); //<col>申请部门|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));     //<col>申请日期|right</col>
                    ucPrint.ExportData.Add(cEntity.ApplyStyle);                        //<col>申请类型|right</col>
                    //ucPrint.ExportData.Add(cEntity.ApplyReason);                       //<col>原因:|inner</col>
                    //ucPrint.ExportData.Add(cEntity.RelationProgram/*RelationDemand*/);                    //<col>可能受到影响的程序:|inner</col>
                    ucPrint.ExportData.Add(cEntity.Drafter);                           //<col>申请人姓名|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));     //<col>日期|right</col>
                    ucPrint.ExportData.Add(OAUser.GetDeptManager(cEntity.SendDeptID, ConstString.Grade.ZERO));                         //<col>编制部门负责人姓名|right</col>
                    //M_20100414 huangqi des:编写时间改为FirstDraftDate
                    //begin
                    if (cEntity.FirstDraftDate != DateTime.MinValue)
                    {
                        ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString()));     //<col>日期 |right</col>
                    }
                    else
                    {
                        ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));
                    }
                    //end

                    //ucPrint.ExportData.Add(cEntity.QualityApproveComment
                    //PF.GetNotionComment(cEntity.ProcessID, ConstString.ProcessStepName.PROGRAM_QUALITY)*/);                      //<col>意见:|inner</col>
                    ucPrint.ExportData.Add(cEntity.AuditName);                         //<col>审核人姓名|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString()));     //<col>日期  |right</col>
                    ucPrint.ExportData.Add(cEntity.QualityNames);                      //<col>质保处负责人姓名|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.QualityDate.ToShortDateString()));   //<col>日期   |right</col>
                    ucPrint.ExportData.Add("该程序已经更新发布");                      //<col>网页更新结果:|inner</col>
                    /*待定*/
                    ucPrint.ExportData.Add(""/*OAList.GetUserNameByWorkItemID(cEntity.WorkItemID)*/);                                        //<col>信息文档处操作人姓名|right</col>
                    //ucPrint.ExportData.Add(string.IsNullOrEmpty(cEntity.SendDate.ToShortDateString()) ?
                    //    DateTime.Now.ToShortDateString() : ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())
                    //    );                                        //<col>日期    |right</col>

                    ucPrint.ExportData.Add(string.IsNullOrEmpty(ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())) ?
                        DateTime.Now.ToShortDateString() : ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString()));  //<col>日期    |right</col>

                    ucPrint.AttachFileList = cEntity.FileList;
                    ucPrint.Position = "可能受到影响的程序:";//(string)ucPrint.ExportData[2];
                    ucPrint.Mode = WriteMode.Up;
                    break;
                case "管理程序封面模板":
                    if (cEntity.ProgramSort == "管理程序")
                    {
                        ucPrint.ExportData.Add("管理程序");    //<col>管理程序|shift</col>
                        //ucPrint.ExportData.Add("HN-LL431-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>HN编码:|right</col>
                    }
                    if (cEntity.ProgramSort == "工作程序")
                    {
                        ucPrint.ExportData.Add("工作程序");    //<col>管理程序|shift</col>
                        //ucPrint.ExportData.Add("HN-LL432-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>HN编码:|right</col>
                        cEntity.QualityNames = "";
                    }
                    if (cEntity.ProgramSort == "部门级管理程序")
                    {
                        ucPrint.ExportData.Add("管理程序");    //<col>管理程序|shift</col>
                        //ucPrint.ExportData.Add("HN-LL433-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>HN编码:|right</col>
                    }
                    ucPrint.ExportData.Add(cEntity.ProgramCode);
                    ucPrint.ExportData.Add(cEntity.Edition);    //<col>版次:|right</col>
                    ucPrint.ExportData.Add(cEntity.DocumentTitle);    //<col>程序名称|shift</col>
                    if (cEntity.ApproveDate.ToShortDateString() == DateTime.MinValue.ToShortDateString())
                    {
                        ucPrint.ExportData.Add("");
                        ucPrint.ExportData.Add("");

                    }
                    else
                    {
                        ucPrint.ExportData.Add(cEntity.ApproveName);    //<col>批准实施:|right</col>
                        ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ApproveDate.ToShortDateString()));    //<col>生效日期:|right</col>
                    }
                    ucPrint.ExportData.Add(cEntity.WriteName);    //<col>编制姓名|shift</col>
                    //M_20100414 huangqi des:编写时间改为FirstDraftDate
                    //begin
                    if (cEntity.FirstDraftDate != DateTime.MinValue)
                    {
                        ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString()));     //<col>日期 |shift</col>
                    }
                    else
                    {
                        ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));
                    }
                    //end
                    ucPrint.ExportData.Add(cEntity.CheckName);    //<col>校核姓名|shift</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.CheckDate.ToShortDateString()));    //<col>校核日期|shift</col>
                    ucPrint.ExportData.Add(cEntity.AuditName);    //<col>审核姓名|shift</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString()));    //<col>审核日期|shift</col>
                    ucPrint.ExportData.Add(cEntity.QualityNames);    //<col>质保姓名|shift</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.QualityDate.ToShortDateString()));    //<col>质保日期|shift</col>
                    ucPrint.ExportData.Add(OADept.GetDeptName(cEntity.SendDeptID));    //<col>程序编制部门:|shift</col>

                    ucPrint.AttachFileList = cEntity.FileList;
                    //ucPrint.Position = "";//(string)ucPrint.ExportData[2];
                    //ucPrint.Mode = WriteMode.Up;
                    break;
                case "程序审查意见落实表":
                    //string num = "";
                    //if (cEntity.ProgramSort == "管理程序")
                    //{
                    //    num = "HN-LL431-";
                    //}
                    //if (cEntity.ProgramSort == "工作程序")
                    //{
                    //    num = "HN-LL432-";
                    //}
                    //if (cEntity.ProgramSort == "部门级管理程序")
                    //{
                    //    num = "HN-LL433-";
                    //}
                    //ucPrint.ExportData.Add(num + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID);    //<col>年份|shift</col>
                    ucPrint.ExportData.Add(cEntity.ProgramCode);
                    ///*待定*/
                    ucPrint.ExportData.Add("");    //<col>第|right</col>
                    ucPrint.ExportData.Add(cEntity.DocumentTitle);    //<col>程序名称:|inner</col>
                    ucPrint.ExportData.Add(cEntity.ProgramCode + "    " + cEntity.Edition);    //<col>程序编码和版本:|inner</col>

                    //renjinquan+
                    //if (cEntity.ProgramSort == "管理程序")
                    //{
                    //    //ucPrint.ExportData.Add("管理程序");    //<col>管理程序|shift</col>
                    //    ucPrint.ExportData.Add("HN-LL431"+"    " + cEntity.Edition);    //<col>HN编码:|right</col>
                    //}
                    //if (cEntity.ProgramSort == "工作程序")
                    //{
                    //    //ucPrint.ExportData.Add("工作程序");    //<col>管理程序|shift</col>
                    //    ucPrint.ExportData.Add("HN-LL432"+"    " + cEntity.Edition);    //<col>HN编码:|right</col>
                    //}
                    //if (cEntity.ProgramSort == "部门级管理程序")
                    //{
                    //    //ucPrint.ExportData.Add("管理程序");    //<col>管理程序|shift</col>
                    //    ucPrint.ExportData.Add("HN-LL433"+"    " + cEntity.Edition);    //<col>HN编码:|right</col>
                    //}

                    //ucPrint.ExportData.Add(cEntity.RelationDemand);    //<col>对相关程序修订要求或建议:|inner</col>
                    //ucPrint.ExportData.Add(cEntity.RelationProgram/*cEntity.DocumentTitle + "" + cEntity.ProgramCode*/);    //<col>相关程序名称和编码:|inner</col>
                    //ucPrint.ExportData.Add(cEntity.ApproveName);    //<col>批准|right</col>
                    //ucPrint.ExportData.Add(cEntity.ApproveDate.ToShortDateString());    //<col>日期|right</col>
                    ucPrint.ExportData.Add(cEntity.AuditName);    //<col>审核|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString()));    //<col>日期 |right</col>
                    ucPrint.ExportData.Add(cEntity.CheckName);    //<col>校核|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.CheckDate.ToShortDateString()));    //<col>日期  |right</col>
                    ucPrint.ExportData.Add(cEntity.WriteName);    //<col>编制|right</col>
                    //M_20100414 huangqi des:编写时间改为FirstDraftDate
                    //begin
                    if (cEntity.FirstDraftDate != DateTime.MinValue)
                    {
                        ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString()));     //<col>日期 |right</col>
                    }
                    else
                    {
                        ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));
                    }
                    //end
                    ucPrint.AttachFileList = cEntity.FileList;
                    //ucPrint.Position = "";//(string)ucPrint.ExportData[2];
                    //ucPrint.Mode = WriteMode.Up;
                    break;
            }
        }
        private ArrayList GeneratorTableDataEx(UC_Print ucPrint, int TblIndex, B_PF cEntity)
        {
            ArrayList al = new ArrayList();
            ArrayList tmp = new ArrayList();
            switch (TblIndex)
            {
                case 2:
                    if (cEntity.DeptSignList == null) break;

                    //lsqkdeptyijian += yijian.Content + "\r\a";
                    //lsqkdeptyijianluoshi += yijian.DealCondition + "\r\a";
                    for (int i = 0; i < cEntity.DeptSignList.Count; i += 2)
                    {
                        tmp = new ArrayList();
                        M_ProgramFile.DeptSign item = cEntity.DeptSignList[i];
                        tmp.Add(item.DeptName);
                        tmp.Add(item.Name);
                        tmp.Add(ucPrint.CheckDateTime(item.SubmitDate.ToShortDateString()));

                        if (cEntity.DeptSignList.Count <= i + 1)
                        {
                            tmp.Add("");
                            tmp.Add("");
                            tmp.Add("");
                            al.Add(tmp);
                            return al;
                        }
                        item = cEntity.DeptSignList[i + 1];
                        tmp.Add(item.DeptName);
                        tmp.Add(item.Name);
                        tmp.Add(ucPrint.CheckDateTime(item.SubmitDate.ToShortDateString()));
                        al.Add(tmp);
                    }
                    break;
                case 3:
                    if (cEntity.LeaderSignList == null) break;
                    for (int i = 0; i < cEntity.LeaderSignList.Count; i++)
                    {
                        tmp = new ArrayList();
                        M_ProgramFile.LeaderSign item = cEntity.LeaderSignList[i];
                        tmp.Add(item.Name);
                        tmp.Add(ucPrint.CheckDateTime(item.Date.ToShortDateString()));
                        al.Add(tmp);
                    }
                    break;
                case 5:
                    List<B_PF.ProgramFile> lst = B_PF.GetProgramFileEditionHistory(cEntity.ProgramCode, cEntity.ProgramFileID);
                    if (lst == null) break;
                    for (int i = 0; i < lst.Count; i++)
                    {
                        tmp = new ArrayList();
                        tmp.Add(lst[i].Edition);
                        tmp.Add(lst[i].Writer);
                        tmp.Add(lst[i].Approver);
                        tmp.Add(ucPrint.CheckDateTime(lst[i].FinishTime.ToShortDateString()));
                        tmp.Add(lst[i].Reason);
                        al.Add(tmp);
                    }
                    break;
            }
            return al;
        }
Esempio n. 31
0
        private void DoWorkItem(Hashtable p_nvAttributes, Boolean p_blnIsProcessCreated)
        {
            B_FormsData l_busFormsData = null;

            try
            {
                if (!p_blnIsProcessCreated)
                {
                    //创建流程
                    WorkFlowBase.CreateProcess(this.TemplateName, this.ProcessID, p_nvAttributes);

                    //获取第一个节点并且完成。
                    l_busFormsData  = new B_FormsData();
                    this.WorkItemID = l_busFormsData.GetFirstWorkItemID(this.ProcessID);

                    UpdateDBWorkItem(this.WorkItemID, true, "", "", "", this.StepName, true);

                    if (base.TemplateName.Contains("收文"))
                    {
                        WorkFlowBase.CompleteWorkItem(this.WorkItemID, p_nvAttributes);//完成第一个节点
                    }
                    if (base.TemplateName.Contains("会务费用报销单") || base.TemplateName.Contains("招待费报销单"))
                    {
                        WorkFlowBase.CompleteWorkItem(this.WorkItemID, p_nvAttributes);//完成第一个节点
                    }
                }
                else
                {
                    WorkFlowBase.CompleteWorkItem(this.WorkItemID, p_nvAttributes);//完成当前节点

                    if (base.TemplateName == ProcessConstString.TemplateName.PROGRAM_FILE &&
                        (base.StepName == ProcessConstString.StepName.ProgramFile.STEP_DEPTSIGN ||
                         base.StepName == ProcessConstString.StepName.ProgramFile.STEP_LEADERSIGN))
                    {
                        EntityBase entitybase = ControlToEntity(false);

                        B_PF          pfEntity = entitybase != null ? entitybase as B_PF : new B_PF();
                        List <String> strIDs   = B_FormsData.GetMultiParapllelInfo(TableName.WorkItemsTableName.T_OA_HN_PF_WorkItems, base.ProcessID, base.StepName, pfEntity.TimesFlag);
                        foreach (String strID in strIDs)
                        {
                            B_PF entity = new B_PF();
                            //更新其它会签记录
                            entity.ID             = Convert.ToInt32(strID);
                            entity                = XmlUtility.DeSerializeXml <B_PF>(entity.FormsData);
                            entity.ID             = Convert.ToInt32(strID);
                            entity.LeaderSignList = pfEntity.LeaderSignList;                           //领导已会签意见内容
                            entity.DeptSignList   = B_PF.GetDeptSignList(entity.DeptSignList, strIDs); //部门已会签意见内容
                            entity.IsSignReject   = pfEntity.IsSignReject;                             //是否否决

                            if (entity.WorkItemID == pfEntity.WorkItemID)
                            {
                                entity.D_StepStatus = "Completed";
                                entity.SubmitAction = this.SubAction;
                                entity.CommentList  = pfEntity.CommentList;
                                //entity.DeptSignList = B_PF.GetDeptSignList(entity.DeptSignList, strIDs);
                            }//更新当前节点用户
                            entity.FormsData = XmlUtility.SerializeXml(entity);
                            if (!entity.Save())
                            {
                                throw new Exception(entity.ErrMsgs.ToString());
                            }
                        }
                        pfEntity.ID = int.MinValue;//清空ID
                    }

                    if (base.TemplateName == ProcessConstString.TemplateName.AFFILIATION &&
                        (base.StepName == ProcessConstString.StepName.WorkRelationStepName.STEP_DEPTSIGN))
                    {
                        EntityBase entitybase = ControlToEntity(false);

                        B_WorkRelation wrEntity = entitybase != null ? entitybase as B_WorkRelation : new B_WorkRelation();
                        List <String>  strIDs   = B_FormsData.GetMultiParapllelInfo(TableName.WorkItemsTableName.T_OA_WR_WorkItems, base.ProcessID, base.StepName, wrEntity.TimesFlag);
                        foreach (String strID in strIDs)
                        {
                            B_WorkRelation entity = new B_WorkRelation();
                            //更新其它会签记录
                            entity.ID           = Convert.ToInt32(strID);
                            entity              = XmlUtility.DeSerializeXml <B_WorkRelation>(entity.FormsData);
                            entity.ID           = Convert.ToInt32(strID);
                            entity.DeptSignList = B_WorkRelation.GetDeptSignList(entity.DeptSignList, strIDs); //部门已会签意见内容
                            entity.IsSignReject = wrEntity.IsSignReject;                                       //是否否决

                            if (entity.WorkItemID == wrEntity.WorkItemID)
                            {
                                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_SUBMIT)
                                {
                                    entity.D_StepStatus = "Completed";
                                }
                                entity.SubmitAction = this.SubAction;
                                entity.CommentList  = wrEntity.CommentList;
                            }//更新当前节点用户
                            entity.FormsData = XmlUtility.SerializeXml(entity);
                            if (!entity.Save())
                            {
                                throw new Exception(entity.ErrMsgs.ToString());
                            }
                        }
                        wrEntity.ID = int.MinValue;//清空ID
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void Print_OnBeginExport(object sender, EventArgs e)
        {
            if (m_print == null || m_print.m_ls == null || m_print.m_ls.Count == 0) return;
            Print print = new Print();

            m_Entity = m_print.m_CurrEntity as B_PF;
            m_Entity.ProcessID = base.ProcessID;
            m_Entity.WorkItemID = base.WorkItemID;
            print.SetPrintBeginExport(m_print, m_Entity);
        }
        private string Devolve2DC(HN_OA2DC oaDev, B_PF enProFile, string strDraftDept, string dealUser, string sProcessName)
        {
            string sXml = "";
            FounderSoftware.ADIM.OA.OA2DC.HNDC_CArchiveNode ar = new HNDC_CArchiveNode();
            FounderSoftware.ADIM.OA.OA2DC.HNDC_CFileNode fl = new HNDC_CFileNode();

            #region 开始生成Archive节点
            ar.System = "OA_" + base.IdentityID.ToString();
            string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            switch (ObjPlatForm)
            {
                case "DC":
                    ar.SysFlag = "1";
                    break;
                case "FC":
                    ar.SysFlag = "2";
                    break;
                default:
                    ar.SysFlag = "1";
                    break;
            }

            // 文件编码-程序编码
            ar.Code = enProFile.ProgramCode;
            // 编制单位-主办部门
            ar.FormationDept = strDraftDept;
            // 题名-程序名称
            ar.Title = enProFile.DocumentTitle;
            // 功能领域-程序子类
            ar.FunctionField = B_ProgramFileInfo.GetProSubTypeName(enProFile.ProgramFileID);
            // 版本-版次
            ar.Revision = enProFile.Edition;
            // 页数-总页数
            ar.DocPages = enProFile.TextPageSum;
            // 批准者-批准操作人
            ar.Authorizer = enProFile.ApproveName;
            // 生效日期-批准日期
            ar.AuthorizeTime = CheckDateTime(enProFile.ApproveDate.ToString());
            // 审核者-审核操作人
            ar.Auditby = enProFile.AuditName;
            // 审核日期-审核日期
            ar.AuditDate = CheckDateTime(enProFile.AuditDate.ToString());
            // 校核者-校核操作人
            ar.Checkthose = enProFile.CheckName;
            // 校核日期-校核日期
            ar.CheckDate = CheckDateTime(enProFile.CheckDate.ToString());
            // 编制人-编制操作人
            ar.Author = enProFile.WriteName;
            // 编制日期-编制日期
            ar.FormationTime = CheckDateTime(enProFile.WriteDate.ToString());

            //ar.FK_CategoryID = "903";
            // 公共常量
            //ar.GatherLevel = "件";
            //ar.D_StorageCarrierType = "纸质";
            //ar.Amount = "1";
            //ar.D_Language = "中文";
            ar.ElectronicDocumentCount = enProFile.FileList.Count.ToString();
            #endregion
            sXml = oaDev.GenOAArchiveNode(ar, sProcessName);

            /****开始生成File节点************************************************************************/
            #region 开始生成File节点
            fl.AuthorizeTime = ar.AuthorizeTime;
            fl.Code = ar.Code;
            fl.Code19 = ar.Code19;
            fl.D_FileStatus = ar.D_FileStatus;
            fl.DocCodesExplain = "";
            fl.DocPages = ar.DocPages;
            fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime;
            fl.Ext_1 = ar.Ext_1;
            fl.Ext_2 = ar.Ext_2;
            fl.Ext_3 = ar.Ext_3;
            fl.Ext_4 = ar.Ext_4;
            fl.Ext_5 = ar.Ext_5;
            fl.Title = ar.Title;
            fl.FK_ArchiveID = ar.FK_Archive;
            fl.FK_CategoryID = ar.FK_CategoryID;
            fl.FormationDept = ar.FormationDept;
            fl.FormationTime = ar.FormationTime;
            fl.Importer = ar.Importer;
            fl.ImporterTime = ar.ImporterTime;
            fl.OriginalID = ar.OriginalID;
            fl.OtherTitle = ar.OtherTitle;
            fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime;
            fl.RelatedCode = ar.RelatedCode;
            fl.Revision = ar.Revision;
            #endregion
            sXml = oaDev.GenOAFileNode(fl);
            /****完成生成File节点************************************************************************/

            #region 始生成Attachment节点
            /****开始生成Attachment节点******************************************************************/
            string sServerWeb = oaDev.GetCfgNodeValues("/Devolve/Other/ServerWeb");
            //"http://172.29.128.239";
            //string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName");
            for (int i = 0; i < enProFile.FileList.Count; i++)
            {
                HNDC_CAttachmentNode at = new HNDC_CAttachmentNode();
                CFuJian file = enProFile.FileList[i];

                at.DocumentName = ProcessConstString.TemplateName.PROGRAM_FILE; //file.FileName;
                at.FK_FileID = "";
                at.MakeDate = "";
                at.MakeUnit = "";
                at.PublishedTime = "";
                at.Remark = "";

                at.ServerWeb = sServerWeb;
                Double iSize = 0;
                string sSize = file.Size.ToUpper();
                if (sSize.Contains("K"))
                {
                    sSize = sSize.Replace("K", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024;
                }
                if (sSize.Contains("M"))
                {
                    sSize = sSize.Replace("M", "");
                    iSize = Convert.ToDouble(sSize);
                    iSize = iSize * 1024 * 1024;
                }
                at.Size = ((int)iSize).ToString();
                at.TimeSize = "";
                at.Title = file.Alias;
                at.Type = file.Type;
                at.Url = file.URL;

                sXml = oaDev.GenOAAttachmentNode(fl.FK_ArchiveID, at);
            }
            #endregion
            /****完成生成Attachment节点******************************************************************/

            return sXml;
        }
        //任金权 修改
        private ArrayList GeneratorTableData(int TblIndex, B_PF cEntity)
        {
            ArrayList al = new ArrayList();
            B_PF pf = new B_PF();
            switch (TblIndex)
            {
                case 2:
                    List<M_ProgramFile.DeptSign> Dhqlist = new List<M_ProgramFile.DeptSign>();
                    Dhqlist = this.ucBuMenHuiQian.UCGetHQList();
                    for (int i = 0; i < Dhqlist.Count; i++)
                    {
                        M_ProgramFile.DeptSign item = Dhqlist[i];
                        foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_DEPTSIGN, item.ID, string.Empty))
                        {
                            ArrayList tmp = new ArrayList();
                            tmp.Add(item.DeptName);
                            tmp.Add(yijian.Content);
                            tmp.Add(yijian.DealCondition);
                            al.Add(tmp);
                        }
                    }
                    ArrayList tmpEx = new ArrayList();
                    string lsqkdeptyijian = string.Empty;
                    string lsqkdeptyijianluoshi = string.Empty;
                    foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_QG, this.wfQualityIDs.Text, string.Empty))
                    {
                        //lsqkdeptyijian += yijian.Content + "\r\a";
                        //lsqkdeptyijianluoshi += yijian.DealCondition + "\r\a";
                        tmpEx = new ArrayList();
                        tmpEx.Add("质量保证处");
                        tmpEx.Add(yijian.Content);
                        tmpEx.Add(yijian.DealCondition);
                        al.Add(tmpEx);
                    }
                    break;
                case 3:
                    List<M_ProgramFile.LeaderSign> lhqlist = new List<M_ProgramFile.LeaderSign>();
                    lhqlist = this.ucLDHuiQian.UCGetHQList();
                    for (int i = 0; i < lhqlist.Count; i++)
                    {
                        M_ProgramFile.LeaderSign item = lhqlist[i];
                        foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_LEADERSIGN, item.ID, string.Empty))
                        {
                            ArrayList tmp = new ArrayList();
                            tmp.Add(yijian.UserName);
                            tmp.Add(yijian.Content);
                            tmp.Add(yijian.DealCondition);
                            al.Add(tmp);
                        }
                    }
                    tmpEx = new ArrayList();
                    string lsqkpeopleyijian = string.Empty;
                    string lsqkpeopleyijianluoshi = string.Empty;
                    if (!string.IsNullOrEmpty(this.ddlApprove.SelectedValue))
                    {
                        foreach (B_PF.YiJian yijian in pf.GetSignComment(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.ProgramFile.STEP_APPROVE, this.ddlApprove.SelectedValue, string.Empty))
                        {
                            //lsqkpeopleyijian += yijian.Content + "\r\a";
                            //lsqkpeopleyijianluoshi += yijian.DealCondition + "\r\a";
                            tmpEx = new ArrayList();
                            tmpEx.Add(yijian.UserName);
                            tmpEx.Add(yijian.Content);
                            tmpEx.Add(yijian.DealCondition);
                            al.Add(tmpEx);
                        }
                    }
                    break;
                case 5:
                    if (cEntity.DeptSignList == null) break;
                    for (int i = 0; i < cEntity.DeptSignList.Count; i++)
                    {
                        ArrayList tmp = new ArrayList();
                        M_ProgramFile.DeptSign item = cEntity.DeptSignList[i];
                        if (string.IsNullOrEmpty(item.Comment)) continue;
                        tmp.Add(item.DeptName);
                        tmp.Add(item.Comment);
                        tmp.Add(item.DealCondition);
                        al.Add(tmp);
                    }
                    break;
            }

            return al;
        }
        public string Devolve(B_PF enProFile, string strDraftDept, string dealUser, out string sResult)
        {
            sResult = "";
            string sProcessName = "";
            switch (enProFile.ProgramSort)
            {
                case "部门级管理程序":
                    if ("IDP部门管理程序" == enProFile.ProgramType1)
                    {
                        sProcessName = "部门管理程序";
                    }
                    break;
                case "管理程序":
                    switch (enProFile.ProgramType1)
                    {
                        case "PRG项目管理分大纲":
                        case "GPG质量保证大纲":
                            sProcessName = "大纲级管理程序";
                            break;
                        case "PRC公司管理程序":
                            sProcessName = "公司级管理程序";
                            break;
                    }
                    break;
                case "工作程序":
                    sProcessName = enProFile.ProgramSort;
                    break;
            }

            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));
            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            //FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档
            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            string s = "";
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(dcDev, enProFile, strDraftDept, dealUser, sProcessName);

                //B_PF cEntity = new B_PF();
                //SetEntity(cEntity);
                B_PF cEntity = this.ControlToEntity(false) as B_PF;
                cEntity.FormsData = XmlUtility.SerializeXml(cEntity);
                s = oa2dc.SendDevolve(xml, cEntity.FormsData, "程序文件");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }
            else
            {
                return "尚无归档模板,请联系系统管理员。";
            }

            return s;
            //if (objDevolve.ToUpper() == "DP")
            //{
            //    FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
            //    xml = Devolve2DP(dpDev);
            //    s = oa2dp.SendDevolve(xml);
            //}
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        //private string Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp)
        //{
        //string sXml = "";
        //#region ArchiveNode
        //FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode();
        //ar.System = "OA_" + base.TableID;
        //// Pace-缓急程度
        ////ar.Pace = chkJinJi.Checked ? "0" : "1";
        //// 页数
        //ar.DocPages = txtPages.Text;
        //// 通讯渠道号
        //ar.CommunicationChannelCode = txtOurRef.Text;
        //#region 签发人 签发日期
        //if (txtSignDate.Text != "")
        //{
        //    if (txtSignDate.Text.Contains(" "))
        //    {
        //        //签发日期-批准日期
        //        ar.AuthorizeTime = txtSignDate.Text.Split(' ')[1];
        //    }
        //    else
        //    {
        //        //签发日期-批准日期
        //        ar.AuthorizeTime = txtSignDate.Text;
        //    }
        //    //签发人-批准者
        //    ar.Authorizer = txtQianFaRen.Text;
        //}
        //#endregion
        //// 会签者
        ////ar.Countersigner = txtHuiQianRen.Text;
        //// 会签日期
        ////ar.CountersignedDate = txtHuiQianRenDates.Text;
        //#region 核稿人-校核者
        //////核稿人-校核者
        ////if (txtHeGaoRenDate.Text != "")
        ////{
        ////    if (txtHeGaoRenDate.Text.Contains(" "))
        ////    {
        ////        //核稿日期-校核日期
        ////        ar.CheckDate = txtHeGaoRenDate.Text.Split(' ')[1];
        ////    }
        ////    else
        ////    {
        ////        //核稿日期-校核日期
        ////        ar.CheckDate = txtHeGaoRenDate.Text;
        ////    }
        ////    //核稿人-校核者
        ////    ar.Checkthose = txtHeGaoRenDate.Text;
        ////}
        //#endregion
        //// 编制人/编制日期
        //// 编制单位
        //ar.FormationDept = drpSendDept.SelectedItem.Text;
        //// 题名
        //ar.Title = txtSubject.Text;
        //// 主送单位
        //ar.MainDispenseUnit = txtCompany.Text;
        //// 抄送单位
        //ar.RelatedDespenseUnit = txtccCompany.Text;
        //// 备注
        //ar.Remark = txtMyPrompt.Text;
        ////ar.FK_CategoryID = "903";
        //// 公共常量
        ////ar.GatherLevel = "件";
        ////ar.D_StorageCarrierType = "纸质";
        ////ar.Amount = "1";
        ////ar.D_Language = "中文";
        //ar.ElectronicDocumentCount = UCFileControl1.UCDataList.Count.ToString();
        //#endregion
        //sXml = hn_oa2dp.GenOAArchiveNode(ar, base.TemplateID);

        //FounderSoftware.ADIM.OA.OA2DP.HNDP_CFileNode fl = new HNDP_CFileNode();
        ///****开始生成File节点************************************************************************/
        //#region 开始生成File节点
        //fl.AuthorizeTime = ar.AuthorizeTime;
        //fl.Code = ar.Code;
        //fl.Code19 = ar.Code19;
        //fl.D_FileStatus = ar.D_FileStatus;
        //fl.DocCodesExplain = "";
        //fl.DocPages = ar.DocPages;
        //fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime;
        //fl.Ext_1 = ar.Ext_1;
        //fl.Ext_2 = ar.Ext_2;
        //fl.Ext_3 = ar.Ext_3;
        //fl.Ext_4 = ar.Ext_4;
        //fl.Ext_5 = ar.Ext_5;
        //fl.Title = ar.Title;
        ////fl.FK_ArchiveID = ar.FK_Archive;
        //fl.FK_CategoryID = ar.FK_CategoryID;
        //fl.FormationDept = ar.FormationDept;
        //fl.FormationTime = ar.FormationTime;
        //fl.Importer = ar.Importer;
        //fl.ImporterTime = ar.ImporterTime;
        //fl.OriginalID = ar.OriginalID;
        //fl.OtherTitle = ar.OtherTitle;
        //fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime;
        //fl.RelatedCode = ar.RelatedCode;
        //fl.Revision = ar.Revision;
        //#endregion
        //sXml = hn_oa2dp.GenOAFileNode(fl);
        ///****完成生成File节点************************************************************************/

        //#region 始生成Attachment节点
        ///****开始生成Attachment节点******************************************************************/
        //string sServerWeb = hn_oa2dp.GetCfgNodeValues("/Devolve/Other/ServerWeb");
        ////"http://172.29.128.239";
        ////string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName");
        //for (int i = 0; i < UCFileControl1.UCDataList.Count; i++)
        //{
        //    FounderSoftware.ADIM.OA.OA2DP.HNDP_CAttachmentNode at = new HNDP_CAttachmentNode();
        //    CFuJian file = UCFileControl1.UCDataList[i];

        //    at.DocumentName = "函件发文";//file.FileName;
        //    at.FK_FileID = "";
        //    at.MakeDate = "";
        //    at.MakeUnit = "";
        //    at.PublishedTime = "";
        //    at.Remark = "";

        //    at.ServerWeb = sServerWeb;
        //    Double iSize = 0;
        //    string sSize = file.Size.ToUpper();
        //    if (sSize.Contains("K"))
        //    {
        //        sSize = sSize.Replace("K", "");
        //        iSize = Convert.ToDouble(sSize);
        //        iSize = iSize * 1024;
        //    }
        //    if (sSize.Contains("M"))
        //    {
        //        sSize = sSize.Replace("M", "");
        //        iSize = Convert.ToDouble(sSize);
        //        iSize = iSize * 1024 * 1024;
        //    }
        //    at.Size = ((int)iSize).ToString();
        //    at.TimeSize = "";
        //    at.Title = file.Alias;
        //    at.Type = file.Type;
        //    at.Url = file.URL;

        //    sXml = hn_oa2dp.GenOAAttachmentNode(fl.FK_ArchiveID, at);
        //}
        //#endregion
        ///****完成生成Attachment节点******************************************************************/

        //    return sXml;
        //}
        #endregion

        public string Devolve(B_PF enProFile, string strDraftDept, string dealUser, out string sResult)
        {
            sResult = "";
            string sProcessName = "";

            switch (enProFile.ProgramSort)
            {
            case "部门级管理程序":
                if ("IDP部门管理程序" == enProFile.ProgramType1)
                {
                    sProcessName = "部门管理程序";
                }
                break;

            case "管理程序":
                switch (enProFile.ProgramType1)
                {
                case "PRG项目管理分大纲":
                case "GPG质量保证大纲":
                    sProcessName = "大纲级管理程序";
                    break;

                case "PRC公司管理程序":
                    sProcessName = "公司级管理程序";
                    break;
                }
                break;

            case "工作程序":
                sProcessName = enProFile.ProgramSort;
                break;
            }

            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));

            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            //FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档

            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml        = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            string s          = "";

            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(dcDev, enProFile, strDraftDept, dealUser, sProcessName);

                //B_PF cEntity = new B_PF();
                //SetEntity(cEntity);
                B_PF cEntity = this.ControlToEntity(false) as B_PF;
                cEntity.FormsData = XmlUtility.SerializeXml(cEntity);
                s        = oa2dc.SendDevolve(xml, cEntity.FormsData, "程序文件");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }
            else
            {
                return("尚无归档模板,请联系系统管理员。");
            }

            return(s);
            //if (objDevolve.ToUpper() == "DP")
            //{
            //    FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
            //    xml = Devolve2DP(dpDev);
            //    s = oa2dp.SendDevolve(xml);
            //}
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }