Ejemplo n.º 1
0
        public void Translate_OnClick(object sender, EventArgs e)
        {
            var translateNodeID = TranslateUtils.ToInt(ddlTranslateNodeID.SelectedValue);

            if (translateNodeID == 0)
            {
                FailMessage("转移失败,必须选择转移目标");
                return;
            }
            try
            {
                contentInfo.SetExtendedAttribute(GovInteractContentAttribute.TranslateFromNodeId, contentInfo.NodeId.ToString());
                contentInfo.NodeId = translateNodeID;
                DataProvider.ContentDao.Update(PublishmentSystemInfo.AuxiliaryTableForGovInteract, PublishmentSystemInfo, contentInfo);

                if (!string.IsNullOrEmpty(tbTranslateRemark.Text))
                {
                    var remarkInfo = new GovInteractRemarkInfo(0, PublishmentSystemId, contentInfo.NodeId, contentInfo.Id, EGovInteractRemarkType.Translate, tbTranslateRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                    DataProvider.GovInteractRemarkDao.Insert(remarkInfo);
                }

                GovInteractApplyManager.LogTranslate(PublishmentSystemId, contentInfo.NodeId, contentInfo.Id, NodeManager.GetNodeName(PublishmentSystemId, contentInfo.NodeId), Body.AdministratorName, Body.AdministratorInfo.DepartmentId);

                SuccessMessage("办件转移成功");
                if (!PublishmentSystemInfo.Additional.GovInteractApplyIsOpenWindow)
                {
                    AddWaitAndRedirectScript(ListPageUrl);
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
            }
        }
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var translateNodeID = TranslateUtils.ToInt(ddlNodeID.SelectedValue);
                if (translateNodeID == 0)
                {
                    FailMessage("转移失败,必须选择转移目标");
                    return;
                }

                foreach (int contentID in _idArrayList)
                {
                    var contentInfo = DataProvider.GovInteractContentDao.GetContentInfo(PublishmentSystemInfo, contentID);
                    contentInfo.SetExtendedAttribute(GovInteractContentAttribute.TranslateFromNodeId, contentInfo.NodeId.ToString());
                    contentInfo.NodeId = translateNodeID;

                    DataProvider.ContentDao.Update(PublishmentSystemInfo.AuxiliaryTableForGovInteract, PublishmentSystemInfo, contentInfo);

                    if (!string.IsNullOrEmpty(tbTranslateRemark.Text))
                    {
                        var remarkInfo = new GovInteractRemarkInfo(0, PublishmentSystemId, contentInfo.NodeId, contentID, EGovInteractRemarkType.Translate, tbTranslateRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                        DataProvider.GovInteractRemarkDao.Insert(remarkInfo);
                    }

                    GovInteractApplyManager.LogTranslate(PublishmentSystemId, contentInfo.NodeId, contentID, NodeManager.GetNodeName(PublishmentSystemId, _nodeId), Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                }

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
                isChanged = false;
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page, "alert(\'办件转移成功!\');");
            }
        }