/// <summary>
        /// 编辑区域元素验证
        /// </summary>
        /// <returns></returns>
        private bool VerifyEditField()
        {
            //收文日期
            if (txtReceiveDate.Text.TrimEnd() != String.Empty && !ValidateUtility.IsDateTime(txtReceiveDate.Text.TrimEnd()))
            {
                txtReceiveDate.Focus();
                return(false);
            }

            //行文日期
            if (txtXingWenDate.Text.TrimEnd() != String.Empty && !ValidateUtility.IsDateTime(txtXingWenDate.Text.TrimEnd()))
            {
                txtXingWenDate.Focus();
                return(false);
            }

            //形成日期
            if (txtFormationDate.Text.TrimEnd() != String.Empty && !ValidateUtility.IsDateTime(txtFormationDate.Text.TrimEnd()))
            {
                txtFormationDate.Focus();
                return(false);
            }

            //页数
            if (txtPageCount.Text.TrimEnd() != String.Empty && !ValidateUtility.IsInt(txtPageCount.Text.TrimEnd()))
            {
                txtPageCount.Focus();
                return(false);
            }

            return(true);
        }
示例#2
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);
        }
示例#3
0
        /// <summary>
        /// 编辑区域元素验证
        /// </summary>
        /// <returns></returns>
        private bool VerifyEditField()
        {
            Boolean l_blnIsValid = true;

            if (this.TemplateName == "党纪工团收文" && String.IsNullOrEmpty(ddlProcessTemplate.SelectedValue))
            {
                m_strAryMessages.Add("收文登记:必须选择流程类型");
                l_blnIsValid = false;
            }

            //文件标题
            if (String.IsNullOrEmpty(txtDocumentTitle.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:文件标题不能为空");
                txtDocumentTitle.Focus();
                l_blnIsValid = false;
            }
            if (txtDocumentTitle.Text.Contains("#") || txtDocumentTitle.Text.Contains("'"))
            {
                m_strAryMessages.Add("含有特殊字符,请替换后再上传");
                txtDocumentTitle.Focus();
                l_blnIsValid = false;
            }
            //来文单位
            if (String.IsNullOrEmpty(txtReceiveUnit.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:来文单位不能为空");
                l_blnIsValid = false;
            }
            //收文日期
            if (String.IsNullOrEmpty(txtReceiveDate.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:收文日期不能为空");
                l_blnIsValid = false;
            }
            else if (!ValidateUtility.IsDateTime(txtReceiveDate.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:收文日期格式不正确");
                l_blnIsValid = false;
            }
            //行文号
            if (String.IsNullOrEmpty(txtSendNo.Text.TrimEnd()) || txtSendNo.Text.TrimEnd() == "〔〕")
            {
                m_strAryMessages.Add("收文登记:行文号不能为空");
                l_blnIsValid = false;
            }
            else
            {
                //行文号格式验证
                if (txtSendNo.Text.IndexOf('〔') > txtSendNo.Text.IndexOf('〕') || txtSendNo.Text.IndexOf('〔') < 0)
                {
                    m_strAryMessages.Add("收文登记:行文号格式错误");
                    l_blnIsValid = false;
                }
            }
            //行文日期
            if (String.IsNullOrEmpty(txtSendDate.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:行文日期不能为空");
                l_blnIsValid = false;
            }
            else if (!ValidateUtility.IsDateTime(txtSendDate.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:行文日期格式不正确");
                l_blnIsValid = false;
            }
            //正文页数
            if (txtPageCount.Text.TrimEnd() != String.Empty && !ValidateUtility.IsInt(txtPageCount.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:正文页数格式不正确,须为正整数");
                l_blnIsValid = false;
            }
            //份数
            if (txtShareCount.Text.TrimEnd() != String.Empty && !ValidateUtility.IsInt(txtShareCount.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:份数格式不正确,须为正整数");
                l_blnIsValid = false;
            }
            //附件/页数
            if (txtAttchCount.Text.TrimEnd() != String.Empty && !ValidateUtility.IsInt(txtAttchCount.Text.TrimEnd()))
            {
                m_strAryMessages.Add("收文登记:附件/页数格式不正确,须为正整数");
                l_blnIsValid = false;
            }

            return(l_blnIsValid);
        }
        /// <summary>
        /// 用表单元素内容填充实体内容
        /// </summary>
        /// <param name="l_BusReceiveEdit"></param>
        private void PopulateEntity(B_HSEdit l_BusReceiveEdit)
        {
            //单位
            l_BusReceiveEdit.CommunicationUnit = txtReceiveUnit.Text.TrimEnd();

            //文件编码
            l_BusReceiveEdit.FileEncoding = txtDocumentEncoding.Text.TrimEnd();

            //收文日期
            if (ValidateUtility.IsDateTime(txtReceiveDate.Text.TrimEnd()))
            {
                l_BusReceiveEdit.ReceiptDate = Convert.ToDateTime(txtReceiveDate.Text.TrimEnd());
            }

            //答复文号
            l_BusReceiveEdit.ReplyDocumentNo = txtReplyDocumentNo.Text.TrimEnd();

            //其他编码
            l_BusReceiveEdit.OtherEncoding = txtOtherEncoding.Text.TrimEnd();

            //行文日期
            if (txtXingWenDate.Text == "" || !ValidateUtility.IsDateTime(txtXingWenDate.Text.TrimEnd()))
            {
                l_BusReceiveEdit.XingWenDate = DateTime.MinValue;
            }
            else
            {
                l_BusReceiveEdit.XingWenDate = Convert.ToDateTime(txtXingWenDate.Text.TrimEnd());
            }

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

            //函件类型
            l_BusReceiveEdit.LetterType = ddlDocumentType.Text;

            //形成日期
            if (ValidateUtility.IsDateTime(txtFormationDate.Text.TrimEnd()))
            {
                l_BusReceiveEdit.FormationDate = Convert.ToDateTime(txtFormationDate.Text.TrimEnd());
            }

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

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

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

            //对应合同号
            l_BusReceiveEdit.ContractNumber = txtContractNumber.Text.TrimEnd();

            //设备代码
            l_BusReceiveEdit.EquipmentCode = txtEquipmentCode.Text.TrimEnd();

            //HN编码
            l_BusReceiveEdit.HNCode = txtHNCode.Text.TrimEnd();

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

            ////附件信息
            l_BusReceiveEdit.FileData = XmlUtility.SerializeXml(this.ucAttachment.UCDataList);
            //备注
            l_BusReceiveEdit.Remarks = this.txtRemark.Text;//renjinquan+
        }