Пример #1
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();
            }
        }
Пример #2
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);
            }
        }