Exemplo n.º 1
0
        private void SetBaseExportData(UC_Print ucPrint, B_WorkRelation cEntity, string sParam)
        {
            ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString())); //<col>拟稿日期:|right</col>
            ucPrint.ExportData.Add(cEntity.MainSend);                                             //<col>主送:|right</col>
            ucPrint.ExportData.Add(cEntity.DocumentNo);                                           //<col>编号:|right</col>
            ucPrint.ExportData.Add(cEntity.Department);                                           //<col>编制部门:|right</col>
            ucPrint.ExportData.Add(cEntity.CopySend);                                             //<col>抄送:|right</col>
            ucPrint.ExportData.Add(cEntity.DocumentTitle);                                        //<col>主题:|right</col>
            //ucPrint.ExportData.Add(SysString.HtmlToTextCode(cEntity.Content));         //<col>内容:|right</col>
            ucPrint.ExportData.Add(cEntity.Content);                                              //<col>内容:|right</col>

            ucPrint.ExportData.Add(cEntity.UndertakeCircs);                                       //<col>答复或处理意见:|right</col>
            ucPrint.ExportData.Add(cEntity.BanLiYiJian);                                          //<col>办理意见:|right</col>
            ucPrint.ExportData.Add(cEntity.DeptLeader);                                           //<col>承办部门领导:|right</col>
            ucPrint.ExportData.Add(cEntity.SectionLeader);                                        //<col>科室领导:|right</col>
            ucPrint.ExportData.Add(cEntity.Contractor);                                           //<col>承办人:|right</col>

            //ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ChengBanRiQi.ToShortDateString()));    //<col>承办日期:|right</col>
            string strChengBanRiQi = cEntity.StepName == ProcessConstString.StepName.WorkRelationStepName.STEP_DIRECTOR?cEntity.DirectorDate.ToString():cEntity.StepName == ProcessConstString.StepName.WorkRelationStepName.STEP_CHIEF?cEntity.SectionDate.ToString():cEntity.StepName == ProcessConstString.StepName.WorkRelationStepName.STEP_MEMBER?cEntity.MemberDate.ToString():"";

            ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ChengBanRiQi.ToString() == System.DateTime.MinValue.ToString() ? strChengBanRiQi : cEntity.ChengBanRiQi.ToString()));    //<col>承办日期:|right</col>    renjinquan+ 根据步骤取承办日期。

            //ucPrint.ExportData.Add(cEntity.Message);       //<col>提示信息:|right</col>
            //if (sParam != "工作联系单7")
            //    ucPrint.ExportData.Add(cEntity.MessageAdd);//<col>添加:|right</col>
            ucPrint.ExportData.Add(cEntity.DeptPrincipal);                                          //<col>签发人:|right</col>
            ucPrint.ExportData.Add(cEntity.CheckDrafter);                                           //<col>核稿人:|right</col>
            ucPrint.ExportData.Add(cEntity.Drafter);                                                //<col>拟稿人:|right</col>
            ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ConfirmDate.ToShortDateString())); //<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_WorkRelation;
     //B_WorkRelation cEntity = new B_WorkRelation();
     //B_WorkRelation cEntity = ControlToEntity(false) as B_WorkRelation;//GetFormData(cEntity, Submit.保存);
     print.SetPrintBeginExport(m_print, m_Entity);
 }
        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_WorkRelation;
            //B_WorkRelation cEntity = new B_WorkRelation();
            //B_WorkRelation cEntity = ControlToEntity(false) as B_WorkRelation;//GetFormData(cEntity, Submit.保存);
            print.SetPrintBeginExport(m_print, m_Entity);
        }
Exemplo n.º 4
0
 public void SetPrintAttachExport(UC_Print ucPrint, B_WorkRelation cEntity)
 {
     switch (ucPrint.FileName)
     {
         case "工作联系单":
             ucPrint.WriteContent("承办意见:", WriteMode.Up, 1);
             ucPrint.WriteAttach();
             break;
         case "工作联系单表单":
             //ucPrint.WriteContent("内容:", WriteMode.Down, 1);
             //ucPrint.WriteAttach();
             break;
     }
 }
Exemplo n.º 5
0
        public void SetPrintAttachExport(UC_Print ucPrint, B_WorkRelation cEntity)
        {
            switch (ucPrint.FileName)
            {
            case "工作联系单":
                ucPrint.WriteContent("承办意见:", WriteMode.Up, 1);
                ucPrint.WriteAttach();
                break;

            case "工作联系单表单":
                //ucPrint.WriteContent("内容:", WriteMode.Down, 1);
                //ucPrint.WriteAttach();
                break;
            }
        }
        private void ucPrint_OnBeginExport(object sender, EventArgs e)
        {
            Print print = new Print();
            //B_WorkRelation cEntity = new B_WorkRelation();
            B_WorkRelation cEntity = null;

            if (base.IsPreview)
            {
                cEntity = base.EntityData != null ? base.EntityData as B_WorkRelation : new B_WorkRelation();
            }
            else
            {
                cEntity = ControlToEntity(false) as B_WorkRelation; //GetFormData(cEntity, Submit.保存);
            }
            print.SetPrintBeginExport(ucPrint, cEntity);
        }
Exemplo n.º 7
0
        public void SetPrintBeginExport(UC_Print ucPrint, B_WorkRelation cEntity)
        {
            switch (ucPrint.FileName)
            {
            case "工作联系单":
                ucPrint.ExportData.Add(cEntity.MainSend);                                               //<col>主送:|inner</col>
                ucPrint.ExportData.Add(cEntity.Number);                                                 //<col>编码:|inner</col>
                ucPrint.ExportData.Add(cEntity.CopySend);                                               //<col>抄送:|inner</col>
                ucPrint.ExportData.Add(cEntity.Department);                                             //<col>编制处室:|inner</col>
                ucPrint.ExportData.Add(cEntity.Drafter);                                                //<col>编写:|inner<inner/col>
                ucPrint.ExportData.Add(cEntity.CheckDrafter);                                           //<col>校核:|inner</col>
                ucPrint.ExportData.Add(cEntity.DeptPrincipal);                                          //<col>审定:|inner</col>
                ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ConfirmDate.ToShortDateString())); //<col>日期:|inner</col>
                ucPrint.ExportData.Add(cEntity.DocumentTitle);                                          //<col>主题:|inner</col>
                //string tmp = SysString.HtmlToTextCode(cEntity.Content);
                string tmp = cEntity.Content;                                                           //renjinquan+
                if (!string.IsNullOrEmpty(tmp))
                {
                    ucPrint.ExportData.Add(tmp);
                }
                else
                {
                    ucPrint.ExportData.Add("");
                }
                //ucPrint.ExportData.Add(cEntity.Content);    //<col>正文|shift</col>
                ucPrint.ExportData.Add(cEntity.BanLiYiJian);        //<col>承办意见:|right</col>

                //string sUndertakeCircs = "";
                //if (!string.IsNullOrEmpty(cEntity.UndertakeCircs))
                //{
                //    sUndertakeCircs = cEntity.UndertakeCircs.Remove(0, 1);
                //}
                ucPrint.ExportData.Add(cEntity.UndertakeCircs);        //<col>承办结果:|right</col>

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

            case "工作联系单表单":
                SetBaseExportData(ucPrint, cEntity, "工作联系单表单");
                ucPrint.ExportData.Add(cEntity.ChuanYueRenYuan);        //<col>传阅人员:|right</col>

                //ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //<col>附件:|down</col>
                break;
            }
        }
Exemplo n.º 8
0
        public void SetPrintBeginExport(UC_Print ucPrint, B_WorkRelation cEntity)
        {
            switch (ucPrint.FileName)
            {
                case "工作联系单":
                    ucPrint.ExportData.Add(cEntity.MainSend);    //<col>主送:|inner</col>
                    ucPrint.ExportData.Add(cEntity.Number);    //<col>编码:|inner</col>
                    ucPrint.ExportData.Add(cEntity.CopySend);    //<col>抄送:|inner</col>
                    ucPrint.ExportData.Add(cEntity.Department);    //<col>编制处室:|inner</col>
                    ucPrint.ExportData.Add(cEntity.Drafter);    //<col>编写:|inner<inner/col>
                    ucPrint.ExportData.Add(cEntity.CheckDrafter);    //<col>校核:|inner</col>
                    ucPrint.ExportData.Add(cEntity.DeptPrincipal);    //<col>审定:|inner</col>
                    ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ConfirmDate.ToShortDateString()));    //<col>日期:|inner</col>
                    ucPrint.ExportData.Add(cEntity.DocumentTitle);    //<col>主题:|inner</col>
                    //string tmp = SysString.HtmlToTextCode(cEntity.Content);
                    string tmp = cEntity.Content;//renjinquan+
                    if (!string.IsNullOrEmpty(tmp))
                    {
                        ucPrint.ExportData.Add(tmp);
                    }
                    else
                    {
                        ucPrint.ExportData.Add("");
                    }
                    //ucPrint.ExportData.Add(cEntity.Content);    //<col>正文|shift</col>
                    ucPrint.ExportData.Add(cEntity.BanLiYiJian);    //<col>承办意见:|right</col>

                    //string sUndertakeCircs = "";
                    //if (!string.IsNullOrEmpty(cEntity.UndertakeCircs))
                    //{
                    //    sUndertakeCircs = cEntity.UndertakeCircs.Remove(0, 1);
                    //}
                    ucPrint.ExportData.Add(cEntity.UndertakeCircs);    //<col>承办结果:|right</col>

                    ucPrint.AttachFileList = cEntity.FileList;
                    //ucPrint.Position = "内容";//(string)ucPrint.ExportData[2];
                    //ucPrint.Mode = WriteMode.Down;
                    break;
                case "工作联系单表单":
                    SetBaseExportData(ucPrint, cEntity, "工作联系单表单");
                    ucPrint.ExportData.Add(cEntity.ChuanYueRenYuan);    //<col>传阅人员:|right</col>

                    //ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //<col>附件:|down</col>
                    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_WorkRelation bWorkRelation = new B_WorkRelation();

                rptComment.DataSource = bWorkRelation.GetSignComment(processID, workItemID, stepName, userID, deptID);
                rptComment.DataBind();
            }
        }
Exemplo n.º 10
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 CopyWRInfo(String ID, String p_strStepName, String p_strUserID, String p_strProcessID, String p_strWorkItemID, String p_strPoolID)
        {
            try
            {
                B_WorkRelation selectEntity = new B_WorkRelation();
                selectEntity.ID = int.Parse(ID);

                B_WorkRelation newEntity = new B_WorkRelation();
                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);
            }
        }
        void ucPrint_OnExtraExport(object sender, EventArgs e)
        {
            //B_WorkRelation cEntity = ControlToEntity(false) as B_WorkRelation;
            B_WorkRelation cEntity = null;

            if (base.IsPreview)
            {
                cEntity = base.EntityData != null ? base.EntityData as B_WorkRelation : new B_WorkRelation();
            }
            else
            {
                cEntity = ControlToEntity(false) as B_WorkRelation;//GetFormData(cEntity, Submit.保存);
            }
            switch (ucPrint.FileName)
            {
            case "工作联系单表单":
                ucPrint.BatchAddPicture("工作联系单", "工作联系单表单", cEntity);
                break;

            case "工作联系单":
                ucPrint.BatchAddPicture("工作联系单", "工作联系单", cEntity);
                break;
            }
        }
Exemplo n.º 12
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;
            }
        }
Exemplo n.º 13
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 string Devolve2DC(HN_OA2DC oaDev)
        {
            string sXml = "";

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

            B_WorkRelation entity = ControlToEntity(false) as B_WorkRelation;

            entity.FormsData = XmlUtility.SerializeXml(entity);

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

            //string sPath = @"E:\QWDMS\Non Baseline Library\Development\03 Code\FounderSoftware.ADIM\FounderSoftware.ADIM.OA\OADevolveLib\DevolveConfig.xml";

            #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;
                ar.SetAttribute(skey, oaDev.PreHandel(entity, sName, sType) /*(entity.GetVal(sName) as string)*/);
            }
            ar.SetOAArchiveNode();
            // 其他节点处理应放置在SetOAArchiveNode方法之后

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


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

            return(sXml);
        }
        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          = "";

            //EntityLetterSend entity = new EntityLetterSend(base.tableName);
            //SetEntity(entity, true);
            B_WorkRelation entity = ControlToEntity(false) as B_WorkRelation;

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

                s        = oa2dc.SendDevolve(xml, entity.FormsData, "工作联系单");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
                //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
            }


            if (objDevolve.ToUpper() == "DP")
            {
                FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
                string sOADPIDs = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/DPID");

                string[] arrDPID = sOADPIDs.Split(new char[] { ',', ';' });
                for (int i = 0; i < arrDPID.Length; i++)
                {
                    try
                    {
                        Convert.ToInt32(arrDPID[i]);
                    }
                    catch
                    {
                        continue;
                    }
                    xml      = Devovle2DP2(dpDev, arrDPID[i]);
                    s        = oa2dp.SendDevolve(xml, entity.FormsData, "工作联系单");
                    sResult += (s + @"\r\n");
                    try
                    {
                        Convert.ToInt32(s);
                    }
                    catch
                    {
                        throw new Exception(s);
                    }
                    //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                }

                string   sOptionDPID = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/OptionDPID");
                string[] arrOpDPID   = sOptionDPID.Split(new char[] { ',' });
                for (int i = 0; i < arrOpDPID.Length; i++)
                {
                    if (entity.GetVal(arrOpDPID[i]) == null)
                    {
                        continue;
                    }
                    string   sDPID = entity.GetVal(arrOpDPID[i]).ToString();
                    string[] IDs   = sDPID.Split(new char[] { ';', ',' });
                    for (int j = 0; j < IDs.Length; j++)
                    {
                        try
                        {
                            Convert.ToInt32(IDs[j]);
                        }
                        catch
                        {
                            continue;
                        }
                        xml      = Devovle2DP2(dpDev, IDs[j]);
                        s        = oa2dp.SendDevolve(xml, entity.FormsData, "工作联系单");
                        sResult += (s + @"\r\n");
                        try
                        {
                            Convert.ToInt32(s);
                        }
                        catch
                        {
                            throw new Exception(s);
                        }
                    }
                    //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                }
                // 若DevolveConifg.xml配置文件中未配置CategID则根据流程实体中的处室ID归档



                #region 注释保留
                //if (string.IsNullOrEmpty(sOADPIDs))
                //{
                //    string[] sDPID1 = entity.MainSendDeptID.Split(new char[] { ',', ';' });
                //    string[] sDPID2 = entity.BianZhiBuMenID.Split(new char[] { ',', ';' });

                //    if (sDPID1 != null)
                //    {
                //        for (int i = 0; i < sDPID1.Length; i++)
                //        {
                //            if (string.IsNullOrEmpty(sDPID1[i])) continue;
                //            xml = Devolve2DP(dpDev, sDPID1[i]);
                //            s = oa2dp.SendDevolve(xml, entity.FormsData, "工作联系单");
                //            //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //        }
                //    }
                //    if (sDPID2 != null)
                //    {
                //        for (int i = 0; i < sDPID2.Length; i++)
                //        {
                //            if (string.IsNullOrEmpty(sDPID2[i])) continue;
                //            xml = Devolve2DP(dpDev, sDPID2[i]);
                //            s = oa2dp.SendDevolve(xml, entity.FormsData, "工作联系单");
                //            //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //        }
                //    }
                //}
                //else
                //// 根据配置文件的处室ID归档
                //{
                //    string[] arrDPID = sOADPIDs.Split(new char[] { ',' });
                //    for (int i = 0; i < arrDPID.Length; i++)
                //    {
                //        xml = Devolve2DP(dpDev, arrDPID[i]);
                //        s = oa2dp.SendDevolve(xml, entity.FormsData, "工作联系单");
                //        //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //    }
                //}
                #endregion
            }
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);
            //string rest = CDevolve.CallBack(Convert.ToInt32(s), true, s, doc.InnerXml);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        private string Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID)
        {
            string         sXml   = "";
            B_WorkRelation entity = ControlToEntity(false) as B_WorkRelation;

            #region ArchiveNode
            FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode();
            ar.System  = "OA_" + base.IdentityID.ToString();
            ar.FK_DPID = sDPID;

            //ar.Amount = "";
            //ar.Area = "";
            //ar.Author = entity.Drafter;
            //ar.Authorizer = entity.DeptPrincipal;
            //ar.AuthorizeTime = entity.ConfirmDate.ToShortDateString();
            //ar.CallBackWebServiceMethod = "";
            //ar.CallBackWebServiceUrl = "";
            //ar.CDNumber = "";
            //ar.Code = entity.DocumentNo;
            //ar.Code19 = "";
            //ar.CommunicationChannelCode = "";
            //ar.CoverRange = "";
            //ar.D_AuditStatus = "";
            //ar.D_DisposeStatus = "";
            //ar.D_DocStandards = "";
            //ar.D_DocStorageLife = "";
            //ar.D_EquipmentRelation = "";
            //ar.D_FileFormat = "";
            //ar.D_FileStatus = "";
            //ar.D_FillingUnit = "";
            //ar.D_InvalidType = "";
            //ar.D_Language = "";
            //ar.D_ProcessStatus = entity.D_StepStatus;
            //ar.D_Reactor = "";
            //ar.D_ReceiveType = "";
            //ar.D_SecretLevel = "";
            //ar.D_StorageCarrierType = "";
            //ar.DCTableName = "";
            //ar.DevolveStatus = "";
            //ar.DigitalResourceFormationDept = "";
            //ar.DigitalResourceFormationTime = "";
            //ar.DocCode = "";
            //ar.DocCodesExplain = "";
            //ar.DocmentType = "";
            //ar.DocPages = "";
            //ar.DocStorageLife = "";
            //ar.EffectTime = "";
            ////ar.ElectronicDocumentCount = "";
            //ar.ElectronicDocumentTransceiverTime = "";
            //ar.ExpertOpinion = "";
            //ar.Ext_2 = "";
            //ar.Ext_3 = "";
            //ar.Ext_4 = "";
            //ar.Ext_5 = "";
            //ar.FileName = entity.DocumentTitle;
            //ar.FillingTime = "";
            //ar.FK_CategoryID = "";
            //ar.FK_DC_ArchiveId = "";
            //ar.FormationDept = entity.Department;
            //ar.FormationTime = entity.DraftDate.ToShortDateString();
            //ar.FrameCode = "";
            //ar.FunctionField = "";
            //ar.GatherLevel = "";
            //ar.Importer = "";
            //ar.ImporterTime = "";
            //ar.InvalidTime = "";
            //ar.Is_Dispose = "";
            //ar.Is_Lend = "";
            //ar.Is_Piece = "";
            //ar.Is_Transfer = "";
            //ar.IsDeleteAfterProcess = "";
            //ar.IsDownLoadAttachment = "";
            //ar.KeyWords = "";
            //ar.Level = "";
            //ar.MainDispenseUnit = "";
            //ar.MediaTimespan = "";
            //ar.NucleusCode = "";
            //ar.OriginalID = "";
            //ar.OriginalInfomationSystem = "";
            //ar.OtherFileName = "";
            //ar.OtherTitle = "";
            //ar.OverhaulCode = "";
            //ar.PaperDocumentTransceiverTime = "";
            //ar.PictureCode = "";
            //ar.Profession = "";
            //ar.QualitySafeLevel = "";
            //ar.ReceiveCode = "";
            //ar.ReceiveTime = "";
            //ar.RecorderCode = "";
            //ar.RelatedCode = "";
            //ar.RelatedDespenseUnit = "";
            //ar.Remark = "";
            //ar.Revision = "";
            //ar.Room = "";
            //ar.StaffCode = "";
            //ar.SubTitle = "";
            //ar.Summary = "";
            ////ar.System = "";
            //ar.SystemCode = "";
            //ar.ThemeWord = entity.Subject;
            //ar.Title = "";
            //ar.UndertakeDepartment = entity.MainSend;
            //ar.Workshop = "";

            ar.ElectronicDocumentCount = ucAttachment.UCDataList.Count.ToString();
            #endregion
            sXml = hn_oa2dp.GenOAArchiveNode(ar, base.TemplateName);

            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 = "";
            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 < ucAttachment.UCDataList.Count; i++)
            {
                FounderSoftware.ADIM.OA.OA2DP.HNDP_CAttachmentNode at = new HNDP_CAttachmentNode();
                CFuJian file = ucAttachment.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);
        }
        private string Devovle2DP2(HN_OA2DP hn_oa2dp, string sDPID)
        {
            string sXml = "";

            FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode();

            List <FounderSoftware.ADIM.OA.OA2DP.DevKVItem> ls = hn_oa2dp.MapFunction("DP", base.TemplateName);

            B_WorkRelation entity = ControlToEntity(false) as B_WorkRelation;

            entity.FormsData = XmlUtility.SerializeXml(entity);

            //ar.SetAttribute("FormationTime"/*配置文件中的归档字段*/, "2009-12-12"/*cEntity.GetValue(配置文件中的实体属性名)*/);
            //string sValue = ar.GetAttribute("FormationTime");
            #region 生成Archive节点
            ar.System = "OA_" + base.IdentityID.ToString();

            #region 根据DevolveConfig.xml配置参数设置Archive归档节点
            for (int i = 0; i < ls.Count; i++)
            {
                string skey  = (ls[i] as FounderSoftware.ADIM.OA.OA2DP.DevKVItem).sKey;
                string sName = (ls[i] as FounderSoftware.ADIM.OA.OA2DP.DevKVItem).sValue;
                string sType = (ls[i] as FounderSoftware.ADIM.OA.OA2DP.DevKVItem).sType;
                ar.SetAttribute(skey, hn_oa2dp.PreHandel(entity, sName, sType, true) /*(entity.GetVal(sName) as string)*/);
            }
            ar.SetOAArchiveNode();
            // 其他节点处理应放置在SetOAArchiveNode方法之后
            ar.FK_DPID = sDPID;
            //return Devolve2DP(oaDev, sDPID, ar);
            #endregion 根据DevolveConfig.xml配置参数设置Archive归档节点

            ar.ElectronicDocumentCount = ucAttachment.UCDataList.Count.ToString();
            #endregion
            sXml = hn_oa2dp.GenOAArchiveNode(ar, base.TemplateName);

            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 = "";
            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 < ucAttachment.UCDataList.Count; i++)
            {
                FounderSoftware.ADIM.OA.OA2DP.HNDP_CAttachmentNode at = new HNDP_CAttachmentNode();
                CFuJian file = ucAttachment.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);
        }
Exemplo n.º 18
0
        public int SaveNewList(string UCProcessType, string workItemID, List <CFuJian> newList, string TBID)
        {
            if (workItemID == "" && TBID == "")
            {
                return(1);
            }
            string tableName = TableName.GetWorkItemsTableName(UCProcessType);

            DataTable dt = new DataTable();

            if (workItemID != "")
            {
                string sql = string.Format("SELECT FormsData FROM {0} WHERE WorkItemID='{1}'", tableName, workItemID);
                dt = SQLHelper.GetDataTable1(sql);
            }
            else
            {
                string sql = string.Format("SELECT FormsData FROM {0} WHERE ID='{1}'", tableName, TBID);
                dt = SQLHelper.GetDataTable1(sql);
            }

            if (dt.Rows.Count > 0)
            {
                string xml    = dt.Rows[0][0].ToString();
                string newXml = "";
                if (UCProcessType.Contains("新版"))
                {
                    UCProcessType = UCProcessType.Substring(2);
                }
                switch (UCProcessType)
                {
                    #region 获得新实体
                    #region 发文
                    //case "公司发文":
                    //    EntitySend entity1 = XmlUtility.DeSerializeXml<EntitySend>(xml);
                    //    if (entity1 != null)
                    //    {
                    //        entity1.FileList = newList;

                    //        newXml = XmlUtility.SerializeXml<EntitySend>(entity1);
                    //    }
                    //    break;
                    //case "党委发文":
                    //    EntitySend entity2 = XmlUtility.DeSerializeXml<EntitySend>(xml);
                    //    if (entity2 != null)
                    //    {
                    //        entity2.FileList = newList;
                    //        newXml = XmlUtility.SerializeXml<EntitySend>(entity2);
                    //    }
                    //    break;
                    //case "工会发文":
                    //    EntitySend entity3 = XmlUtility.DeSerializeXml<EntitySend>(xml);
                    //    if (entity3 != null)
                    //    {
                    //        entity3.FileList = newList;
                    //        newXml = XmlUtility.SerializeXml<EntitySend>(entity3);
                    //    }
                    //    break;
                    //case "纪委发文":
                    //    EntitySend entity4 = XmlUtility.DeSerializeXml<EntitySend>(xml);
                    //    if (entity4 != null)
                    //    {
                    //        entity4.FileList = newList;
                    //        newXml = XmlUtility.SerializeXml<EntitySend>(entity4);
                    //    }
                    //    break;
                    //case "团委发文":
                    //    M_TWF_WorkItems entity5 = XmlUtility.DeSerializeXml<M_TWF_WorkItems>(xml);
                    //    if (entity5 != null)
                    //    {
                    //        entity5.FileList = newList;
                    //        newXml = XmlUtility.SerializeXml<M_TWF_WorkItems>(entity5);
                    //    }
                    //    break;
                    #endregion

                    #region 收文
                case "公司收文":
                    B_GS_WorkItems entity6 = XmlUtility.DeSerializeXml <B_GS_WorkItems>(xml);
                    if (entity6 != null)
                    {
                        entity6.FileList = newList;
                        newXml           = XmlUtility.SerializeXml <B_GS_WorkItems>(entity6);
                    }
                    break;
                    //case "工会收文":
                    //    B_GHS_WorkItems entity7 = XmlUtility.DeSerializeXml<B_GHS_WorkItems>(xml);
                    //    if (entity7 != null)
                    //    {
                    //        entity7.FileList = newList;
                    //        newXml = XmlUtility.SerializeXml<B_GHS_WorkItems>(entity7);
                    //    }
                    //    break;
                    //case "团委收文":
                    //    B_TWS_WorkItems entity8 = XmlUtility.DeSerializeXml<B_TWS_WorkItems>(xml);
                    //    if (entity8 != null)
                    //    {
                    //        entity8.FileList = newList;
                    //        newXml = XmlUtility.SerializeXml<B_TWS_WorkItems>(entity8);
                    //    }
                    //    break;
                    //case "党委纪委收文":
                    //    B_DJS_WorkItems entity9 = XmlUtility.DeSerializeXml<B_DJS_WorkItems>(xml);
                    //    if (entity9 != null)
                    //    {
                    //        entity9.FileList = newList;
                    //        newXml = XmlUtility.SerializeXml<B_DJS_WorkItems>(entity9);
                    //    }
                    break;
                    #endregion

                case "工作联系单":
                    B_WorkRelation entity10 = XmlUtility.DeSerializeXml <B_WorkRelation>(xml);
                    if (entity10 != null)
                    {
                        entity10.FileList = newList;
                        newXml            = XmlUtility.SerializeXml <B_WorkRelation>(entity10);
                    }
                    break;

                //case "请示报告":
                //    B_RequestReport entity11 = XmlUtility.DeSerializeXml<B_RequestReport>(xml);
                //    if (entity11 != null)
                //    {
                //        entity11.FileList = newList;
                //        newXml = XmlUtility.SerializeXml<B_RequestReport>(entity11);
                //    }
                //    break;
                //case "程序文件":
                //    B_PF entity12 = XmlUtility.DeSerializeXml<B_PF>(xml);
                //    if (entity12 != null)
                //    {
                //        entity12.FileList = newList;
                //        newXml = XmlUtility.SerializeXml<B_PF>(entity12);
                //    }
                //    break;
                case "函件发文":
                    EntityLetterSend entity13 = XmlUtility.DeSerializeXml <EntityLetterSend>(xml);
                    if (entity13 != null)
                    {
                        entity13.FileList = newList;
                        newXml            = XmlUtility.SerializeXml <EntityLetterSend>(entity13);
                    }
                    break;

                //case "函件收文":
                //    B_LetterReceive entity14 = XmlUtility.DeSerializeXml<B_LetterReceive>(xml);
                //    if (entity14 != null)
                //    {
                //        entity14.FileList = newList;
                //        newXml = XmlUtility.SerializeXml<B_LetterReceive>(entity14);
                //    }
                //    break;
                default: newXml = ""; break;
                    #endregion
                }
                if (newXml != "")
                {
                    //更新新实体
                    int ret = UpdateNewFormsData(tableName, workItemID, newXml, TBID);
                    return(ret);
                }
                else
                {
                    return(-1);
                }
            }
            else
            {
                //throw new Exception(UCProcessType + workItemID + tableName + "未找到对应的记录!");
                return(1);
            }
        }
        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_WorkRelation bWorkRelation = new B_WorkRelation();

                rptComment.DataSource = bWorkRelation.GetSignComment(processID, workItemID, stepName, userID, deptID);
                rptComment.DataBind();
            }
        }
        /// <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 CopyWRInfo(String ID, String p_strStepName, String p_strUserID, String p_strProcessID, String p_strWorkItemID, String p_strPoolID)
        {
            try
            {
                B_WorkRelation selectEntity = new B_WorkRelation();
                selectEntity.ID = int.Parse(ID);

                B_WorkRelation newEntity = new B_WorkRelation();
                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;
            }
        }
Exemplo n.º 21
0
        private void SetBaseExportData(UC_Print ucPrint, B_WorkRelation cEntity, string sParam)
        {
            ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString()));       //<col>拟稿日期:|right</col>
            ucPrint.ExportData.Add(cEntity.MainSend);        //<col>主送:|right</col>
            ucPrint.ExportData.Add(cEntity.DocumentNo);      //<col>编号:|right</col>
            ucPrint.ExportData.Add(cEntity.Department);      //<col>编制部门:|right</col>
            ucPrint.ExportData.Add(cEntity.CopySend);        //<col>抄送:|right</col>
            ucPrint.ExportData.Add(cEntity.DocumentTitle);         //<col>主题:|right</col>
            //ucPrint.ExportData.Add(SysString.HtmlToTextCode(cEntity.Content));         //<col>内容:|right</col>
            ucPrint.ExportData.Add(cEntity.Content);         //<col>内容:|right</col>

            ucPrint.ExportData.Add(cEntity.UndertakeCircs);  //<col>答复或处理意见:|right</col>
            ucPrint.ExportData.Add(cEntity.BanLiYiJian);     //<col>办理意见:|right</col>
            ucPrint.ExportData.Add(cEntity.DeptLeader);      //<col>承办部门领导:|right</col>
            ucPrint.ExportData.Add(cEntity.SectionLeader);   //<col>科室领导:|right</col>
            ucPrint.ExportData.Add(cEntity.Contractor);      //<col>承办人:|right</col>

            //ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ChengBanRiQi.ToShortDateString()));    //<col>承办日期:|right</col>
            string strChengBanRiQi=cEntity.StepName==ProcessConstString.StepName.WorkRelationStepName.STEP_DIRECTOR?cEntity.DirectorDate.ToString():cEntity.StepName==ProcessConstString.StepName.WorkRelationStepName.STEP_CHIEF?cEntity.SectionDate.ToString():cEntity.StepName==ProcessConstString.StepName.WorkRelationStepName.STEP_MEMBER?cEntity.MemberDate.ToString():"";
            ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ChengBanRiQi.ToString() == System.DateTime.MinValue.ToString() ? strChengBanRiQi : cEntity.ChengBanRiQi.ToString()));    //<col>承办日期:|right</col>    renjinquan+ 根据步骤取承办日期。

            //ucPrint.ExportData.Add(cEntity.Message);       //<col>提示信息:|right</col>
            //if (sParam != "工作联系单7")
            //    ucPrint.ExportData.Add(cEntity.MessageAdd);//<col>添加:|right</col>
            ucPrint.ExportData.Add(cEntity.DeptPrincipal);   //<col>签发人:|right</col>
            ucPrint.ExportData.Add(cEntity.CheckDrafter);    //<col>核稿人:|right</col>
            ucPrint.ExportData.Add(cEntity.Drafter);         //<col>拟稿人:|right</col>
            ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ConfirmDate.ToShortDateString()));     //<col>签发日期:|right</col>
        }