Пример #1
0
        private void ucPrint_OnExtraExport(object sender, EventArgs e)
        {
            B_LetterReceive cEntity = null;//this.ControlToEntity(false) as B_LetterReceive;

            if (base.IsPreview)
            {
                cEntity = base.EntityData != null ? base.EntityData as B_LetterReceive : new B_LetterReceive();
            }
            else
            {
                cEntity = this.ControlToEntity(false) as B_LetterReceive;
            }

            switch (ucPrint.FileName)
            {
            case "函件收文表单":
                ucPrint.BatchAddPicture("函件收文", "函件收文表单", cEntity);
                break;
            }
            // 当模板中无法用之前的方法正确导出数据时,在本事件中调用
            // ucPrint.Write(string key, string value, WriteMode mode, int offset)方法处理导出数据

            //Print print = new Print();
            //B_LetterReceive cEntity = new B_LetterReceive();
            //this.PopulateEntity(cEntity);
            //ucPrint.Write("传阅签名", cEntity.CommonID, WordMgr.WriteMode.Right, 3);
            //ucPrint.Write("日期", "2009.2.6", WordMgr.WriteMode.Right, 3);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_HSEdit    l_BusReceiveEdit  = null;
            B_Circulate l_BusCirculate    = null;
            DataTable   l_dtbCirculate    = null;
            DataTable   l_dtbProcessSteps = null;
            String      l_strRegisterID   = null;

            B_LetterReceive l_objWorkItem = null;

            WFBaseProcessInstance l_objProcessInstance = null;

            if (!Page.IsPostBack)
            {
                this.ucAttachment.UCIsEditable = false;

                PreviousPageUrl     = Request.UrlReferrer.ToString();
                l_strRegisterID     = Request.QueryString[ConstString.QueryString.REGISTER_ID];
                l_BusReceiveEdit    = new B_HSEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(l_strRegisterID);

                if (l_BusReceiveEdit == null)
                {
                    ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "当前的ID或者无效,或者已经被删除!");
                    return;
                }

                this.ucAttachment.UCTemplateName = l_BusReceiveEdit.ProcessName;

                PopulateField(l_BusReceiveEdit);

                if (String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID))
                {
                    divPrompt.Visible = true;
                    return;
                }
                l_objProcessInstance = FS.OA.Framework.WorkFlow.WFFactory.GetWF(FS.OA.Framework.WorkFlow.WFType.AgilePoint).GetAPI().GetProcInst(l_BusReceiveEdit.ProcessID);

                if (l_objProcessInstance != null)
                {
                    m_strProcessTemplate = l_objProcessInstance.DefName;

                    String l_strCirculateTableName = FS.ADIM.OA.BLL.Common.TableName.GetCirculateTableName(l_objProcessInstance.DefName);
                    l_BusCirculate          = new B_Circulate(l_strCirculateTableName);
                    l_dtbCirculate          = l_BusCirculate.GetCirculatesByID(l_strCirculateTableName, l_BusReceiveEdit.ProcessID, 0);
                    gdvCirculate.DataSource = l_dtbCirculate;
                    gdvCirculate.DataBind();

                    l_objWorkItem = new B_LetterReceive();

                    l_dtbProcessSteps = l_objWorkItem.GetStepsByProcessID(l_BusReceiveEdit.ProcessID, TableName.WorkItemsTableName.T_OA_HS_WorkItems + ((l_objProcessInstance.Status == ProcessConstString.ProcessStatus.STATUS_COMPLETED || l_objProcessInstance.Status == ProcessConstString.ProcessStatus.STATUS_CANCELED) ? "_BAK" : ""));

                    DataView l_dtvDataView = new DataView(l_dtbProcessSteps);
                    l_dtvDataView.RowFilter = "D_StepStatus = 'Completed'";

                    rptProcessDetail.DataSource = l_dtvDataView;
                    rptProcessDetail.DataBind();
                }
            }
        }
        private void Print_OnBeginExport(object sender, EventArgs e)
        {
            if (m_print == null || m_print.m_ls == null || m_print.m_ls.Count == 0) return;
            LR_Print print = new LR_Print();

            m_Entity = m_print.m_CurrEntity as B_LetterReceive;
            print.SetPrintBeginExport(m_print, m_Entity);
        }
Пример #4
0
 public void SetPrintAttachExport(UC_Print ucPrint, B_LetterReceive cEntity)
 {
     switch (ucPrint.FileName)
     {
         case "公文处理单":
             ucPrint.WriteContent("日期 ", WriteMode.Down, 1);
             ucPrint.WriteAttach();
             break;
     }
 }
Пример #5
0
 public void SetPrintAttachExport(UC_Print ucPrint, B_LetterReceive cEntity)
 {
     switch (ucPrint.FileName)
     {
     case "公文处理单":
         ucPrint.WriteContent("日期 ", WriteMode.Down, 1);
         ucPrint.WriteAttach();
         break;
     }
 }
Пример #6
0
        private void Print_OnBeginExport(object sender, EventArgs e)
        {
            if (m_print == null || m_print.m_ls == null || m_print.m_ls.Count == 0)
            {
                return;
            }
            LR_Print print = new LR_Print();

            m_Entity = m_print.m_CurrEntity as B_LetterReceive;
            print.SetPrintBeginExport(m_print, m_Entity);
        }
Пример #7
0
        public void SetPrintBeginExport(UC_Print ucPrint, B_LetterReceive cEntity)
        {
            switch (ucPrint.FileName)
            {
                case "函件收文表单":
                    ucPrint.ExportData.Add(cEntity.DocumentNo);    //<col>收文号:|right</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ReceiptDate.ToShortDateString()));        //<col>收文日期:|right</col>
                    ucPrint.ExportData.Add(cEntity.UrgentDegree);        //<col>紧急程度:|right</col>
                    ucPrint.ExportData.Add(cEntity.FileEncoding);        //<col>文件编号:|right</col>
                    ucPrint.ExportData.Add(cEntity.CommunicationUnit);        //<col>来文单位:|right</col>
                    ucPrint.ExportData.Add(cEntity.Pages);        //<col>页数:|right</col>
                    ucPrint.ExportData.Add(cEntity.DocumentTitle);        //<col>文件标题:|right</col>
                    ucPrint.ExportData.Add(cEntity.LeaderShipName);        //<col>批示领导:|right</col>
                    ucPrint.ExportData.Add(cEntity.ChuanYueLeader);        //<col>传阅领导:|right</col>
                    ucPrint.ExportData.Add(cEntity.UnderTake);        //<col>主办部门:|right</col>
                    ucPrint.ExportData.Add(cEntity.AssistDeptName);        //<col>协办部门:|right</col>
                    ucPrint.ExportData.Add(cEntity.ChuanYueDept);        //<col>传阅部门:|right</col>
                    ucPrint.ExportData.Add(cEntity.NiBanComment);        //<col>其它意见:|right</col>
                    string sDraftDate = string.IsNullOrEmpty(cEntity.NiBanDate)?"":"[" + cEntity.NiBanDate.Split(' ')[0] + "]";
                    ucPrint.ExportData.Add(cEntity.NiBanRenName + "\n" + sDraftDate);        //<col>拟办人:|right</col>
                    //ucPrint.ExportData.Add(cEntity.SecondPloterName);        //<col>二次拟办人:|right</col>
                    ucPrint.ExportData.Add(cEntity.LS_Comment);        //<col>领导意见:|right</col>
                    string sLeaderDate = string.IsNullOrEmpty(cEntity.LS_Date) ? "" : "[" + cEntity.LS_Date.Split(' ')[0] + "]";
                    ucPrint.ExportData.Add(cEntity.LeaderShipName + "\n" + sLeaderDate);        //<col>领导:|right</col>
                    ucPrint.ExportData.Add(cEntity.UnderTake);        //<col>承办部门:|right</col>
                    ucPrint.ExportData.Add(cEntity.UnderTake_Comment);        //<col>承办意见:|right</col>
                    /*待定*/
                    ucPrint.ExportData.Add(cEntity.UDDeptLeadName /*+ "\n" + "[" + cEntity.UDDeptLeadNameTime + "]"/*GetDeptLeaderName(cEntity.UnderTakeList)*/);        //<col>部门领导:|right</col>
                    /*待定*/
                    ucPrint.ExportData.Add(cEntity.UDSectionLeadName /*+ "\n" + "[" + cEntity.UDSectionLeadNameTime + "]"/*GetKeShiLeaderName(cEntity.UnderTakeList)*/);        //<col>科室领导:|right</col>
                    /*待定*/
                    ucPrint.ExportData.Add(cEntity.UDSectionPeopleName /*+ "\n" + "[" + cEntity.UDSectionPeopleNameTime + "]"/*GetPuTongName(cEntity.UnderTakeList)*/);        //<col>普通人员:|right</col>
                    /*待定*/
                    string[] stringSeparators = new string[] { "\n" };
                    //string[] sPrompt = cEntity.Prompt.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries);//<col>备注|right</col>
                    //if (sPrompt.Length > 0)
                    //{
                    //    ucPrint.ExportData.Add(sPrompt[0]);
                    //}
                    //else
                    //{
                    //    ucPrint.ExportData.Add(cEntity.Prompt);
                    //}
                    ucPrint.ExportData.Add(cEntity.Remarks);    //<col>备注|right</col>
                    /*待定*/
                    //ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList));        //<col>附件列表|shift</col>

                    ucPrint.Position = "备注";
                    ucPrint.Mode = WriteMode.Down_Append;
                    break;
            }
        }
Пример #8
0
        public void SetPrintBeginExport(UC_Print ucPrint, B_LetterReceive cEntity)
        {
            switch (ucPrint.FileName)
            {
            case "函件收文表单":
                ucPrint.ExportData.Add(cEntity.DocumentNo);                                                                                                          //<col>收文号:|right</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ReceiptDate.ToShortDateString()));                                                              //<col>收文日期:|right</col>
                ucPrint.ExportData.Add(cEntity.UrgentDegree);                                                                                                        //<col>紧急程度:|right</col>
                ucPrint.ExportData.Add(cEntity.FileEncoding);                                                                                                        //<col>文件编号:|right</col>
                ucPrint.ExportData.Add(cEntity.CommunicationUnit);                                                                                                   //<col>来文单位:|right</col>
                ucPrint.ExportData.Add(cEntity.Pages);                                                                                                               //<col>页数:|right</col>
                ucPrint.ExportData.Add(cEntity.DocumentTitle);                                                                                                       //<col>文件标题:|right</col>
                ucPrint.ExportData.Add(cEntity.LeaderShipName);                                                                                                      //<col>批示领导:|right</col>
                ucPrint.ExportData.Add(cEntity.ChuanYueLeader);                                                                                                      //<col>传阅领导:|right</col>
                ucPrint.ExportData.Add(cEntity.UnderTake);                                                                                                           //<col>主办部门:|right</col>
                ucPrint.ExportData.Add(cEntity.AssistDeptName);                                                                                                      //<col>协办部门:|right</col>
                ucPrint.ExportData.Add(cEntity.ChuanYueDept);                                                                                                        //<col>传阅部门:|right</col>
                ucPrint.ExportData.Add(cEntity.NiBanComment);                                                                                                        //<col>其它意见:|right</col>
                string sDraftDate = string.IsNullOrEmpty(cEntity.NiBanDate)?"":"[" + cEntity.NiBanDate.Split(' ')[0] + "]";
                ucPrint.ExportData.Add(cEntity.NiBanRenName + "\n" + sDraftDate);                                                                                    //<col>拟办人:|right</col>
                //ucPrint.ExportData.Add(cEntity.SecondPloterName);        //<col>二次拟办人:|right</col>
                ucPrint.ExportData.Add(cEntity.LS_Comment);                                                                                                          //<col>领导意见:|right</col>
                string sLeaderDate = string.IsNullOrEmpty(cEntity.LS_Date) ? "" : "[" + cEntity.LS_Date.Split(' ')[0] + "]";
                ucPrint.ExportData.Add(cEntity.LeaderShipName + "\n" + sLeaderDate);                                                                                 //<col>领导:|right</col>
                ucPrint.ExportData.Add(cEntity.UnderTake);                                                                                                           //<col>承办部门:|right</col>
                ucPrint.ExportData.Add(cEntity.UnderTake_Comment);                                                                                                   //<col>承办意见:|right</col>
                /*待定*/
                ucPrint.ExportData.Add(cEntity.UDDeptLeadName /*+ "\n" + "[" + cEntity.UDDeptLeadNameTime + "]"/*GetDeptLeaderName(cEntity.UnderTakeList)*/);        //<col>部门领导:|right</col>
                /*待定*/
                ucPrint.ExportData.Add(cEntity.UDSectionLeadName /*+ "\n" + "[" + cEntity.UDSectionLeadNameTime + "]"/*GetKeShiLeaderName(cEntity.UnderTakeList)*/); //<col>科室领导:|right</col>
                /*待定*/
                ucPrint.ExportData.Add(cEntity.UDSectionPeopleName /*+ "\n" + "[" + cEntity.UDSectionPeopleNameTime + "]"/*GetPuTongName(cEntity.UnderTakeList)*/);  //<col>普通人员:|right</col>
                /*待定*/
                string[] stringSeparators = new string[] { "\n" };
                //string[] sPrompt = cEntity.Prompt.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries);//<col>备注|right</col>
                //if (sPrompt.Length > 0)
                //{
                //    ucPrint.ExportData.Add(sPrompt[0]);
                //}
                //else
                //{
                //    ucPrint.ExportData.Add(cEntity.Prompt);
                //}
                ucPrint.ExportData.Add(cEntity.Remarks);        //<col>备注|right</col>
                /*待定*/
                //ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList));        //<col>附件列表|shift</col>

                ucPrint.Position = "备注";
                ucPrint.Mode     = WriteMode.Down_Append;
                break;
            }
        }
Пример #9
0
        private void ucPrint_OnBeginExport(object sender, EventArgs e)
        {
            LR_Print print = new LR_Print();
            //B_LetterReceive cEntity = new B_LetterReceive();
            //this.PopulateEntity(cEntity, base.ViewIDorName, base.WorkItemID);
            B_LetterReceive cEntity = null;//this.ControlToEntity(false) as B_LetterReceive;

            if (base.IsPreview)
            {
                cEntity = base.EntityData != null ? base.EntityData as B_LetterReceive : new B_LetterReceive();
            }
            else
            {
                cEntity = this.ControlToEntity(false) as B_LetterReceive;
            }
            //SetEntity(cEntity);
            print.SetPrintBeginExport(ucPrint, cEntity);
        }
 /// <summary>
 /// 获取流程参与的人。
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public string GetCYPeople(B_LetterReceive entity)
 {
     string strUser = "";
     if (!string.IsNullOrEmpty(entity.DrafterID))
     {
         strUser += entity.DrafterID + ";";
     }
     if (!string.IsNullOrEmpty(entity.NiBanRen))
     {
         strUser += entity.NiBanRen + ";";
     }
     if (!string.IsNullOrEmpty(entity.ChuanYueLeaderID))
     {
         strUser += entity.ChuanYueLeaderID + ";";
     }
     if (!string.IsNullOrEmpty(entity.LeaderShip))
     {
         strUser += entity.ChuanYueLeaderID + ";";
     }
     if (!string.IsNullOrEmpty(entity.UnderTakeLeaders))
     {
         strUser += entity.UnderTakeLeaders + ";";
     }
     if (!string.IsNullOrEmpty(entity.AssistMenber))
     {
         strUser += entity.AssistMenber + ";";
     }
     if (!string.IsNullOrEmpty(entity.UDSectionPeopleID))
     {
         strUser += entity.UDSectionPeopleID + ";";
     }
     if (!string.IsNullOrEmpty(entity.UDSectionLeadID))
     {
         strUser += entity.UDSectionLeadID + ";";
     }
     if (!string.IsNullOrEmpty(this.txtCirculatePersonID.Text))
     {
         strUser += this.txtCirculatePersonID.Text;
     }
     return strUser;
 }
Пример #11
0
        /// <summary>
        /// 复制函件收文
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="p_strStepName"></param>
        /// <param name="receiveUserID"></param>
        /// <param name="p_strProcessID"></param>
        /// <param name="p_strWorkItemID"></param>
        /// <returns></returns>
        private bool CopyLRInfo(String ID, String p_strStepName, String p_strUserID, String p_strProcessID, String p_strWorkItemID, String p_strPoolID)
        {
            try
            {
                B_LetterReceive selectEntity = new B_LetterReceive();
                selectEntity.ID = int.Parse(ID);

                B_LetterReceive newEntity = new B_LetterReceive();
                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)
            {
                return(false);
            }
        }
Пример #12
0
        private string Devolve2DC2(HN_OA2DC oaDev)
        {
            string sXml = "";

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

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

            //if (String.IsNullOrEmpty(this.id)) return "";

            B_HSEdit l_BusReceiveEdit = new B_HSEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text));
            //l_BusReceiveEdit.Load(Convert.ToInt32(REGISTER_ID));
            B_LetterReceive pEntity = ControlToEntity(false) as B_LetterReceive;

            #region 开始生成Archive节点
            ar.System = "OA_" + base.IdentityID.ToString();
            string ObjPlatForm = oaDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/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;
                string value = oaDev.PreHandel(l_BusReceiveEdit, sName, sType);
                if (string.IsNullOrEmpty(value))
                {
                    value = oaDev.PreHandel(pEntity, sName, sType);
                }
                ar.SetAttribute(skey, value /*(entity.GetVal(sName) as string)*/);
            }
            ar.SetOAArchiveNode();
            // 其他节点处理应放置在SetOAArchiveNode方法之后

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

            ar.ElectronicDocumentCount = pEntity.FileList.Count.ToString();
            //l_BusReceiveEdit.FileList.Count.ToString();
            #endregion
            sXml = oaDev.GenOAArchiveNode(ar, base.TemplateName);

            /****开始生成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 < pEntity.FileList.Count; i++)
            {
                HNDC_CAttachmentNode at = new HNDC_CAttachmentNode();
                CFuJian file            = pEntity.FileList[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 = oaDev.GenOAAttachmentNode(fl.FK_ArchiveID, at);
            }
            #endregion
            /****完成生成Attachment节点******************************************************************/

            return(sXml);
        }
Пример #13
0
        public void Devolve(out string sResult)
        {
            sResult = "";
            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='" + base.TemplateName + "']/Object");
            string s          = "";

            //B_LetterReceive l_busWorkItems = new B_LetterReceive();
            //PopulateEntity(l_busWorkItems, base.ViewIDorName, base.WorkItemID);
            B_LetterReceive l_busWorkItems = this.ControlToEntity(false) as B_LetterReceive;

            l_busWorkItems.FormsData = XmlUtility.SerializeXml(l_busWorkItems);
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(dcDev);

                s        = oa2dc.SendDevolve(xml, l_busWorkItems.FormsData, "函件收文");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }


            if (objDevolve.ToUpper() == "DP")
            {
                FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
                xml = Devolve2DP(dpDev);

                s        = oa2dp.SendDevolve(xml, l_busWorkItems.FormsData, "函件收文");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        protected void btnSecFF_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtProcessID.Text == string.Empty)
                {
                    JScript.Alert("只有已经启动的流程才能二次分发!");
                    return;
                }
                List<EntityBase> bworkitems = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true);
                B_LetterReceive NewEntity = new B_LetterReceive();
                B_LetterReceive bworkitem = bworkitems != null && bworkitems.Count > 0 ? bworkitems[0] as B_LetterReceive : new B_LetterReceive();

                NewEntity.ProcessID = this.txtProcessID.Text;

                NewEntity.WorkItemID = Guid.NewGuid().ToString("N");
                bworkitem.WorkItemID = NewEntity.WorkItemID;

                bworkitem.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2;
                NewEntity.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2;

                bworkitem.SubmitDate = System.DateTime.Now;
                NewEntity.SubmitDate = System.DateTime.Now;

                bworkitem.CommentList.Clear();

                bworkitem.UrgentDegree = this.ddlUrgentDegree.SelectedValue;
                NewEntity.UrgentDegree = this.ddlUrgentDegree.SelectedValue;

                bworkitem.DocumentNo = this.txtDocumentNo.Text;
                NewEntity.DocumentNo = this.txtDocumentNo.Text;

                bworkitem.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;
                NewEntity.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;

                bworkitem.FileEncoding = this.txtDocumentEncoding.Text;
                NewEntity.FileEncoding = this.txtDocumentEncoding.Text;

                bworkitem.CommunicationUnit = this.txtReceiveUnit.Text;
                NewEntity.CommunicationUnit = this.txtReceiveUnit.Text;

                bworkitem.DocumentTitle = this.txtDocumentTitle.Text;
                NewEntity.DocumentTitle = this.txtDocumentTitle.Text;

                bworkitem.Remarks = this.txtRemark.Text;
                NewEntity.Remarks = this.txtRemark.Text;

                bworkitem.FileList = this.ucAttachment.UCDataList;
                NewEntity.FileList = this.ucAttachment.UCDataList;

                bworkitem.ReceiveDateTime = DateTime.Now;
                NewEntity.ReceiveDateTime = DateTime.Now;

                bworkitem.ReceiveUserID = CurrentUserInfo.UserName;
                NewEntity.ReceiveUserID = CurrentUserInfo.UserName;

                bworkitem.ReceiveUserName = CurrentUserInfo.DisplayName;
                NewEntity.ReceiveUserName = CurrentUserInfo.DisplayName;
                NewEntity.D_StepStatus = bworkitem.D_StepStatus;
                NewEntity.ReceiptDate = bworkitem.ReceiptDate;
                NewEntity.Pages = bworkitem.Pages;
                NewEntity.ChuanYueLeader = bworkitem.ChuanYueLeader;
                NewEntity.AssistDept = bworkitem.AssistDept;
                NewEntity.AssistDeptName = bworkitem.AssistDeptName;
                NewEntity.ChuanYueLeader = bworkitem.ChuanYueLeader;
                NewEntity.ChuanYueDept = bworkitem.ChuanYueDept;
                NewEntity.LeaderShip = bworkitem.LeaderShip;
                NewEntity.LeaderShipName = bworkitem.LeaderShipName;
                NewEntity.LS_Comment = bworkitem.LS_Comment;
                NewEntity.UnderTakeID = bworkitem.UnderTakeID;
                NewEntity.UnderTake = bworkitem.UnderTake;
                NewEntity.UnderTake_Comment = bworkitem.UnderTake_Comment;
                NewEntity.UnderTakeLeaders = bworkitem.UnderTakeLeaders;
                NewEntity.NiBanRen = bworkitem.NiBanRen;
                NewEntity.NiBanRenName = bworkitem.NiBanRenName;
                NewEntity.NiBanComment = bworkitem.NiBanComment;
                NewEntity.Drafter = bworkitem.Drafter;
                NewEntity.DraftDate = bworkitem.DraftDate;
                NewEntity.RegisterID = bworkitem.RegisterID;
                NewEntity.Prompt = bworkitem.Prompt;
                NewEntity.ChuanYueDeptID = bworkitem.ChuanYueDeptID;
                NewEntity.HJPrompt = bworkitem.HJPrompt;
                NewEntity.ChuanYueLeaderID = bworkitem.ChuanYueLeaderID;
                NewEntity.AgentUserName = bworkitem.AgentUserName;
                NewEntity.AgentUserID = bworkitem.AgentUserID;

                NewEntity.FormsData = XmlUtility.SerializeXml(bworkitem as EntityBase);
                FormSave.SaveEntity(NewEntity, false);

                if (B_ProcessInstance.IsCompletedOrCancel(NewEntity.ProcessID))
                {
                    B_ProcessInstance.MoveToBakTable(NewEntity.WorkItemID, "T_OA_HS_WorkItems", "T_OA_HS_WorkItems_BAK");//在备份库中插入数据
                    B_ProcessInstance.UpdateRecordStatus(NewEntity.WorkItemID,2);//将现行库数据更新为不可用。
                }

                btnModify_Click(null, null);

                //string filedata = "<FileList />";
                //if (this.ucAttachment.UCDataList.Count > 0)
                //{
                //    string formdata = XmlUtility.SerializeXml<B_LetterReceive>(bworkitem);
                //    int iStartIndex = formdata.IndexOf("<FileList>");
                //    int iEndIndex = formdata.IndexOf("</FileList>");
                //    if (iEndIndex > iStartIndex)
                //    {
                //        filedata = formdata.Substring(iStartIndex, iEndIndex - iStartIndex);
                //        filedata += "</FileList>";
                //    }
                //}
                //FormsMethod.UpdateAssignFileData(bworkitem.ProcessID,ProcessConstString.TemplateName.LETTER_RECEIVE, "", filedata);
                List<EntityBase> bworkitemsAssign = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true, "'New','Assigned'");
                string strUpdatePeople = string.Empty;
                foreach (EntityBase entity in bworkitemsAssign)
                {
                    B_LetterReceive lentity = entity as B_LetterReceive;

                    lentity.SubmitDate = System.DateTime.Now;

                    lentity.UrgentDegree = this.ddlUrgentDegree.SelectedValue;

                    lentity.DocumentNo = this.txtDocumentNo.Text;

                    lentity.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;
                    lentity.FileEncoding = this.txtDocumentEncoding.Text;

                    lentity.CommunicationUnit = this.txtReceiveUnit.Text;

                    lentity.DocumentTitle = this.txtDocumentTitle.Text;

                    lentity.Remarks = this.txtRemark.Text;

                    lentity.FileList = this.ucAttachment.UCDataList;
                    FormSave.SaveEntity(lentity as EntityBase, true);
                    strUpdatePeople += lentity.ReceiveUserName + ",";
                }
                B_ToCirculate l_busCirculate = new B_ToCirculate();
                l_busCirculate.IsAgain = true;
                l_busCirculate.ToProcessType = ProcessConstString.TemplateName.LETTER_RECEIVE;
                l_busCirculate.ToProcessID = bworkitem.ProcessID;
                l_busCirculate.ToWorkItemID = bworkitem.WorkItemID;
                l_busCirculate.ToUserIDS = B_FormsData.GetProcessPeople("'Completed','Removed'", this.txtProcessID.Text, ";", true);
                string strInfo = string.Empty;
                if (l_busCirculate.ToUserIDS != string.Empty)
                {
                    strInfo = l_busCirculate.ChuanYueToDB();
                }
                strUpdatePeople=strUpdatePeople.Length>0?strUpdatePeople.Substring(0,strUpdatePeople.Length-1):"";
                strInfo = strInfo.Replace("传阅成功", "二次分发成功");
                strInfo += string.IsNullOrEmpty(strInfo) ? "" : "\\n";
                strInfo +=string.IsNullOrEmpty(strUpdatePeople) ? "" : ("("+strUpdatePeople + ")更新成功!");
                if (strInfo != string.Empty)
                {
                    JScript.Alert(strInfo);
                }
                else
                {
                    JScript.Alert("二次分发成功!无人员传阅和数据更新!");
                }
            }
            catch
            {
                JScript.Alert("二次分发失败!");
            }
        }
        /// <summary>
        /// 复制函件收文
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="p_strStepName"></param>
        /// <param name="receiveUserID"></param>
        /// <param name="p_strProcessID"></param>
        /// <param name="p_strWorkItemID"></param>
        /// <returns></returns>
        private bool CopyLRInfo(String ID, String p_strStepName, String p_strUserID, String p_strProcessID, String p_strWorkItemID, String p_strPoolID)
        {
            try
            {
                B_LetterReceive selectEntity = new B_LetterReceive();
                selectEntity.ID = int.Parse(ID);

                B_LetterReceive newEntity = new B_LetterReceive();
                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)
            {
                return false;
            }
        }
        protected void btnSecFF_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtProcessID.Text == string.Empty)
                {
                    JScript.Alert("只有已经启动的流程才能二次分发!");
                    return;
                }
                List <EntityBase> bworkitems = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true);
                B_LetterReceive   NewEntity  = new B_LetterReceive();
                B_LetterReceive   bworkitem  = bworkitems != null && bworkitems.Count > 0 ? bworkitems[0] as B_LetterReceive : new B_LetterReceive();

                NewEntity.ProcessID = this.txtProcessID.Text;

                NewEntity.WorkItemID = Guid.NewGuid().ToString("N");
                bworkitem.WorkItemID = NewEntity.WorkItemID;

                bworkitem.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2;
                NewEntity.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2;

                bworkitem.SubmitDate = System.DateTime.Now;
                NewEntity.SubmitDate = System.DateTime.Now;

                bworkitem.CommentList.Clear();

                bworkitem.UrgentDegree = this.ddlUrgentDegree.SelectedValue;
                NewEntity.UrgentDegree = this.ddlUrgentDegree.SelectedValue;

                bworkitem.DocumentNo = this.txtDocumentNo.Text;
                NewEntity.DocumentNo = this.txtDocumentNo.Text;

                bworkitem.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;
                NewEntity.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;

                bworkitem.FileEncoding = this.txtDocumentEncoding.Text;
                NewEntity.FileEncoding = this.txtDocumentEncoding.Text;

                bworkitem.CommunicationUnit = this.txtReceiveUnit.Text;
                NewEntity.CommunicationUnit = this.txtReceiveUnit.Text;

                bworkitem.DocumentTitle = this.txtDocumentTitle.Text;
                NewEntity.DocumentTitle = this.txtDocumentTitle.Text;

                bworkitem.Remarks = this.txtRemark.Text;
                NewEntity.Remarks = this.txtRemark.Text;

                bworkitem.FileList = this.ucAttachment.UCDataList;
                NewEntity.FileList = this.ucAttachment.UCDataList;

                bworkitem.ReceiveDateTime = DateTime.Now;
                NewEntity.ReceiveDateTime = DateTime.Now;

                bworkitem.ReceiveUserID = CurrentUserInfo.UserName;
                NewEntity.ReceiveUserID = CurrentUserInfo.UserName;

                bworkitem.ReceiveUserName   = CurrentUserInfo.DisplayName;
                NewEntity.ReceiveUserName   = CurrentUserInfo.DisplayName;
                NewEntity.D_StepStatus      = bworkitem.D_StepStatus;
                NewEntity.ReceiptDate       = bworkitem.ReceiptDate;
                NewEntity.Pages             = bworkitem.Pages;
                NewEntity.ChuanYueLeader    = bworkitem.ChuanYueLeader;
                NewEntity.AssistDept        = bworkitem.AssistDept;
                NewEntity.AssistDeptName    = bworkitem.AssistDeptName;
                NewEntity.ChuanYueLeader    = bworkitem.ChuanYueLeader;
                NewEntity.ChuanYueDept      = bworkitem.ChuanYueDept;
                NewEntity.LeaderShip        = bworkitem.LeaderShip;
                NewEntity.LeaderShipName    = bworkitem.LeaderShipName;
                NewEntity.LS_Comment        = bworkitem.LS_Comment;
                NewEntity.UnderTakeID       = bworkitem.UnderTakeID;
                NewEntity.UnderTake         = bworkitem.UnderTake;
                NewEntity.UnderTake_Comment = bworkitem.UnderTake_Comment;
                NewEntity.UnderTakeLeaders  = bworkitem.UnderTakeLeaders;
                NewEntity.NiBanRen          = bworkitem.NiBanRen;
                NewEntity.NiBanRenName      = bworkitem.NiBanRenName;
                NewEntity.NiBanComment      = bworkitem.NiBanComment;
                NewEntity.Drafter           = bworkitem.Drafter;
                NewEntity.DraftDate         = bworkitem.DraftDate;
                NewEntity.RegisterID        = bworkitem.RegisterID;
                NewEntity.Prompt            = bworkitem.Prompt;
                NewEntity.ChuanYueDeptID    = bworkitem.ChuanYueDeptID;
                NewEntity.HJPrompt          = bworkitem.HJPrompt;
                NewEntity.ChuanYueLeaderID  = bworkitem.ChuanYueLeaderID;
                NewEntity.AgentUserName     = bworkitem.AgentUserName;
                NewEntity.AgentUserID       = bworkitem.AgentUserID;

                NewEntity.FormsData = XmlUtility.SerializeXml(bworkitem as EntityBase);
                FormSave.SaveEntity(NewEntity, false);

                if (B_ProcessInstance.IsCompletedOrCancel(NewEntity.ProcessID))
                {
                    B_ProcessInstance.MoveToBakTable(NewEntity.WorkItemID, "T_OA_HS_WorkItems", "T_OA_HS_WorkItems_BAK"); //在备份库中插入数据
                    B_ProcessInstance.UpdateRecordStatus(NewEntity.WorkItemID, 2);                                        //将现行库数据更新为不可用。
                }

                btnModify_Click(null, null);

                //string filedata = "<FileList />";
                //if (this.ucAttachment.UCDataList.Count > 0)
                //{
                //    string formdata = XmlUtility.SerializeXml<B_LetterReceive>(bworkitem);
                //    int iStartIndex = formdata.IndexOf("<FileList>");
                //    int iEndIndex = formdata.IndexOf("</FileList>");
                //    if (iEndIndex > iStartIndex)
                //    {
                //        filedata = formdata.Substring(iStartIndex, iEndIndex - iStartIndex);
                //        filedata += "</FileList>";
                //    }
                //}
                //FormsMethod.UpdateAssignFileData(bworkitem.ProcessID,ProcessConstString.TemplateName.LETTER_RECEIVE, "", filedata);
                List <EntityBase> bworkitemsAssign = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true, "'New','Assigned'");
                string            strUpdatePeople  = string.Empty;
                foreach (EntityBase entity in bworkitemsAssign)
                {
                    B_LetterReceive lentity = entity as B_LetterReceive;

                    lentity.SubmitDate = System.DateTime.Now;

                    lentity.UrgentDegree = this.ddlUrgentDegree.SelectedValue;

                    lentity.DocumentNo = this.txtDocumentNo.Text;

                    lentity.ReceiptDate  = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;
                    lentity.FileEncoding = this.txtDocumentEncoding.Text;

                    lentity.CommunicationUnit = this.txtReceiveUnit.Text;

                    lentity.DocumentTitle = this.txtDocumentTitle.Text;

                    lentity.Remarks = this.txtRemark.Text;

                    lentity.FileList = this.ucAttachment.UCDataList;
                    FormSave.SaveEntity(lentity as EntityBase, true);
                    strUpdatePeople += lentity.ReceiveUserName + ",";
                }
                B_ToCirculate l_busCirculate = new B_ToCirculate();
                l_busCirculate.IsAgain       = true;
                l_busCirculate.ToProcessType = ProcessConstString.TemplateName.LETTER_RECEIVE;
                l_busCirculate.ToProcessID   = bworkitem.ProcessID;
                l_busCirculate.ToWorkItemID  = bworkitem.WorkItemID;
                l_busCirculate.ToUserIDS     = B_FormsData.GetProcessPeople("'Completed','Removed'", this.txtProcessID.Text, ";", true);
                string strInfo = string.Empty;
                if (l_busCirculate.ToUserIDS != string.Empty)
                {
                    strInfo = l_busCirculate.ChuanYueToDB();
                }
                strUpdatePeople = strUpdatePeople.Length > 0?strUpdatePeople.Substring(0, strUpdatePeople.Length - 1):"";
                strInfo         = strInfo.Replace("传阅成功", "二次分发成功");
                strInfo        += string.IsNullOrEmpty(strInfo) ? "" : "\\n";
                strInfo        += string.IsNullOrEmpty(strUpdatePeople) ? "" : ("(" + strUpdatePeople + ")更新成功!");
                if (strInfo != string.Empty)
                {
                    JScript.Alert(strInfo);
                }
                else
                {
                    JScript.Alert("二次分发成功!无人员传阅和数据更新!");
                }
            }
            catch
            {
                JScript.Alert("二次分发失败!");
            }
        }