protected void btnArchive_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(RegisterID);

            if (l_BusReceiveEdit != null)
            {
                l_BusReceiveEdit.ArchiveStatus = "已归档";
                l_BusReceiveEdit.Save();
            }
            string strMessage = string.Empty;

            try
            {
                this.Devolve(out strMessage);
                base.Devolved(base.ProcessID, base.TemplateName);
                JScript.Alert("归档成功!\\n流水号:" + strMessage, false);
            }
            catch (Exception ex)
            {
                base.WriteLog(ex.Message);
                JScript.Alert("归档失败!请查看配置是否正确!", false);
            }
        }
Beispiel #2
0
        public void RaiseCallbackEvent(string eventArgument)
        {
            B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(eventArgument);

            //附件信息
            if (!String.IsNullOrEmpty(l_BusReceiveEdit.FileData))
            {
                List <CFuJian> l_objAttach = XmlUtility.DeSerializeXml <List <CFuJian> >(l_BusReceiveEdit.FileData);
                l_BusReceiveEdit.FileData = SysString.FuJianList2Xml(l_objAttach);
            }

            StringWriter   l_strWriter    = new StringWriter(CultureInfo.InvariantCulture);
            JsonSerializer jsonSerializer = new JsonSerializer();

            jsonSerializer.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
            using (JsonWriter jsonWriter = new JsonWriter(l_strWriter))
            {
                jsonSerializer.Serialize(jsonWriter, l_BusReceiveEdit);
            }

            Session["附件ListTemp"] = l_BusReceiveEdit.FileData;

            m_strCallBack = l_strWriter.ToString();
        }
Beispiel #3
0
        /// <summary>
        /// 根据获取的ID填充表单
        /// </summary>
        /// <param name="ID"></param>
        public void SetFormByID(string ID)
        {
            B_ReceiveEdit l_receiveedit = new B_ReceiveEdit();

            l_receiveedit.ID = Convert.ToInt32(ID);

            PopulateEditField(l_receiveedit);
        }
        /// <summary>
        /// 查询按钮的处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnQuery_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (!VerifyQueryField())
            {
                ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "表单验证失败");
                return;
            }

            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ProcessName = ProcessTemplate;

            //收文号-从
            l_BusReceiveEdit.ReceiveNoFrom = txtQueryDocNoFrom.Text.TrimEnd();

            //收文号-到
            l_BusReceiveEdit.ReceiveNoTo = txtQueryDocNoTo.Text.TrimEnd();

            //文件标题
            l_BusReceiveEdit.DocumentTitle = txtQueryDocTitle.Text.TrimEnd();

            //收文日期-从
            if (ValidateUtility.IsDateTime(txtQueryRecDateFrom.Text.TrimEnd()))
            {
                l_BusReceiveEdit.ReceiveDateFrom = txtQueryRecDateFrom.ValDate;
            }

            //收文日期-到
            if (ValidateUtility.IsDateTime(txtQueryRecDateTo.Text.TrimEnd()))
            {
                l_BusReceiveEdit.ReceiveDateTo = txtQueryRecDateTo.ValDate;
            }

            //来文单位
            l_BusReceiveEdit.ReceiveUnit = txtQueryRecUnit.Text.TrimEnd();

            //收文年份
            l_BusReceiveEdit.ReceiveYear = ddlQueryRecYear.Text.TrimEnd();

            //状态
            if (ddlQueryStatus.SelectedItem != null)
            {
                l_BusReceiveEdit.Status = ddlQueryStatus.SelectedItem.Text;
            }
            l_BusReceiveEdit.Start = this.gdvList.PageIndex * this.gdvList.PageSize;
            l_BusReceiveEdit.End = this.gdvList.PageIndex * this.gdvList.PageSize + this.gdvList.PageSize;
            l_BusReceiveEdit.Sort = null;

            this.gdvList.DataSource = l_BusReceiveEdit.QueryRegisterInfo(l_BusReceiveEdit);
            this.gdvList.RecordCount = l_BusReceiveEdit.RowCount;
            this.gdvList.DataBind();
        }
Beispiel #5
0
        /// <summary>
        /// 修改按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnModify_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd()))
            {
                JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false);
                return;
            }
            if (!VerifyEditField())
            {
                JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            l_BusReceiveEdit    = new B_ReceiveEdit();
            l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text);

            if (this.txtSendNo.Text.TrimEnd() != l_BusReceiveEdit.SendLetterNo)//任金权增加
            {
                //行文号是否重复
                if (B_ReceiveEdit.IsHaveSendNo(this.txtSendNo.Text.TrimEnd()))
                {
                    JScript.ShowMsgBox(this.Page, "行文号重复", false);
                    this.txtSendNo.Focus();
                    return;
                }
            }

            if (l_BusReceiveEdit.CreateDate == DateTime.MinValue)
            {
                JScript.ShowMsgBox(this.Page, "当前收文登记信息已经被删除,不能做修改动作!", false);
                return;
            }

            PopulateEntity(l_BusReceiveEdit);

            //归档状态
            if (chkIsArchive.Checked)
            {
                l_BusReceiveEdit.ArchiveStatus = "已归档";
            }
            else
            {
                l_BusReceiveEdit.ArchiveStatus = "未完成";
            }

            if (l_BusReceiveEdit.Save())
            {
                JScript.ShowMsgBox(this.Page, "保存成功", false);
                PopulateEditField(l_BusReceiveEdit);
                LoadRegisterList();
            }
        }
        /// <summary>
        /// 查询按钮的处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnQuery_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (!VerifyQueryField())
            {
                ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "表单验证失败");
                return;
            }

            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ProcessName = ProcessTemplate;

            //收文号-从
            l_BusReceiveEdit.ReceiveNoFrom = txtQueryDocNoFrom.Text.TrimEnd();

            //收文号-到
            l_BusReceiveEdit.ReceiveNoTo = txtQueryDocNoTo.Text.TrimEnd();

            //文件标题
            l_BusReceiveEdit.DocumentTitle = txtQueryDocTitle.Text.TrimEnd();

            //收文日期-从
            if (ValidateUtility.IsDateTime(txtQueryRecDateFrom.Text.TrimEnd()))
            {
                l_BusReceiveEdit.ReceiveDateFrom = txtQueryRecDateFrom.ValDate;
            }

            //收文日期-到
            if (ValidateUtility.IsDateTime(txtQueryRecDateTo.Text.TrimEnd()))
            {
                l_BusReceiveEdit.ReceiveDateTo = txtQueryRecDateTo.ValDate;
            }

            //来文单位
            l_BusReceiveEdit.ReceiveUnit = txtQueryRecUnit.Text.TrimEnd();

            //收文年份
            l_BusReceiveEdit.ReceiveYear = ddlQueryRecYear.Text.TrimEnd();

            //状态
            if (ddlQueryStatus.SelectedItem != null)
            {
                l_BusReceiveEdit.Status = ddlQueryStatus.SelectedItem.Text;
            }
            l_BusReceiveEdit.Start = this.gdvList.PageIndex * this.gdvList.PageSize;
            l_BusReceiveEdit.End   = this.gdvList.PageIndex * this.gdvList.PageSize + this.gdvList.PageSize;
            l_BusReceiveEdit.Sort  = null;

            this.gdvList.DataSource  = l_BusReceiveEdit.QueryRegisterInfo(l_BusReceiveEdit);
            this.gdvList.RecordCount = l_BusReceiveEdit.RowCount;
            this.gdvList.DataBind();
        }
        protected void btnSumitInspect_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;
            String        l_strInspector   = String.Empty;

            if (String.IsNullOrEmpty(ddlPoliticalOfficer.SelectedValue))
            {
                JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择党群工作处处长");
                return;
            }
            l_strInspector = ddlPoliticalOfficer.SelectedValue;

            //表单的合法性验证
            if (!VerifyField())
            {
                JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            //提交动作
            this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_INSPECT;

            if (String.IsNullOrEmpty(WorkItemID))
            {
                //流程创建时候设置自定义属性
                l_htAttribute.Add(ConstString.CustomAttr.Receive.Initiator, CurrentUserInfo.UserName);

                l_BusReceiveEdit    = new B_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID);

                if (l_BusReceiveEdit != null)
                {
                    l_BusReceiveEdit.ProcessID = base.ProcessID;
                    l_BusReceiveEdit.Save();
                }
            }

            ViewBase l_objClerks     = OAUser.GetUserByRole(OUConstString.RoleName.PartysDocument);
            String   l_strClerkField = String.Empty;

            foreach (User user in l_objClerks.Ens)
            {
                l_strClerkField += user.DomainUserID + ";";
            }
            l_strClerkField = SysString.TrimLastWord(l_strClerkField);

            l_htAttribute.Add(ConstString.CustomAttr.Receive.Officer, l_strInspector);
            l_htAttribute.Add(ConstString.CustomAttr.Receive.Clerks, l_strClerkField);

            base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false));
        }
Beispiel #8
0
        private void LoadRegisterList()
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            //if (String.IsNullOrEmpty(SubTemplateName))
            //{
            //    return;
            //}

            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ProcessName = SubTemplateName;

            //收文号-从
            l_BusReceiveEdit.ReceiveNoFrom = FormsMethod.Filter(txtQueryDocNoFrom.Text.TrimEnd());

            //收文号-到
            l_BusReceiveEdit.ReceiveNoTo = FormsMethod.Filter(txtQueryDocNoTo.Text.TrimEnd());

            //文件标题
            l_BusReceiveEdit.DocumentTitle = FormsMethod.Filter(txtQueryDocTitle.Text.TrimEnd());

            //收文日期-从
            l_BusReceiveEdit.ReceiveDateFrom = txtQueryRecDateFrom.ValDate;

            //收文日期-到
            l_BusReceiveEdit.ReceiveDateTo = txtQueryRecDateTo.ValDate;

            //来文单位
            l_BusReceiveEdit.ReceiveUnit = FormsMethod.Filter(txtQueryRecUnit.Text.TrimEnd());

            //收文年份
            l_BusReceiveEdit.ReceiveYear = ddlQueryRecYear.Text.TrimEnd();

            //状态
            if (ddlQueryStatus.SelectedItem != null)
            {
                l_BusReceiveEdit.Status = ddlQueryStatus.SelectedItem.Text;
            }

            l_BusReceiveEdit.Start = gvRegisterList.PageIndex * gvRegisterList.PageSize;
            l_BusReceiveEdit.End   = gvRegisterList.PageIndex * gvRegisterList.PageSize + gvRegisterList.PageSize;
            l_BusReceiveEdit.Sort  = SortExpression;

            this.gvRegisterList.DataSource  = l_BusReceiveEdit.QueryRegisterInfo(l_BusReceiveEdit);
            this.gvRegisterList.RecordCount = l_BusReceiveEdit.RowCount;
            this.gvRegisterList.DataBind();
        }
Beispiel #9
0
        /// <summary>
        /// 启动流程按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnLaunch_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd()))
            {
                JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false);
                return;
            }

            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text);

            l_BusReceiveEdit.Save();
            if (!String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID))
            {
                JScript.ShowMsgBox(this.Page, "当前选择的收文登记记录已经启动!", false);
                return;
            }

            String l_strSuffix = ConstString.QueryString.REGISTER_ID + "=" + Convert.ToString(txtRegisterID.Text);

            switch (SubTemplateName)
            {
            case ProcessConstString.TemplateName.COMPANY_RECEIVE:
                Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_CompanyReceive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.COMPANY_RECEIVE) + "&" + l_strSuffix, true);
                break;

            case ProcessConstString.TemplateName.TRADE_UNION_RECEIVE:
                Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true);
                break;

            case ProcessConstString.TemplateName.PARTY_DISCIPLINE_RECEIVE:
                Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true);
                break;

            case ProcessConstString.TemplateName.YOUTH_LEAGUE_RECEIVE:
                Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true);
                break;
            }
        }
Beispiel #10
0
        /// <summary>
        /// 删除按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd()))
            {
                JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false);
                return;
            }
            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text);

            if (l_BusReceiveEdit.Delete())
            {
                JScript.ShowMsgBox(this.Page, "删除成功", false);
                ClearEditField();
                LoadRegisterList();
            }
        }
        /// <summary>
        /// 删除按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd()))
            {
                JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false);
                return;
            }
            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text);

            if (l_BusReceiveEdit.Delete())
            {
                JScript.ShowMsgBox(this.Page, "删除成功", false);
                ClearEditField();
                LoadRegisterList();
            }
        }
Beispiel #12
0
        /// <summary>
        /// 新增按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            //表单的合法性验证
            if (!VerifyEditField())
            {
                JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            //行文号是否重复
            if (B_ReceiveEdit.IsHaveSendNo(this.txtSendNo.Text.TrimEnd()))//任金权增加
            {
                JScript.ShowMsgBox(this.Page, "行文号重复", false);
                this.txtSendNo.Focus();
                return;
            }

            l_BusReceiveEdit = new B_ReceiveEdit();

            PopulateEntity(l_BusReceiveEdit);


            //l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName);
            ////////////////////////////////////////////////////20110124 扬子江
            if (!(TemplateName.Equals("党纪工团收文")))
            {
                l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName);
            }
            else
            {
                this.SubTemplateName = ddlProcessTemplate.SelectedValue;
                if (this.SubTemplateName == "工会收文")
                {
                    l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("H" + DateTime.Now.Year.ToString(), this.SubTemplateName);
                }
                if (this.SubTemplateName == "团委收文")
                {
                    l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("T" + DateTime.Now.Year.ToString(), this.SubTemplateName);
                }
                if (this.SubTemplateName == "党委纪委收文")
                {
                    l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("D" + DateTime.Now.Year.ToString(), this.SubTemplateName);
                }
            }

            //归档状态
            if (chkIsArchive.Checked)
            {
                l_BusReceiveEdit.ArchiveStatus = "已归档";
            }
            else
            {
                l_BusReceiveEdit.ArchiveStatus = "未完成";
            }

            if (l_BusReceiveEdit.Save())
            {
                JScript.ShowMsgBox(this.Page, "新增成功", false);
                PopulateEditField(l_BusReceiveEdit);
                btnQuery_Click(null, null);
            }
        }
        /// <summary>
        /// 启动流程按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnLaunch_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd()))
            {
                JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false);
                return;
            }

            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text);

            l_BusReceiveEdit.Save();
            if (!String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID))
            {
                JScript.ShowMsgBox(this.Page, "当前选择的收文登记记录已经启动!", false);
                return;
            }

            String l_strSuffix = ConstString.QueryString.REGISTER_ID + "=" + Convert.ToString(txtRegisterID.Text);

            switch (SubTemplateName)
            {
                case ProcessConstString.TemplateName.COMPANY_RECEIVE:
                    Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_CompanyReceive&TemplateName=" + Server.UrlEncode(ProcessConstString.TemplateName.COMPANY_RECEIVE) + "&" + l_strSuffix, true);
                    break;
                case ProcessConstString.TemplateName.TRADE_UNION_RECEIVE:
                    Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" +  Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true);
                    break;
                case ProcessConstString.TemplateName.PARTY_DISCIPLINE_RECEIVE:
                    Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" +  Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true);
                    break;
                case ProcessConstString.TemplateName.YOUTH_LEAGUE_RECEIVE:
                    Response.Redirect("Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkFlow.Receive.PG_Receive&TemplateName=" +  Server.UrlEncode(ProcessConstString.TemplateName.MERGED_RECEIVE) + "&" + l_strSuffix, true);
                    break;
            }
        }
        /// <summary>
        /// 根据获取的ID填充表单
        /// </summary>
        /// <param name="ID"></param>
        public void SetFormByID(string ID)
        {
            B_ReceiveEdit l_receiveedit = new B_ReceiveEdit();

            l_receiveedit.ID = Convert.ToInt32(ID);

            PopulateEditField(l_receiveedit);
        }
        protected void btnArchive_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();
            l_BusReceiveEdit.ID = Convert.ToInt32(RegisterID);

            if (l_BusReceiveEdit != null)
            {
                l_BusReceiveEdit.ArchiveStatus = "已归档";
                l_BusReceiveEdit.Save();
            }
            string strMessage = string.Empty;
            try
            {
                this.Devolve(out strMessage);
                base.Devolved(base.ProcessID, base.TemplateName);
                JScript.Alert("归档成功!\\n流水号:" + strMessage, false);
            }
            catch (Exception ex)
            {
                base.WriteLog(ex.Message);
                JScript.Alert("归档失败!请查看配置是否正确!", false);
            }
        }
        private string Devolve2DC(HN_OA2DC oaDev)
        {
            string sXml = "";

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

            B_MergeReceiveBase entity = this.ControlToEntity(false) as B_MergeReceiveBase;
            entity.FormsData = XmlUtility.SerializeXml(entity);
            B_ReceiveEdit pEntity = new B_ReceiveEdit();
            pEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text));

            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;
                string value = oaDev.PreHandel(entity, sName, sType);
                if (string.IsNullOrEmpty(value))
                {
                    value = oaDev.PreHandel(pEntity, sName, 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 = base.TemplateName;
                at.FK_FileID = "";
                at.MakeDate = "";
                at.MakeUnit = "";
                at.PublishedTime = "";
                at.Remark = "";

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

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

            return sXml;
        }
        private string 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_MergeReceiveBase entity = this.ControlToEntity(false) as B_MergeReceiveBase;
            entity.FormsData = XmlUtility.SerializeXml(entity);
            B_ReceiveEdit RecvEditEntity = new B_ReceiveEdit();
            RecvEditEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text));
            //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;
                string value = hn_oa2dp.PreHandel(entity, sName, sType);
                if (string.IsNullOrEmpty(value))
                {
                    value = hn_oa2dp.PreHandel(RecvEditEntity, sName, sType);
                }
                ar.SetAttribute(skey, value/*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 = base.TemplateName;
                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;
        }
        /// <summary>
        /// 实体填充控件
        /// </summary>
        protected override void EntityToControl()
        {
            B_GS_WorkItems rentity = base.EntityData != null ? base.EntityData as B_GS_WorkItems : new B_GS_WorkItems();
            // ViewState[ConstString.ViewState.ENTITY_DATA] = rentity;
            //收文编辑号
            this.RegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID];
            if (!String.IsNullOrEmpty(this.RegisterID))
            {
                B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID);
                if (l_BusReceiveEdit == null)
                {
                    JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "当前选择的收文登记信息不存在或者已经被删除,无法继续操作", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle");
                    return;
                }
                this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml<List<CFuJian>>(l_BusReceiveEdit.FileData);
                this.txtReceiveNo.Text = l_BusReceiveEdit.ReceiveNo;
                this.txtReceiveDate.Text = l_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal);
                this.txtSendLetterNo.Text = l_BusReceiveEdit.SendLetterNo;
                this.txtDocumentTitle.Text = l_BusReceiveEdit.DocumentTitle;
                this.txtCommunicationUnit.Text = l_BusReceiveEdit.ReceiveUnit;
                this.txtPreVolumeNo.Text = l_BusReceiveEdit.PreVolumeNo;
                this.txtJinJi.Text = l_BusReceiveEdit.UrgentDegree;
                base.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL;
            }
            else
            {
                if (ViewState["filelist"] != null)
                {
                    this.ucAttachment.UCDataList = ViewState["filelist"] as List<CFuJian>;
                }
                else
                {
                    if (rentity != null)
                    {
                        this.ucAttachment.UCDataList = rentity.FileList; //实体绑定到控件时赋值
                    }
                }
                //收文号
                this.txtReceiveNo.Text = rentity.DocumentNo;

                //收文日期
                this.txtReceiveDate.Text = rentity.DocumentReceiveDate.ToString(ConstString.DateFormat.Normal);

                //原文号
                this.txtSendLetterNo.Text = rentity.SendNo;

                //来文单位
                this.txtCommunicationUnit.Text = rentity.CommunicationUnit;

                //卷号
                this.txtPreVolumeNo.Text = rentity.VolumeNo;

                //文件名称
                this.txtDocumentTitle.Text = rentity.DocumentTitle;
            }

            if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL && !base.IsPreview)//公司办主任禁用状态不从数据库抓值,添加已有的值。
            {
                this.ddlOfficer.SelectedValue = rentity.Officer;
            }
            else
            {
                if (!string.IsNullOrEmpty(rentity.Officer) && string.IsNullOrEmpty(rentity.OfficerName))//兼容老版本
                {
                    //绑定公司办领导
                    //this.ddlOfficer.SelectedValue = rentity.Officer;
                    rentity.OfficerName = OAUser.GetUserName(rentity.Officer);
                }
                if (!string.IsNullOrEmpty(rentity.Officer) && !string.IsNullOrEmpty(rentity.OfficerName))
                {
                    this.ddlOfficer.Items.Add(new ListItem(rentity.OfficerName, rentity.Officer));
                }
            }

            if ((base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_OFFICE || base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_PROCESS_CENTER) && !base.IsPreview)//公司领导禁用状态不从数据库抓值,添加已有的值。
            {
                this.ddlLeadShip.SelectedValue = rentity.LeaderShip;
            }
            else
            {
                if (!string.IsNullOrEmpty(rentity.LeaderShip) && string.IsNullOrEmpty(rentity.LeaderShipName))//兼容老版本
                {
                    rentity.LeaderShipName = OAUser.GetUserName(rentity.LeaderShip);
                }
                if (!string.IsNullOrEmpty(rentity.LeaderShip) && !string.IsNullOrEmpty(rentity.LeaderShipName))
                {
                    this.ddlLeadShip.Items.Add(new ListItem(rentity.LeaderShipName, rentity.LeaderShip));
                }
            }

            this.dllUnderDept.SelectedValue = rentity.UnderTakeChief;
            this.ddlUnderPeople.SelectedValue = rentity.UnderTakePeople;

            if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_DISTRIBUTION || base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_PROCESS_CENTER)
            {
                //传阅
                this.txtCirculatePeopleName.Text = rentity.CPeopleName;
                this.txtCPeopleID.Text = rentity.CPeopleID;
                this.txtCirculateDeptName.Text = rentity.CDeptName;
                this.txtCdeptID.Text = rentity.CDeptID;
            }
            if (!string.IsNullOrEmpty(rentity.UnderTakeDept) && string.IsNullOrEmpty(rentity.UnderTakeDeptName))
            {
                rentity.UnderTakeDeptName = OADept.GetDeptName(rentity.UnderTakeDept);
            }
            this.txtUnderTakeDeptName.Text = rentity.UnderTakeDeptName;
            if (!string.IsNullOrEmpty(rentity.UnderTakePeople) && string.IsNullOrEmpty(rentity.UnderTakePeopleName))
            {
                rentity.UnderTakePeopleName = OAUser.GetUserName(rentity.UnderTakePeople);
            }
            if (string.IsNullOrEmpty(rentity.UnderTakeDept))
            {
                this.txtUnderTakeUserName.Text = rentity.UnderTakePeopleName;
            }

            //批阅意见
            this.txtOfficerComment.Text = rentity.Officer_Comment;

            //批示意见
            this.txtLeaderComment.Text = rentity.LS_CommentAdd;
            this.txtLeadCommentView.Text = rentity.LS_Comment;

            //承办意见
            this.txtUnderTakeComment.Text = rentity.UnderTake_Comment;
            this.txtUnderComment.Text = rentity.UnderTake_CommentAdd;

            //提示信息
            this.txtPrompt.Text = rentity.Prompt;
            if (rentity.IsFormSave)
            {
                this.txtPromptEdit.Text = rentity.PromptEdit;
            }
            this.txtUnderTakeComment.Text = rentity.UnderTake_Comment;

            //主任后显示label形式的办公室主任与时间
            if (rentity.Officer_Date != "" && rentity.Officer_Date != null)
            {
                //this.ddlOfficer.Visible = false;
                //this.lbOfficer.Visible = true;
                //this.lbOfficer.Text = rentity.OfficerName + strNewLine + rentity.Officer_Date;
            }

            //领导批示后显示label形式的办领导与时间
            if (rentity.LS_Date != "" && rentity.LS_Date != null)
            {
            //    this.ddlLeadShip.Visible = false;
                this.lbLeadShip.Visible = true;
                this.lbLeadShip.Text = rentity.LS_Date;//rentity.LeaderShipName + strNewLine +
            }
            //else
                this.ddlLeadShip.Visible = true;

            ////承办后显示label形式的承办人员与时间
            //if (rentity.Officer_Date != "" || rentity.Officer_Date != null)
            //{
            //    this.ddlOfficer.Visible = false;
            //    this.lbOfficer.Visible = true;
            //    this.lbOfficer.Text = rentity.OfficerName + strNewLine + rentity.Officer_Date;
            //}
        }
        /// <summary>
        /// 用表单元素内容填充实体内容
        /// </summary>
        /// <param name="l_BusReceiveEdit"></param>
        private void PopulateEntity(B_ReceiveEdit l_BusReceiveEdit)
        {
            //单位
            l_BusReceiveEdit.ReceiveUnit = txtReceiveUnit.Text.TrimEnd();

            //年份
            l_BusReceiveEdit.ReceiveYear = ddlReceiveYear.Text.TrimEnd();

            //收文日期
            l_BusReceiveEdit.ReceiveDate = txtReceiveDate.ValDate;

            //行文号
            l_BusReceiveEdit.SendLetterNo = txtSendNo.Text.TrimEnd();

            //行文日期
            l_BusReceiveEdit.SendLetterDate = txtSendDate.ValDate;

            //文件标题
            l_BusReceiveEdit.DocumentTitle = txtDocumentTitle.Text.TrimEnd();

            //主题词
            l_BusReceiveEdit.SubjectWord = txtKeyWord.Text.TrimEnd();

            //正文页数
            if (ValidateUtility.IsInt(txtPageCount.Text.TrimEnd()))
            {
                l_BusReceiveEdit.PageCount = Convert.ToInt32(txtPageCount.Text.TrimEnd());
            }

            //份数
            if (ValidateUtility.IsInt(txtShareCount.Text.TrimEnd()))
            {
                l_BusReceiveEdit.ShareCount = Convert.ToInt32(txtShareCount.Text.TrimEnd());
            }

            //附件/页数
            if (ValidateUtility.IsInt(txtAttchCount.Text.TrimEnd()))
            {
                l_BusReceiveEdit.AttachmentCount = Convert.ToInt32(txtAttchCount.Text.TrimEnd());
            }

            //保管期限
            l_BusReceiveEdit.KeepTime = ddlKeepTime.Text.TrimEnd();

            //密级
            l_BusReceiveEdit.SecretLevel = ddlSecretLevel.Text.TrimEnd();

            //紧急程度
            l_BusReceiveEdit.UrgentDegree = ddlUrgentDegree.Text.TrimEnd();

            //预立卷号
            l_BusReceiveEdit.PreVolumeNo = txtPreVolumnNo.Text.TrimEnd();

            //备注
            l_BusReceiveEdit.Remarks = txtRemark.Text.TrimEnd();

            //流程名称
            l_BusReceiveEdit.ProcessName = SubTemplateName;

            //是否直接归档
            l_BusReceiveEdit.Is_Archive = chkIsArchive.Checked ? "1" : "0";

            //附件信息
            l_BusReceiveEdit.FileData = XmlUtility.SerializeXml(this.ucFileList.UCDataList);
        }
        /// <summary>
        /// 修改按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnModify_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd()))
            {
                JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false);
                return;
            }
            if (!VerifyEditField())
            {
                JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            l_BusReceiveEdit = new B_ReceiveEdit();
            l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text);

            if (this.txtSendNo.Text.TrimEnd() != l_BusReceiveEdit.SendLetterNo)//任金权增加
            {
                //行文号是否重复
                if (B_ReceiveEdit.IsHaveSendNo(this.txtSendNo.Text.TrimEnd()))
                {
                    JScript.ShowMsgBox(this.Page, "行文号重复", false);
                    this.txtSendNo.Focus();
                    return;
                }
            }

            if (l_BusReceiveEdit.CreateDate == DateTime.MinValue)
            {
                JScript.ShowMsgBox(this.Page, "当前收文登记信息已经被删除,不能做修改动作!", false);
                return;
            }

            PopulateEntity(l_BusReceiveEdit);

            //归档状态
            if (chkIsArchive.Checked)
            {
                l_BusReceiveEdit.ArchiveStatus = "已归档";
            }
            else
            {
                l_BusReceiveEdit.ArchiveStatus = "未完成";
            }

            if (l_BusReceiveEdit.Save())
            {
                JScript.ShowMsgBox(this.Page, "保存成功", false);
                PopulateEditField(l_BusReceiveEdit);
                LoadRegisterList();
            }
        }
        /// <summary>
        /// 实体填充控件
        /// </summary>
        protected override void EntityToControl()
        {
            B_MergeReceiveBase l_objReceiveBase = null;

            //收文登记号
            this.RegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID];

            if (!String.IsNullOrEmpty(this.RegisterID))
            {
                B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID);
                if (l_BusReceiveEdit == null)
                {
                    JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "当前选择的收文登记信息不存在或者已经被删除,无法继续操作", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle");
                    return;
                }

                //附件列表
                this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(l_BusReceiveEdit.FileData);

                //收文号
                this.txtReceiveNo.Text = l_BusReceiveEdit.ReceiveNo;

                //收文日期
                this.txtReceiveDate.Text = l_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal);

                //原文号
                this.txtSendLetterNo.Text = l_BusReceiveEdit.SendLetterNo;

                //来文单位
                this.txtCommunicationUnit.Text = l_BusReceiveEdit.ReceiveUnit;

                //卷号
                this.txtPreVolumeNo.Text = l_BusReceiveEdit.PreVolumeNo;

                //文件名称
                this.txtDocumentTitle.Text = l_BusReceiveEdit.DocumentTitle;

                //紧急程度
                this.txtUrgentDegree.Text = l_BusReceiveEdit.UrgentDegree;

                //步骤名称
                base.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL;

                this.SubTemplateName = l_BusReceiveEdit.ProcessName;

                //党群工作处处长
                OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR);
            }
            else
            {
                l_objReceiveBase = base.EntityData as B_MergeReceiveBase;

                this.SubTemplateName = l_objReceiveBase.TemplateName;

                this.RegisterID = l_objReceiveBase.RegisterID;

                //党群工作处处长
                OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR);

                ddlPoliticalOfficer.SelectedValue = l_objReceiveBase.Officer;
                txtPoliticalOfficerComment.Text   = l_objReceiveBase.Officer_Comment;

                //附件列表
                this.ucAttachment.UCDataList = l_objReceiveBase.FileList;

                //收文号
                this.txtReceiveNo.Text = l_objReceiveBase.DocumentNo;

                //收文日期
                this.txtReceiveDate.Text = l_objReceiveBase.DocumentReceiveDate.ToString(ConstString.DateFormat.Normal);

                //原文号
                this.txtSendLetterNo.Text = l_objReceiveBase.SendNo;

                //来文单位
                this.txtCommunicationUnit.Text = l_objReceiveBase.CommunicationUnit;

                //卷号
                this.txtPreVolumeNo.Text = l_objReceiveBase.VolumeNo;

                //文件名称
                this.txtDocumentTitle.Text = l_objReceiveBase.DocumentTitle;

                //紧急程度
                this.txtUrgentDegree.Text = l_objReceiveBase.UrgentDegree;

                //发起人ID
                this.txtDrafter.Text = l_objReceiveBase.DrafterID;

                //发起日期
                this.txtDraftDate.Text = l_objReceiveBase.DraftDate.ToString();

                //公司领导
                this.ddlLeadShip.SelectedValue = l_objReceiveBase.LeaderShip;

                //公司批示意见
                this.txtLeadCommentView.Text = l_objReceiveBase.LS_Comment;
                if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION)
                {
                    this.txtLeadCommentEdit.Text = l_objReceiveBase.LS_Comment;
                }

                switch (base.StepName)
                {
                case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR:
                    //获取处室下属科室
                    OADept.GetChildDept(this.ddlUnderTakeSection, l_objReceiveBase.UnderTakeDept, 2);

                    //获取处室下属人员
                    OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeDept, -1);
                    break;

                case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF:
                    //获取科室下属人员
                    OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeChief, -1);
                    break;

                case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER:
                    break;
                }

                //承办部门
                this.txtUnderTakeDeptID.Text   = l_objReceiveBase.UnderTakeDept;
                this.txtUnderTakeDeptName.Text = l_objReceiveBase.UnderTakeDeptName;

                //承办科室
                this.ddlUnderTakeSection.SelectedValue = l_objReceiveBase.UnderTakeChief;

                //承办人员
                this.ddlUnderTakePeople.SelectedValue = l_objReceiveBase.UnderTakePeople;

                //承办意见
                this.txtUnderTakeCommentEdit.Text = l_objReceiveBase.UnderTake_Comment;
                this.txtCirculatePeopleName.Text  = l_objReceiveBase.CPeopleName;
                this.txtCirculatePeopleID.Text    = l_objReceiveBase.CPeopleID;
                this.txtCirculateDeptName.Text    = l_objReceiveBase.CDeptName;
                this.txtCirculateDeptID.Text      = l_objReceiveBase.CDeptID;

                //党群工作处处长处理后显示label形式的处长姓名与时间
                if (l_objReceiveBase.DraftDate == DateTime.MinValue)
                {
                    this.ddlPoliticalOfficer.Visible = false;
                    this.lbParty.Visible             = true;
                    this.lbParty.Text = l_objReceiveBase.Officer + strNewLine + l_objReceiveBase.Officer_Date;
                }

                //领导;批示处理后显示label形式的领导人姓名与时间
                if (l_objReceiveBase.LS_Date != "" && l_objReceiveBase.LS_Date != null)
                {
                    this.ddlLeadShip.Visible = false;
                    this.lbLeadShip.Visible  = true;
                    this.lbLeadShip.Text     = l_objReceiveBase.LeaderShipName + strNewLine + l_objReceiveBase.LS_Date;
                }

                //提示信息
                this.txtPrompt.Text = l_objReceiveBase.Prompt;
                if (l_objReceiveBase.IsFormSave)
                {
                    this.txtPromptEdit.Text = l_objReceiveBase.PromptEdit;
                }
            }
        }
        private void LoadRegisterList()
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            //if (String.IsNullOrEmpty(SubTemplateName))
            //{
            //    return;
            //}

            l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ProcessName = SubTemplateName;

            //收文号-从
            l_BusReceiveEdit.ReceiveNoFrom = FormsMethod.Filter(txtQueryDocNoFrom.Text.TrimEnd());

            //收文号-到
            l_BusReceiveEdit.ReceiveNoTo = FormsMethod.Filter(txtQueryDocNoTo.Text.TrimEnd());

            //文件标题
            l_BusReceiveEdit.DocumentTitle = FormsMethod.Filter(txtQueryDocTitle.Text.TrimEnd());

            //收文日期-从
            l_BusReceiveEdit.ReceiveDateFrom = txtQueryRecDateFrom.ValDate;

            //收文日期-到
            l_BusReceiveEdit.ReceiveDateTo = txtQueryRecDateTo.ValDate;

            //来文单位
            l_BusReceiveEdit.ReceiveUnit =FormsMethod.Filter(txtQueryRecUnit.Text.TrimEnd());

            //收文年份
            l_BusReceiveEdit.ReceiveYear = ddlQueryRecYear.Text.TrimEnd();

            //状态
            if (ddlQueryStatus.SelectedItem != null)
            {
                l_BusReceiveEdit.Status = ddlQueryStatus.SelectedItem.Text;
            }

            l_BusReceiveEdit.Start = gvRegisterList.PageIndex * gvRegisterList.PageSize;
            l_BusReceiveEdit.End = gvRegisterList.PageIndex * gvRegisterList.PageSize + gvRegisterList.PageSize;
            l_BusReceiveEdit.Sort = SortExpression;

            this.gvRegisterList.DataSource = l_BusReceiveEdit.QueryRegisterInfo(l_BusReceiveEdit);
            this.gvRegisterList.RecordCount = l_BusReceiveEdit.RowCount;
            this.gvRegisterList.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;
            B_Circulate l_BusCirculate = null;
            DataTable l_dtbCirculate = null;
            DataTable l_dtbProcessSteps = null;
            String l_strRegisterID = null;

            M_ReceiveBase 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_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(l_strRegisterID);

                if (l_BusReceiveEdit == null)
                {
                    JScript.Alert("当前的ID或者无效,或者已经被删除!");
                    return;
                }

                this.ucAttachment.UCTemplateName = l_BusReceiveEdit.ProcessName;

                PopulateReceiveField(l_BusReceiveEdit);

                if (String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID))
                {
                    divPrompt.Visible = true;
                    return;
                }
                WFBaseProcessInstance fp = null;
                fp = WFFactory.GetWF(WFType.AgilePoint).GetAPI().GetProcInst(l_BusReceiveEdit.ProcessID);
                //l_objProcessInstance = AgilePointWF.GetAPI().GetProcInst();

                if (fp != null)
                {
                    ProcessTemplate = fp.DefName;

                    String l_strCirculateTableName = FS.ADIM.OA.BLL.Common.TableName.GetCirculateTableName(fp.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();
                    string strTableName = TableName.WorkItemsTableName.T_OA_GS_WorkItems;
                    switch (fp.DefName)
                    {
                        case ProcessConstString.TemplateName.COMPANY_RECEIVE:
                            l_objWorkItem = new B_GS_WorkItems();
                            strTableName = TableName.WorkItemsTableName.T_OA_GS_WorkItems;
                            break;
                        default:
                            strTableName = TableName.WorkItemsTableName.T_OA_MS_WorkItems;
                            l_objWorkItem = new B_MergeReceiveBase();
                            break;
                    }
                    strTableName+=((fp.Status == ProcessConstString.ProcessStatus.STATUS_COMPLETED || fp.Status == ProcessConstString.ProcessStatus.STATUS_CANCELED)?"_BAK":"");
                    l_dtbProcessSteps = l_objWorkItem.GetStepsByProcessID(l_BusReceiveEdit.ProcessID, strTableName, l_objWorkItem);

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

                    rptProcessDetail.DataSource = l_dtvDataView;
                    rptProcessDetail.DataBind();
                }
            }
        }
        /// <summary>
        /// Populated the edit field with the Entity
        /// </summary>
        /// <param name="p_BusReceiveEdit"></param>
        private void PopulateReceiveField(B_ReceiveEdit p_BusReceiveEdit)
        {
            //单位
            txtReceiveUnit.Text = p_BusReceiveEdit.ReceiveUnit;

            //年份
            txtReceiveYear.Text = p_BusReceiveEdit.ReceiveYear;

            //收文号
            txtReceiveNo.Text = p_BusReceiveEdit.ReceiveNo;

            //收文日期
            txtReceiveDate.Text = p_BusReceiveEdit.ReceiveDate.ToString("yyyy-MM-dd");

            //行文号
            txtSendNo.Text = p_BusReceiveEdit.SendLetterNo;

            //行文日期
            txtSendDate.Text = p_BusReceiveEdit.SendLetterDate.ToString("yyyy-MM-dd");

            //文件标题
            txtDocumentTitle.Text = p_BusReceiveEdit.DocumentTitle;

            //主题词
            txtKeyWord.Text = p_BusReceiveEdit.SubjectWord;

            //正文页数
            if (p_BusReceiveEdit.PageCount == int.MinValue)
            {
                txtPageCount.Text = String.Empty;
            }
            else
            {
                txtPageCount.Text = p_BusReceiveEdit.PageCount.ToString();
            }

            //份数
            if (p_BusReceiveEdit.ShareCount == int.MinValue)
            {
                txtShareCount.Text = String.Empty;
            }
            else
            {
                txtShareCount.Text = p_BusReceiveEdit.ShareCount.ToString();
            }

            //附件/页数
            if (p_BusReceiveEdit.AttachmentCount == int.MinValue)
            {
                txtAttchCount.Text = String.Empty;
            }
            else
            {
                txtAttchCount.Text = p_BusReceiveEdit.AttachmentCount.ToString();
            }

            //保管期限
            txtKeepTime.Text = p_BusReceiveEdit.KeepTime.ToString();

            //密级
            txtSecretLevel.Text = p_BusReceiveEdit.SecretLevel;

            //紧急程度
            txtUrgentDegree.Text = p_BusReceiveEdit.UrgentDegree;

            //来文单位
            txtSendUnit.Text = p_BusReceiveEdit.SendLetterUnit;

            //预立卷号
            txtPreVolumnNo.Text = p_BusReceiveEdit.PreVolumeNo;

            //备注
            txtRemark.Text = p_BusReceiveEdit.Remarks;

            //归档状态
            txtArchiveStatus.Text = p_BusReceiveEdit.ArchiveStatus;

            //是否直接归档
            chkIsArchive.Checked = p_BusReceiveEdit.Is_Archive == "1" ? true : false;

            //附件信息
            this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml<List<CFuJian>>(p_BusReceiveEdit.FileData);
        }
Beispiel #25
0
        /// <summary>
        /// 用表单元素内容填充实体内容
        /// </summary>
        /// <param name="l_BusReceiveEdit"></param>
        private void PopulateEntity(B_ReceiveEdit l_BusReceiveEdit)
        {
            //单位
            l_BusReceiveEdit.ReceiveUnit = txtReceiveUnit.Text.TrimEnd();

            //年份
            l_BusReceiveEdit.ReceiveYear = ddlReceiveYear.Text.TrimEnd();

            //收文日期
            l_BusReceiveEdit.ReceiveDate = txtReceiveDate.ValDate;

            //行文号
            l_BusReceiveEdit.SendLetterNo = txtSendNo.Text.TrimEnd();

            //行文日期
            l_BusReceiveEdit.SendLetterDate = txtSendDate.ValDate;

            //文件标题
            l_BusReceiveEdit.DocumentTitle = txtDocumentTitle.Text.TrimEnd();

            //主题词
            l_BusReceiveEdit.SubjectWord = txtKeyWord.Text.TrimEnd();

            //正文页数
            if (ValidateUtility.IsInt(txtPageCount.Text.TrimEnd()))
            {
                l_BusReceiveEdit.PageCount = Convert.ToInt32(txtPageCount.Text.TrimEnd());
            }

            //份数
            if (ValidateUtility.IsInt(txtShareCount.Text.TrimEnd()))
            {
                l_BusReceiveEdit.ShareCount = Convert.ToInt32(txtShareCount.Text.TrimEnd());
            }

            //附件/页数
            if (ValidateUtility.IsInt(txtAttchCount.Text.TrimEnd()))
            {
                l_BusReceiveEdit.AttachmentCount = Convert.ToInt32(txtAttchCount.Text.TrimEnd());
            }

            //保管期限
            l_BusReceiveEdit.KeepTime = ddlKeepTime.Text.TrimEnd();

            //密级
            l_BusReceiveEdit.SecretLevel = ddlSecretLevel.Text.TrimEnd();

            //紧急程度
            l_BusReceiveEdit.UrgentDegree = ddlUrgentDegree.Text.TrimEnd();

            //预立卷号
            l_BusReceiveEdit.PreVolumeNo = txtPreVolumnNo.Text.TrimEnd();

            //备注
            l_BusReceiveEdit.Remarks = txtRemark.Text.TrimEnd();

            //流程名称
            l_BusReceiveEdit.ProcessName = SubTemplateName;

            //是否直接归档
            l_BusReceiveEdit.Is_Archive = chkIsArchive.Checked ? "1" : "0";

            //附件信息
            l_BusReceiveEdit.FileData = XmlUtility.SerializeXml(this.ucFileList.UCDataList);
        }
        /// <summary>
        /// 用实体中的内容填充表单上编辑区域的内容
        /// </summary>
        /// <param name="p_BusReceiveEdit"></param>
        private void PopulateEditField(B_ReceiveEdit p_BusReceiveEdit)
        {
            if (p_BusReceiveEdit.ProcessName != ProcessConstString.TemplateName.COMPANY_RECEIVE)
            {
                this.ddlProcessTemplate.SelectedValue = p_BusReceiveEdit.ProcessName;
            }
            this.SubTemplateName = p_BusReceiveEdit.ProcessName;
            //单位
            txtReceiveUnit.Text = p_BusReceiveEdit.ReceiveUnit;

            //收文年份
            ddlReceiveYear.Text = p_BusReceiveEdit.ReceiveYear;

            //收文号
            txtDocumentNo.Text = p_BusReceiveEdit.ReceiveNo;

            //收文日期
            txtReceiveDate.Text = p_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal);

            //行文号
            txtSendNo.Text = p_BusReceiveEdit.SendLetterNo;

            //行文日期
            txtSendDate.Text = p_BusReceiveEdit.SendLetterDate.ToString(ConstString.DateFormat.Normal);

            //文件标题
            txtDocumentTitle.Text = p_BusReceiveEdit.DocumentTitle;

            //主题词
            txtKeyWord.Text = p_BusReceiveEdit.SubjectWord;

            //正文页数
            if (p_BusReceiveEdit.PageCount == int.MinValue)
            {
                txtPageCount.Text = String.Empty;
            }
            else
            {
                txtPageCount.Text = p_BusReceiveEdit.PageCount.ToString();
            }

            //份数
            if (p_BusReceiveEdit.ShareCount == int.MinValue)
            {
                txtShareCount.Text = String.Empty;
            }
            else
            {
                txtShareCount.Text = p_BusReceiveEdit.ShareCount.ToString();
            }

            //附件/页数
            if (p_BusReceiveEdit.AttachmentCount == int.MinValue)
            {
                txtAttchCount.Text = String.Empty;
            }
            else
            {
                txtAttchCount.Text = p_BusReceiveEdit.AttachmentCount.ToString();
            }

            //保管期限
            ddlKeepTime.Text = p_BusReceiveEdit.KeepTime;

            //密级
            ddlSecretLevel.Text = p_BusReceiveEdit.SecretLevel;

            //紧急程度
            ddlUrgentDegree.Text = p_BusReceiveEdit.UrgentDegree;

            //预立卷号
            txtPreVolumnNo.Text = p_BusReceiveEdit.PreVolumeNo;

            //备注
            txtRemark.Text = p_BusReceiveEdit.Remarks;

            //归档状态
            txtArchiveStatus.Text = p_BusReceiveEdit.ArchiveStatus;

            //是否直接归档
            chkIsArchive.Checked = p_BusReceiveEdit.Is_Archive == "1" ? true : false;

            if (p_BusReceiveEdit.ArchiveStatus == "已归档" || !String.IsNullOrEmpty(p_BusReceiveEdit.ProcessID))
            {
                btnLaunch.Enabled = false;
                chkIsArchive.Enabled = false;
                this.btnDetail.Enabled = true;
            }
            else
            {
                btnLaunch.Enabled = true;
                chkIsArchive.Enabled = true;
                this.btnDetail.Enabled = false;
            }

            //附件信息
            this.ucFileList.UCDataList = XmlUtility.DeSerializeXml<List<CFuJian>>(p_BusReceiveEdit.FileData);

            txtRegisterID.Text = p_BusReceiveEdit.ID.ToString();
        }
Beispiel #27
0
        /// <summary>
        /// 用实体中的内容填充表单上编辑区域的内容
        /// </summary>
        /// <param name="p_BusReceiveEdit"></param>
        private void PopulateEditField(B_ReceiveEdit p_BusReceiveEdit)
        {
            if (p_BusReceiveEdit.ProcessName != ProcessConstString.TemplateName.COMPANY_RECEIVE)
            {
                this.ddlProcessTemplate.SelectedValue = p_BusReceiveEdit.ProcessName;
            }
            this.SubTemplateName = p_BusReceiveEdit.ProcessName;
            //单位
            txtReceiveUnit.Text = p_BusReceiveEdit.ReceiveUnit;

            //收文年份
            ddlReceiveYear.Text = p_BusReceiveEdit.ReceiveYear;

            //收文号
            txtDocumentNo.Text = p_BusReceiveEdit.ReceiveNo;

            //收文日期
            txtReceiveDate.Text = p_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal);

            //行文号
            txtSendNo.Text = p_BusReceiveEdit.SendLetterNo;

            //行文日期
            txtSendDate.Text = p_BusReceiveEdit.SendLetterDate.ToString(ConstString.DateFormat.Normal);

            //文件标题
            txtDocumentTitle.Text = p_BusReceiveEdit.DocumentTitle;

            //主题词
            txtKeyWord.Text = p_BusReceiveEdit.SubjectWord;

            //正文页数
            if (p_BusReceiveEdit.PageCount == int.MinValue)
            {
                txtPageCount.Text = String.Empty;
            }
            else
            {
                txtPageCount.Text = p_BusReceiveEdit.PageCount.ToString();
            }

            //份数
            if (p_BusReceiveEdit.ShareCount == int.MinValue)
            {
                txtShareCount.Text = String.Empty;
            }
            else
            {
                txtShareCount.Text = p_BusReceiveEdit.ShareCount.ToString();
            }

            //附件/页数
            if (p_BusReceiveEdit.AttachmentCount == int.MinValue)
            {
                txtAttchCount.Text = String.Empty;
            }
            else
            {
                txtAttchCount.Text = p_BusReceiveEdit.AttachmentCount.ToString();
            }

            //保管期限
            ddlKeepTime.Text = p_BusReceiveEdit.KeepTime;

            //密级
            ddlSecretLevel.Text = p_BusReceiveEdit.SecretLevel;

            //紧急程度
            ddlUrgentDegree.Text = p_BusReceiveEdit.UrgentDegree;

            //预立卷号
            txtPreVolumnNo.Text = p_BusReceiveEdit.PreVolumeNo;

            //备注
            txtRemark.Text = p_BusReceiveEdit.Remarks;

            //归档状态
            txtArchiveStatus.Text = p_BusReceiveEdit.ArchiveStatus;

            //是否直接归档
            chkIsArchive.Checked = p_BusReceiveEdit.Is_Archive == "1" ? true : false;

            if (p_BusReceiveEdit.ArchiveStatus == "已归档" || !String.IsNullOrEmpty(p_BusReceiveEdit.ProcessID))
            {
                btnLaunch.Enabled      = false;
                chkIsArchive.Enabled   = false;
                this.btnDetail.Enabled = true;
            }
            else
            {
                btnLaunch.Enabled      = true;
                chkIsArchive.Enabled   = true;
                this.btnDetail.Enabled = false;
            }

            //附件信息
            this.ucFileList.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(p_BusReceiveEdit.FileData);

            txtRegisterID.Text = p_BusReceiveEdit.ID.ToString();
        }
Beispiel #28
0
        private string Devolve2DC(HN_OA2DC oaDev)
        {
            string sXml = "";

            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));

            #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;
            }


            // 编制单位-单位
            ar.FormationDept = l_BusReceiveEdit.CommunicationUnit;
            // 题名-文件标题
            ar.Title = l_BusReceiveEdit.DocumentTitle;
            // 收文号-收文号
            ar.ReceiveCode = l_BusReceiveEdit.DocumentNo;
            // 通讯渠道号-文件编码
            ar.CommunicationChannelCode = l_BusReceiveEdit.FileEncoding;
            // 纸质文件接收日期-收文日期
            ar.PaperDocumentTransceiverTime = this.ucPrint.CheckDateTime(l_BusReceiveEdit.ReceiptDate.ToString());
            // 批准日期-形成日期
            ar.AuthorizeTime = this.ucPrint.CheckDateTime(l_BusReceiveEdit.FormationDate.ToString());
            // 缓急程度-紧急程度
            ar.Pace = l_BusReceiveEdit.UrgentDegree;
            // 页数-页数
            ar.DocPages = l_BusReceiveEdit.Pages.ToString();
            // 拟办人-拟办人
            ar.Proposer = txtPlotMember.Text;
            // 拟办日期-拟办日期
            ar.ProposeDate = txtPlotTime.Text;
            // 批示人-公司领导
            ar.Instructioner = txtLeadShipName.Text;
            // 批示日期-批示日期
            ar.InstructionDate = txtLeadShipTime.Text;
            // 承办部门-承办部门
            ar.UndertakeDepartment = txtUnderTake.Text;
            // 登记时间
            ar.ImporterTime = DateTime.Now.ToString();

            // 公共常量
            //ar.GatherLevel = "件";
            //ar.D_StorageCarrierType = "纸质";
            //ar.Amount = "1";
            //ar.D_Language = "中文";
            ar.ElectronicDocumentCount = 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 < l_BusReceiveEdit.FileList.Count; i++)
            {
                HNDC_CAttachmentNode at = new HNDC_CAttachmentNode();
                CFuJian file            = l_BusReceiveEdit.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);
        }
Beispiel #29
0
        private string Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID)
        {
            string         sXml    = "";
            B_GS_WorkItems entity  = this.ControlToEntity(false) as B_GS_WorkItems;
            B_ReceiveEdit  cEntity = new B_ReceiveEdit();

            cEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, entity.DocumentNo));
            #region ArchiveNode
            FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode();
            ar.System  = "OA_" + base.IdentityID.ToString();
            ar.FK_DPID = sDPID;

            ar.Title       = entity.DocumentTitle;
            ar.ReceiveCode = entity.DocumentNo;
            ar.Code        = entity.SendNo;
            ar.PaperDocumentTransceiverTime = entity.DocumentReceiveDate.ToShortDateString();
            ar.DocCode       = entity.VolumeNo;
            ar.Proposer      = entity.OfficerName;
            ar.Instructioner = entity.LeaderShipName;

            ar.FormationDept    = cEntity.ReceiveUnit;
            ar.D_DocStorageLife = cEntity.KeepTime;
            ar.ThemeWord        = cEntity.SubjectWord;
            ar.DocPages         = cEntity.PageCount.ToString();
            ar.ReceiveCode      = cEntity.ReceiveNo;

            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);
        }
        /// <summary>
        /// 新增按钮处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;

            //表单的合法性验证
            if (!VerifyEditField())
            {
                JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            //行文号是否重复
            if (B_ReceiveEdit.IsHaveSendNo(this.txtSendNo.Text.TrimEnd()))//任金权增加
            {
                JScript.ShowMsgBox(this.Page, "行文号重复", false);
                this.txtSendNo.Focus();
                return;
            }

            l_BusReceiveEdit = new B_ReceiveEdit();

            PopulateEntity(l_BusReceiveEdit);

            //l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName);
            ////////////////////////////////////////////////////20110124 扬子江
            if (!(TemplateName.Equals("党纪工团收文")))
            {
                l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName);
            }
            else
            {
                this.SubTemplateName = ddlProcessTemplate.SelectedValue;
                if (this.SubTemplateName == "工会收文")
                {
                    l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("H" + DateTime.Now.Year.ToString(), this.SubTemplateName);
                }
                if (this.SubTemplateName == "团委收文")
                {
                    l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("T" + DateTime.Now.Year.ToString(), this.SubTemplateName);
                }
                if (this.SubTemplateName == "党委纪委收文")
                {
                    l_BusReceiveEdit.ReceiveNo = B_ReceiveID.GenerateDJGTReceiveNo("D" + DateTime.Now.Year.ToString(), this.SubTemplateName);
                }
            }

            //归档状态
            if (chkIsArchive.Checked)
            {
                l_BusReceiveEdit.ArchiveStatus = "已归档";
            }
            else
            {
                l_BusReceiveEdit.ArchiveStatus = "未完成";
            }

            if (l_BusReceiveEdit.Save())
            {
                JScript.ShowMsgBox(this.Page, "新增成功", false);
                PopulateEditField(l_BusReceiveEdit);
                btnQuery_Click(null, null);
            }
        }
Beispiel #31
0
        private string Devolve2DC(HN_OA2DC oaDev)
        {
            string sXml = "";

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

            B_GS_WorkItems entity = this.ControlToEntity(false) as B_GS_WorkItems;

            entity.FormsData = XmlUtility.SerializeXml(entity);
            B_ReceiveEdit pEntity = new B_ReceiveEdit();

            pEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text));

            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;
                string value = oaDev.PreHandel(entity, sName, sType);
                if (string.IsNullOrEmpty(value))
                {
                    value = oaDev.PreHandel(pEntity, sName, 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);
        }
        /// <summary>
        /// Populated the edit field with the Entity
        /// </summary>
        /// <param name="p_BusReceiveEdit"></param>
        private void PopulateReceiveField(B_ReceiveEdit p_BusReceiveEdit)
        {
            //单位
            txtReceiveUnit.Text = p_BusReceiveEdit.ReceiveUnit;

            //年份
            txtReceiveYear.Text = p_BusReceiveEdit.ReceiveYear;

            //收文号
            txtReceiveNo.Text = p_BusReceiveEdit.ReceiveNo;

            //收文日期
            txtReceiveDate.Text = p_BusReceiveEdit.ReceiveDate.ToString("yyyy-MM-dd");

            //行文号
            txtSendNo.Text = p_BusReceiveEdit.SendLetterNo;

            //行文日期
            txtSendDate.Text = p_BusReceiveEdit.SendLetterDate.ToString("yyyy-MM-dd");

            //文件标题
            txtDocumentTitle.Text = p_BusReceiveEdit.DocumentTitle;

            //主题词
            txtKeyWord.Text = p_BusReceiveEdit.SubjectWord;

            //正文页数
            if (p_BusReceiveEdit.PageCount == int.MinValue)
            {
                txtPageCount.Text = String.Empty;
            }
            else
            {
                txtPageCount.Text = p_BusReceiveEdit.PageCount.ToString();
            }

            //份数
            if (p_BusReceiveEdit.ShareCount == int.MinValue)
            {
                txtShareCount.Text = String.Empty;
            }
            else
            {
                txtShareCount.Text = p_BusReceiveEdit.ShareCount.ToString();
            }

            //附件/页数
            if (p_BusReceiveEdit.AttachmentCount == int.MinValue)
            {
                txtAttchCount.Text = String.Empty;
            }
            else
            {
                txtAttchCount.Text = p_BusReceiveEdit.AttachmentCount.ToString();
            }

            //保管期限
            txtKeepTime.Text = p_BusReceiveEdit.KeepTime.ToString();

            //密级
            txtSecretLevel.Text = p_BusReceiveEdit.SecretLevel;

            //紧急程度
            txtUrgentDegree.Text = p_BusReceiveEdit.UrgentDegree;

            //来文单位
            txtSendUnit.Text = p_BusReceiveEdit.SendLetterUnit;

            //预立卷号
            txtPreVolumnNo.Text = p_BusReceiveEdit.PreVolumeNo;

            //备注
            txtRemark.Text = p_BusReceiveEdit.Remarks;

            //归档状态
            txtArchiveStatus.Text = p_BusReceiveEdit.ArchiveStatus;

            //是否直接归档
            chkIsArchive.Checked = p_BusReceiveEdit.Is_Archive == "1" ? true : false;

            //附件信息
            this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(p_BusReceiveEdit.FileData);
        }
Beispiel #33
0
        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_GS_WorkItems entity = this.ControlToEntity(false) as B_GS_WorkItems;

            entity.FormsData = XmlUtility.SerializeXml(entity);
            B_ReceiveEdit RecvEditEntity = new B_ReceiveEdit();

            RecvEditEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, this.txtReceiveNo.Text));

            //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;
                string value = hn_oa2dp.PreHandel(entity, sName, sType);
                if (string.IsNullOrEmpty(value))
                {
                    value = hn_oa2dp.PreHandel(RecvEditEntity, sName, sType);
                }
                ar.SetAttribute(skey, value /*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);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit  = null;
            B_Circulate   l_BusCirculate    = null;
            DataTable     l_dtbCirculate    = null;
            DataTable     l_dtbProcessSteps = null;
            String        l_strRegisterID   = null;

            M_ReceiveBase 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_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(l_strRegisterID);

                if (l_BusReceiveEdit == null)
                {
                    JScript.Alert("当前的ID或者无效,或者已经被删除!");
                    return;
                }

                this.ucAttachment.UCTemplateName = l_BusReceiveEdit.ProcessName;

                PopulateReceiveField(l_BusReceiveEdit);

                if (String.IsNullOrEmpty(l_BusReceiveEdit.ProcessID))
                {
                    divPrompt.Visible = true;
                    return;
                }
                WFBaseProcessInstance fp = null;
                fp = WFFactory.GetWF(WFType.AgilePoint).GetAPI().GetProcInst(l_BusReceiveEdit.ProcessID);
                //l_objProcessInstance = AgilePointWF.GetAPI().GetProcInst();

                if (fp != null)
                {
                    ProcessTemplate = fp.DefName;

                    String l_strCirculateTableName = FS.ADIM.OA.BLL.Common.TableName.GetCirculateTableName(fp.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();
                    string strTableName = TableName.WorkItemsTableName.T_OA_GS_WorkItems;
                    switch (fp.DefName)
                    {
                    case ProcessConstString.TemplateName.COMPANY_RECEIVE:
                        l_objWorkItem = new B_GS_WorkItems();
                        strTableName  = TableName.WorkItemsTableName.T_OA_GS_WorkItems;
                        break;

                    default:
                        strTableName  = TableName.WorkItemsTableName.T_OA_MS_WorkItems;
                        l_objWorkItem = new B_MergeReceiveBase();
                        break;
                    }
                    strTableName     += ((fp.Status == ProcessConstString.ProcessStatus.STATUS_COMPLETED || fp.Status == ProcessConstString.ProcessStatus.STATUS_CANCELED)?"_BAK":"");
                    l_dtbProcessSteps = l_objWorkItem.GetStepsByProcessID(l_BusReceiveEdit.ProcessID, strTableName, l_objWorkItem);

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

                    rptProcessDetail.DataSource = l_dtvDataView;
                    rptProcessDetail.DataBind();
                }
            }
        }
        private string Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp, string sDPID)
        {
            string sXml = "";
            B_MergeReceiveBase entity = this.ControlToEntity(false) as B_MergeReceiveBase;
            B_ReceiveEdit cEntity = new B_ReceiveEdit();
            cEntity.ID = Convert.ToInt32(B_ReceiveEdit.GetID(base.TemplateName, entity.DocumentNo));
            #region ArchiveNode
            FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode();
            ar.System = "OA_" + base.IdentityID.ToString();
            ar.FK_DPID = sDPID;

            ar.Title = entity.DocumentTitle;
            ar.ReceiveCode = entity.DocumentNo;
            ar.Code = entity.SendNo;
            ar.PaperDocumentTransceiverTime = entity.DocumentReceiveDate.ToShortDateString();
            ar.DocCode = entity.VolumeNo;
            ar.Proposer = entity.OfficerName;
            ar.Instructioner = entity.LeaderShipName;

            ar.FormationDept = cEntity.ReceiveUnit;
            ar.D_DocStorageLife = cEntity.KeepTime;
            ar.ThemeWord = cEntity.SubjectWord;
            ar.DocPages = cEntity.PageCount.ToString();
            ar.ReceiveCode = cEntity.ReceiveNo;

            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 = base.TemplateName;
                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;
        }
        protected void btnSumitInspect_Click(object sender, EventArgs e)
        {
            B_ReceiveEdit l_BusReceiveEdit = null;
            String l_strInspector = String.Empty;

            if (String.IsNullOrEmpty(ddlPoliticalOfficer.SelectedValue))
            {
                JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择党群工作处处长");
                return;
            }
            l_strInspector = ddlPoliticalOfficer.SelectedValue;

            //表单的合法性验证
            if (!VerifyField())
            {
                JScript.ShowMsgBox(Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            //提交动作
            this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_INSPECT;

            if (String.IsNullOrEmpty(WorkItemID))
            {
                //流程创建时候设置自定义属性
                l_htAttribute.Add(ConstString.CustomAttr.Receive.Initiator, CurrentUserInfo.UserName);

                l_BusReceiveEdit = new B_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID);

                if (l_BusReceiveEdit != null)
                {
                    l_BusReceiveEdit.ProcessID = base.ProcessID;
                    l_BusReceiveEdit.Save();
                }
            }

            ViewBase l_objClerks = OAUser.GetUserByRole(OUConstString.RoleName.PartysDocument);
            String l_strClerkField = String.Empty;
            foreach (User user in l_objClerks.Ens)
            {
                l_strClerkField += user.DomainUserID + ";";
            }
            l_strClerkField = SysString.TrimLastWord(l_strClerkField);

            l_htAttribute.Add(ConstString.CustomAttr.Receive.Officer, l_strInspector);
            l_htAttribute.Add(ConstString.CustomAttr.Receive.Clerks, l_strClerkField);

            base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false));
        }
        /// <summary>
        /// 实体填充控件
        /// </summary>
        protected override void EntityToControl()
        {
            B_MergeReceiveBase l_objReceiveBase = null;

            //收文登记号
            this.RegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID];

            if (!String.IsNullOrEmpty(this.RegisterID))
            {
                B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID);
                if (l_BusReceiveEdit == null)
                {
                    JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "当前选择的收文登记信息不存在或者已经被删除,无法继续操作", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle");
                    return;
                }

                //附件列表
                this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml<List<CFuJian>>(l_BusReceiveEdit.FileData);

                //收文号
                this.txtReceiveNo.Text = l_BusReceiveEdit.ReceiveNo;

                //收文日期
                this.txtReceiveDate.Text = l_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal);

                //原文号
                this.txtSendLetterNo.Text = l_BusReceiveEdit.SendLetterNo;

                //来文单位
                this.txtCommunicationUnit.Text = l_BusReceiveEdit.ReceiveUnit;

                //卷号
                this.txtPreVolumeNo.Text = l_BusReceiveEdit.PreVolumeNo;

                //文件名称
                this.txtDocumentTitle.Text = l_BusReceiveEdit.DocumentTitle;

                //紧急程度
                this.txtUrgentDegree.Text = l_BusReceiveEdit.UrgentDegree;

                //步骤名称
                base.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL;

                this.SubTemplateName = l_BusReceiveEdit.ProcessName;

                //党群工作处处长
                OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR);
            }
            else
            {
                l_objReceiveBase = base.EntityData as B_MergeReceiveBase;

                this.SubTemplateName = l_objReceiveBase.TemplateName;

                this.RegisterID = l_objReceiveBase.RegisterID;

                //党群工作处处长
                OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR);

                ddlPoliticalOfficer.SelectedValue = l_objReceiveBase.Officer;
                txtPoliticalOfficerComment.Text = l_objReceiveBase.Officer_Comment;

                //附件列表
                this.ucAttachment.UCDataList = l_objReceiveBase.FileList;

                //收文号
                this.txtReceiveNo.Text = l_objReceiveBase.DocumentNo;

                //收文日期
                this.txtReceiveDate.Text = l_objReceiveBase.DocumentReceiveDate.ToString(ConstString.DateFormat.Normal);

                //原文号
                this.txtSendLetterNo.Text = l_objReceiveBase.SendNo;

                //来文单位
                this.txtCommunicationUnit.Text = l_objReceiveBase.CommunicationUnit;

                //卷号
                this.txtPreVolumeNo.Text = l_objReceiveBase.VolumeNo;

                //文件名称
                this.txtDocumentTitle.Text = l_objReceiveBase.DocumentTitle;

                //紧急程度
                this.txtUrgentDegree.Text = l_objReceiveBase.UrgentDegree;

                //发起人ID
                this.txtDrafter.Text = l_objReceiveBase.DrafterID;

                //发起日期
                this.txtDraftDate.Text = l_objReceiveBase.DraftDate.ToString();

                //公司领导
                this.ddlLeadShip.SelectedValue = l_objReceiveBase.LeaderShip;

                //公司批示意见
                this.txtLeadCommentView.Text = l_objReceiveBase.LS_Comment;
                if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION)
                {
                    this.txtLeadCommentEdit.Text = l_objReceiveBase.LS_Comment;
                }

                switch (base.StepName)
                {
                    case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR:
                        //获取处室下属科室
                        OADept.GetChildDept(this.ddlUnderTakeSection, l_objReceiveBase.UnderTakeDept, 2);

                        //获取处室下属人员
                        OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeDept, -1);
                        break;
                    case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF:
                        //获取科室下属人员
                        OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeChief, -1);
                        break;
                    case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER:
                        break;
                }

                //承办部门
                this.txtUnderTakeDeptID.Text = l_objReceiveBase.UnderTakeDept;
                this.txtUnderTakeDeptName.Text = l_objReceiveBase.UnderTakeDeptName;

                //承办科室
                this.ddlUnderTakeSection.SelectedValue = l_objReceiveBase.UnderTakeChief;

                //承办人员
                this.ddlUnderTakePeople.SelectedValue = l_objReceiveBase.UnderTakePeople;

                //承办意见
                this.txtUnderTakeCommentEdit.Text = l_objReceiveBase.UnderTake_Comment;
                this.txtCirculatePeopleName.Text = l_objReceiveBase.CPeopleName;
                this.txtCirculatePeopleID.Text = l_objReceiveBase.CPeopleID;
                this.txtCirculateDeptName.Text = l_objReceiveBase.CDeptName;
                this.txtCirculateDeptID.Text = l_objReceiveBase.CDeptID;

                //党群工作处处长处理后显示label形式的处长姓名与时间
                if (l_objReceiveBase.DraftDate == DateTime.MinValue)
                {
                    this.ddlPoliticalOfficer.Visible = false;
                    this.lbParty.Visible = true;
                    this.lbParty.Text = l_objReceiveBase.Officer + strNewLine + l_objReceiveBase.Officer_Date;
                }

                //领导;批示处理后显示label形式的领导人姓名与时间
                if (l_objReceiveBase.LS_Date != "" && l_objReceiveBase.LS_Date != null)
                {
                    this.ddlLeadShip.Visible = false;
                    this.lbLeadShip.Visible = true;
                    this.lbLeadShip.Text = l_objReceiveBase.LeaderShipName + strNewLine + l_objReceiveBase.LS_Date;
                }

                //提示信息
                this.txtPrompt.Text = l_objReceiveBase.Prompt;
                if (l_objReceiveBase.IsFormSave)
                {
                    this.txtPromptEdit.Text = l_objReceiveBase.PromptEdit;
                }
            }
        }
        public void RaiseCallbackEvent(string eventArgument)
        {
            B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();

            l_BusReceiveEdit.ID = Convert.ToInt32(eventArgument);

            //附件信息
            if (!String.IsNullOrEmpty(l_BusReceiveEdit.FileData))
            {
                List<CFuJian> l_objAttach = XmlUtility.DeSerializeXml<List<CFuJian>>(l_BusReceiveEdit.FileData);
                l_BusReceiveEdit.FileData = SysString.FuJianList2Xml(l_objAttach);
            }

            StringWriter l_strWriter = new StringWriter(CultureInfo.InvariantCulture);
            JsonSerializer jsonSerializer = new JsonSerializer();
            jsonSerializer.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
            using (JsonWriter jsonWriter = new JsonWriter(l_strWriter))
            {
                jsonSerializer.Serialize(jsonWriter, l_BusReceiveEdit);
            }

            Session["附件ListTemp"] = l_BusReceiveEdit.FileData;

            m_strCallBack = l_strWriter.ToString();
        }