Example #1
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (myFile.PostedFile != null && "" != myFile.PostedFile.FileName)
            {
                var filePath = myFile.PostedFile.FileName;
                if (!EFileSystemTypeUtils.IsZip(PathUtils.GetExtension(filePath)))
                {
                    FailMessage("必须上传Zip压缩文件");
                    return;
                }

                try
                {
                    var localFilePath = PathUtils.GetTemporaryFilesPath(PathUtils.GetFileName(filePath));

                    myFile.PostedFile.SaveAs(localFilePath);

                    ImportObject.ImportTableStyleByZipFile(_tableStyle, _tableName, _relatedIdentity, localFilePath);

                    Body.AddSiteLog(PublishmentSystemId, "导入表单显示样式", $"类型:{ETableStyleUtils.GetText(_tableStyle)}");

                    PageUtils.CloseModalPage(Page);
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "导入表样式失败!");
                }
            }
        }
Example #2
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var totalCount   = TranslateUtils.ToInt(TotalCount.Text);
                var pointAverage = TranslateUtils.ToDecimal(PointAverage.Text);
                if (totalCount == 0)
                {
                    pointAverage = 0;
                }
                else if (pointAverage == 0)
                {
                    totalCount = 0;
                }

                StarsManager.SetStarSetting(PublishmentSystemId, _channelId, _contentId, totalCount, pointAverage);

                Body.AddSiteLog(PublishmentSystemId, _channelId, _contentId, "设置内容评分值", string.Empty);

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "评分设置失败!");
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #3
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                DataProvider.GovInteractReplyDao.DeleteByContentId(PublishmentSystemId, _contentInfo.Id);
                var fileUrl   = UploadFile(htmlFileUrl.PostedFile);
                var replyInfo = new GovInteractReplyInfo(0, PublishmentSystemId, _contentInfo.NodeId, _contentInfo.Id, tbReply.Text, fileUrl, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                DataProvider.GovInteractReplyDao.Insert(replyInfo);

                GovInteractApplyManager.Log(PublishmentSystemId, _contentInfo.NodeId, _contentInfo.Id, EGovInteractLogType.Reply, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                if (Body.AdministratorInfo.DepartmentId > 0)
                {
                    DataProvider.GovInteractContentDao.UpdateDepartmentId(PublishmentSystemInfo, _contentInfo.Id, Body.AdministratorInfo.DepartmentId);
                }
                DataProvider.GovInteractContentDao.UpdateState(PublishmentSystemInfo, _contentInfo.Id, EGovInteractState.Replied);

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

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page, "alert(\'办件回复成功!\');");
            }
        }
Example #4
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var styleInfo = DataProvider.TagStyleDao.GetTagStyleInfo(styleID);
                var applyInfo = new TagStyleGovInteractApplyInfo(styleInfo.SettingsXML);

                applyInfo.IsAnomynous = TranslateUtils.ToBool(IsAnomynous.SelectedValue);

                styleInfo.SettingsXML = applyInfo.ToString();

                DataProvider.TagStyleDao.Update(styleInfo);

                Body.AddSiteLog(PublishmentSystemId, "修改互动交流提交样式", $"样式名称:{styleInfo.StyleName}");

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "互动交流提交样式修改失败!");
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (myFile.PostedFile != null && "" != myFile.PostedFile.FileName)
            {
                try
                {
                    var filePath = myFile.PostedFile.FileName;
                    if (!StringUtils.EqualsIgnoreCase(PathUtils.GetExtension(filePath), ".csv"))
                    {
                        FailMessage("必须上传后缀为“.csv”的Excel文件");
                        return;
                    }

                    var localFilePath = PathUtils.GetTemporaryFilesPath(PathUtils.GetFileName(filePath));

                    myFile.PostedFile.SaveAs(localFilePath);

                    var importObject = new ImportObject(PublishmentSystemId);
                    importObject.ImportInputContentsByCsvFile(_inputInfo, localFilePath, TranslateUtils.ToInt(ImportStart.Text), TranslateUtils.ToInt(ImportCount.Text), TranslateUtils.ToBool(IsChecked.SelectedValue));

                    Body.AddSiteLog(PublishmentSystemId, "导入提交表单内容", $"提交表单:{_inputInfo.InputName}");

                    PageUtils.CloseModalPage(Page);
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "导入提交表单失败!");
                }
            }
        }
Example #6
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (myFile.PostedFile != null && "" != myFile.PostedFile.FileName)
            {
                try
                {
                    var filePath = myFile.PostedFile.FileName;
                    if (!StringUtils.EqualsIgnoreCase(PathUtils.GetExtension(filePath), ".xls"))
                    {
                        FailMessage("必须上传后缀为“.xls”的Excel文件");
                        return;
                    }

                    var localFilePath = PathUtils.GetTemporaryFilesPath(PathUtils.GetFileName(filePath));

                    myFile.PostedFile.SaveAs(localFilePath);

                    //this.ImportContentsByExcelFile(localFilePath, TranslateUtils.ToBool(this.IsOverride.SelectedValue), TranslateUtils.ToInt(this.ImportStart.Text), TranslateUtils.ToInt(this.ImportCount.Text));

                    Body.AddAdminLog("导入用户");

                    PageUtils.CloseModalPage(Page);
                }
                catch (Exception ex)
                {
                    FailMessage(ex, $"导入用户失败,{ex.Message}");
                }
            }
        }
Example #7
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                foreach (ListItem listItem in CblCoupon.Items)
                {
                    var couponId    = TranslateUtils.ToInt(listItem.Value);
                    var updateActId = listItem.Selected ? _actId : 0;
                    DataProviderWx.CouponDao.UpdateActId(couponId, updateActId);
                }

                //DataProviderWx.CouponSnDao.UpdateStatus(ECouponStatusUtils.GetEnumType(this.ddlStatus.SelectedValue), TranslateUtils.StringCollectionToIntList(base.Request.QueryString["IDCollection"]));

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "ʧ�ܣ�" + ex.Message);
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #8
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (IsPostBack && IsValid)
            {
                try
                {
                    string errorMessage;
                    if (!BaiRongDataProvider.AdministratorDao.ChangePassword(_userName, Password.Text, out errorMessage))
                    {
                        FailMessage(errorMessage);
                        return;
                    }

                    Body.AddAdminLog("重设管理员密码", $"管理员:{_userName}");

                    SuccessMessage("重设密码成功!");

                    PageUtils.CloseModalPage(Page);
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "重设密码失败!");
                }
            }
        }
Example #9
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isCreated = false;

            if (!DirectoryUtils.IsDirectoryNameCompliant(DirectoryName.Text))
            {
                DirectoryNameValidator.IsValid      = false;
                DirectoryNameValidator.ErrorMessage = "文件夹名称不符合要求";
                return;
            }

            var path = PathUtils.Combine(_directoryPath, DirectoryName.Text);

            if (DirectoryUtils.IsDirectoryExists(path))
            {
                DirectoryNameValidator.IsValid      = false;
                DirectoryNameValidator.ErrorMessage = "文件夹已经存在";
            }
            else
            {
                DirectoryUtils.CreateDirectoryIfNotExists(path);
                isCreated = true;
            }

            if (isCreated)
            {
                Body.AddSiteLog(PublishmentSystemId, "新建文件夹", $"文件夹:{DirectoryName.Text}");
                PageUtils.CloseModalPage(Page);
            }
        }
Example #10
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (IsPostBack && IsValid)
            {
                try
                {
                    string errorMessage;
                    if (BaiRongDataProvider.UserDao.ChangePassword(_userName, tbPassword.Text, out errorMessage))
                    {
                        SuccessMessage("重设密码成功!");
                    }
                    else
                    {
                        FailMessage(errorMessage);
                        return;
                    }

                    PageUtils.CloseModalPage(Page);
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "重设密码失败!");
                }
            }
        }
Example #11
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (myFile.PostedFile != null && "" != myFile.PostedFile.FileName)
            {
                var filePath = myFile.PostedFile.FileName;
                if (!EFileSystemTypeUtils.IsZip(PathUtils.GetExtension(filePath)))
                {
                    FailMessage("必须上传Zip压缩文件");
                    return;
                }

                try
                {
                    var localFilePath = PathUtils.GetTemporaryFilesPath(PathUtils.GetFileName(filePath));

                    myFile.PostedFile.SaveAs(localFilePath);

                    var importObject = new ImportObject(PublishmentSystemId);
                    importObject.ImportChannelsAndContentsByZipFile(TranslateUtils.ToInt(ParentNodeID.SelectedValue), localFilePath, TranslateUtils.ToBool(IsOverride.SelectedValue));

                    Body.AddSiteLog(PublishmentSystemId, "导入栏目");

                    PageUtils.CloseModalPage(Page);
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "导入栏目失败!");
                }
            }
        }
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                PublishmentSystemInfo.PublishmentSystemUrl         = tbPublishmentSystemUrl.Text;
                PublishmentSystemInfo.Additional.IsMultiDeployment = TranslateUtils.ToBool(ddlIsMultiDeployment.SelectedValue);
                PublishmentSystemInfo.Additional.OuterUrl          = tbOuterUrl.Text;
                PublishmentSystemInfo.Additional.InnerUrl          = tbInnerUrl.Text;
                PublishmentSystemInfo.Additional.ApiUrl            = tbAPIUrl.Text;
                PublishmentSystemInfo.Additional.HomeUrl           = tbHomeUrl.Text;
                DataProvider.PublishmentSystemDao.Update(PublishmentSystemInfo);
                Body.AddSiteLog(PublishmentSystemId, "修改网站访问设置");

                isChanged = true;
            }
            catch (Exception ex)
            {
                PageUtils.RedirectToErrorPage($"修改失败:{ex.Message}");
                return;
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #13
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            try
            {
                if (id == 0)
                {
                    var albumContentInfo = new AlbumContentInfo();
                    albumContentInfo.PublishmentSystemID = PublishmentSystemId;
                    albumContentInfo.AlbumID             = albumID;
                    albumContentInfo.ParentID            = 0;
                    albumContentInfo.Title         = tbTitle.Text;
                    albumContentInfo.LargeImageUrl = imageUrl.Value;

                    DataProviderWX.AlbumContentDAO.Insert(albumContentInfo);
                }
                else
                {
                    var albumContentInfo = DataProviderWX.AlbumContentDAO.GetAlbumContentInfo(id);
                    albumContentInfo.Title         = tbTitle.Text;
                    albumContentInfo.LargeImageUrl = imageUrl.Value;

                    DataProviderWX.AlbumContentDAO.Update(albumContentInfo);
                }

                PageUtils.CloseModalPage(Page);
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }
        }
Example #14
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                if (string.IsNullOrEmpty(tbCommentRemark.Text))
                {
                    FailMessage("批示失败,必须填写意见");
                    return;
                }

                foreach (int applyID in _idArrayList)
                {
                    var remarkInfo = new GovPublicApplyRemarkInfo(0, PublishmentSystemId, applyID, EGovPublicApplyRemarkType.Comment, tbCommentRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                    DataProvider.GovPublicApplyRemarkDao.Insert(remarkInfo);

                    GovPublicApplyManager.Log(PublishmentSystemId, applyID, EGovPublicApplyLogType.Comment, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                }

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

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page, "alert(\'批示成功!\');");
            }
        }
Example #15
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (Page.IsPostBack && Page.IsValid)
            {
                var albumContentIdList = new List <int>();
                if (_parentId > 0)
                {
                    albumContentIdList = DataProviderWx.AlbumContentDao.GetAlbumContentIdList(PublishmentSystemId, _albumId, _parentId);
                }
                var photoCount = TranslateUtils.ToInt(Request.Form["Photo_Count"]);
                if (photoCount > 0)
                {
                    for (var index = 1; index <= photoCount; index++)
                    {
                        var id       = TranslateUtils.ToInt(Request.Form["ID_" + index]);
                        var smallUrl = Request.Form["SmallUrl_" + index];
                        var largeUrl = Request.Form["LargeUrl_" + index];
                        var title    = Request.Form["imgTitle_" + index];

                        if (!string.IsNullOrEmpty(smallUrl) && !string.IsNullOrEmpty(largeUrl))
                        {
                            if (id > 0)
                            {
                                var albumContentInfo = DataProviderWx.AlbumContentDao.GetAlbumContentInfo(id);
                                if (albumContentInfo != null)
                                {
                                    albumContentInfo.ImageUrl      = smallUrl;
                                    albumContentInfo.LargeImageUrl = largeUrl;
                                    albumContentInfo.Title         = title;

                                    DataProviderWx.AlbumContentDao.Update(albumContentInfo);
                                }
                                albumContentIdList.Remove(id);
                            }
                            else
                            {
                                var albumContentInfo = new AlbumContentInfo();
                                albumContentInfo.PublishmentSystemId = PublishmentSystemId;
                                albumContentInfo.AlbumId             = _albumId;
                                albumContentInfo.ParentId            = _parentId;
                                albumContentInfo.ImageUrl            = smallUrl;
                                albumContentInfo.LargeImageUrl       = largeUrl;
                                albumContentInfo.Title = title;

                                DataProviderWx.AlbumContentDao.Insert(albumContentInfo);
                            }
                        }
                    }
                }

                if (albumContentIdList.Count > 0)
                {
                    DataProviderWx.AlbumContentDao.Delete(PublishmentSystemId, albumContentIdList);
                }

                PageUtils.CloseModalPage(Page);
            }
        }
Example #16
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (Page.IsPostBack && Page.IsValid)
            {
                var fileCount = TranslateUtils.ToInt(Request.Form["File_Count"]);
                if (fileCount == 1)
                {
                    var fileName    = Request.Form["fileName_1"];
                    var redirectUrl = WebUtils.GetContentAddUploadWordUrl(PublishmentSystemId, _nodeInfo, cbIsFirstLineTitle.Checked, cbIsFirstLineRemove.Checked, cbIsClearFormat.Checked, cbIsFirstLineIndent.Checked, cbIsClearFontSize.Checked, cbIsClearFontFamily.Checked, cbIsClearImages.Checked, TranslateUtils.ToIntWithNagetive(rblContentLevel.SelectedValue), fileName, _returnUrl);
                    PageUtils.CloseModalPageAndRedirect(Page, redirectUrl);

                    return;
                }
                if (fileCount > 1)
                {
                    var tableStyle        = NodeManager.GetTableStyle(PublishmentSystemInfo, _nodeInfo);
                    var tableName         = NodeManager.GetTableName(PublishmentSystemInfo, _nodeInfo);
                    var relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, _nodeInfo.NodeId);

                    for (var index = 1; index <= fileCount; index++)
                    {
                        var fileName = Request.Form["fileName_" + index];
                        if (!string.IsNullOrEmpty(fileName))
                        {
                            var formCollection = WordUtils.GetWordNameValueCollection(PublishmentSystemId, _nodeInfo.ContentModelId, cbIsFirstLineTitle.Checked, cbIsFirstLineRemove.Checked, cbIsClearFormat.Checked, cbIsFirstLineIndent.Checked, cbIsClearFontSize.Checked, cbIsClearFontFamily.Checked, cbIsClearImages.Checked, TranslateUtils.ToInt(rblContentLevel.SelectedValue), fileName);

                            if (!string.IsNullOrEmpty(formCollection[ContentAttribute.Title]))
                            {
                                var contentInfo = ContentUtility.GetContentInfo(tableStyle);

                                BackgroundInputTypeParser.AddValuesToAttributes(tableStyle, tableName, PublishmentSystemInfo, relatedIdentities, formCollection, contentInfo.Attributes, ContentAttribute.HiddenAttributes);

                                contentInfo.NodeId = _nodeInfo.NodeId;
                                contentInfo.PublishmentSystemId = PublishmentSystemId;
                                contentInfo.AddUserName         = Body.AdministratorName;
                                contentInfo.AddDate             = DateTime.Now;
                                contentInfo.LastEditUserName    = contentInfo.AddUserName;
                                contentInfo.LastEditDate        = contentInfo.AddDate;

                                contentInfo.CheckedLevel = TranslateUtils.ToIntWithNagetive(rblContentLevel.SelectedValue);
                                contentInfo.IsChecked    = contentInfo.CheckedLevel >= PublishmentSystemInfo.CheckContentLevel;

                                contentInfo.Id = DataProvider.ContentDao.Insert(tableName, PublishmentSystemInfo, contentInfo);

                                if (contentInfo.IsChecked)
                                {
                                    CreateManager.CreateContentAndTrigger(PublishmentSystemId, _nodeInfo.NodeId, contentInfo.Id);
                                }
                            }
                        }
                    }
                }

                PageUtils.CloseModalPage(Page);
            }
        }
Example #17
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (Page.IsPostBack && Page.IsValid)
            {
                if (!_isAdd)
                {
                    try
                    {
                        var groupInfo = UserGroupManager.GetGroupInfo(_groupId);
                        if (groupInfo.GroupName != GroupName.Text && BaiRongDataProvider.UserGroupDao.IsExists(GroupName.Text))
                        {
                            FailMessage("用户组修改失败,用户组名称已存在!");
                            return;
                        }

                        groupInfo.GroupName   = GroupName.Text;
                        groupInfo.Description = Description.Text;

                        Body.AddAdminLog("修改用户组",
                                         $"用户组:{GroupName.Text}");

                        PageUtils.CloseModalPage(Page);
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "用户组修改失败!");
                    }
                }
                else
                {
                    if (BaiRongDataProvider.UserGroupDao.IsExists(GroupName.Text))
                    {
                        FailMessage("用户组添加失败,用户组名称已存在!");
                        return;
                    }
                    else
                    {
                        var groupInfo = new UserGroupInfo(0, GroupName.Text, false, Description.Text, string.Empty);

                        try
                        {
                            BaiRongDataProvider.UserGroupDao.Insert(groupInfo);

                            Body.AddAdminLog("添加用户组",
                                             $"用户组:{GroupName.Text}");

                            PageUtils.CloseModalPage(Page);
                        }
                        catch (Exception ex)
                        {
                            FailMessage(ex, "用户组添加失败!" + ex.ToString());
                        }
                    }
                }
            }
        }
Example #18
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (hifUpload.PostedFile != null && "" != hifUpload.PostedFile.FileName)
            {
                var filePath = hifUpload.PostedFile.FileName;
                try
                {
                    var fileExtName        = PathUtils.GetExtension(filePath).ToLower();
                    var localDirectoryPath = PathUtility.GetUploadDirectoryPath(PublishmentSystemInfo, fileExtName);
                    if (!string.IsNullOrEmpty(_currentRootPath))
                    {
                        localDirectoryPath = PathUtility.MapPath(PublishmentSystemInfo, _currentRootPath);
                        DirectoryUtils.CreateDirectoryIfNotExists(localDirectoryPath);
                    }
                    var localFileName = PathUtility.GetUploadFileName(PublishmentSystemInfo, filePath);
                    var localFilePath = PathUtils.Combine(localDirectoryPath, localFileName);

                    if (!PathUtility.IsVideoExtenstionAllowed(PublishmentSystemInfo, fileExtName))
                    {
                        FailMessage("上传失败,上传视频格式不正确!");
                        return;
                    }
                    if (!PathUtility.IsVideoSizeAllowed(PublishmentSystemInfo, hifUpload.PostedFile.ContentLength))
                    {
                        FailMessage("上传失败,上传视频超出规定文件大小!");
                        return;
                    }

                    hifUpload.PostedFile.SaveAs(localFilePath);

                    var videoUrl   = PageUtility.GetPublishmentSystemUrlByPhysicalPath(PublishmentSystemInfo, localFilePath);
                    var textBoxUrl = PageUtility.GetVirtualUrl(PublishmentSystemInfo, videoUrl);

                    if (string.IsNullOrEmpty(_textBoxClientId))
                    {
                        PageUtils.CloseModalPage(Page);
                    }
                    else
                    {
                        ltlScript.Text += $@"
if (parent.document.getElementById('{_textBoxClientId}') != null)
{{
    parent.document.getElementById('{_textBoxClientId}').value = '{textBoxUrl}';
}}
";

                        ltlScript.Text += PageUtils.HidePopWin;
                    }
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "视频上传失败!");
                }
            }
        }
Example #19
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (hifUpload.PostedFile != null && "" != hifUpload.PostedFile.FileName)
            {
                var filePath = hifUpload.PostedFile.FileName;
                try
                {
                    var fileExtName        = PathUtils.GetExtension(filePath).ToLower();
                    var localDirectoryPath = AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\upload\\images";
                    //Server.MapPath(".");
                    DirectoryUtils.CreateDirectoryIfNotExists(localDirectoryPath);

                    var localFileName = GetUploadFileName(filePath, DateTime.Now, true);
                    var localFilePath = PathUtils.Combine(localDirectoryPath, localFileName);

                    if (!PathUtils.IsFileExtenstionAllowed("jpg|gif|png|bmp", fileExtName))
                    {
                        FailMessage("上传失败,上传图片格式不正确!");
                        return;
                    }
                    if (hifUpload.PostedFile.ContentLength > 10 * 1024)
                    {
                        FailMessage("上传失败,上传图片超出规定文件大小!");
                        return;
                    }

                    hifUpload.PostedFile.SaveAs(localFilePath);

                    var isImage = EFileSystemTypeUtils.IsImage(fileExtName);


                    if (string.IsNullOrEmpty(_textBoxClientId))
                    {
                        PageUtils.CloseModalPage(Page);
                    }
                    else
                    {
                        var textBoxUrl = "@/upload/images/" + localFileName;

                        ltlScript.Text += $@"
if (parent.document.getElementById('{_textBoxClientId}') != null)
{{
    parent.document.getElementById('{_textBoxClientId}').value = '{textBoxUrl}';
}}
";

                        ltlScript.Text += PageUtils.HidePopWin;
                    }
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "图片上传失败!");
                }
            }
        }
Example #20
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                if (this._couponId == 0)
                {
                    var totalNum = TranslateUtils.ToInt(TbTotalNum.Text);

                    if (totalNum > 1000)
                    {
                        FailMessage("添加失败,一次最多只能新增1000张优惠劵");
                    }
                    else
                    {
                        var couponInfo = new CouponInfo {
                            Id = 0, PublishmentSystemId = PublishmentSystemId, ActId = 0, Title = TbTitle.Text, TotalNum = totalNum, AddDate = DateTime.Now
                        };

                        var couponId = DataProviderWx.CouponDao.Insert(couponInfo);

                        if (CbIsEnabled.Checked == false)
                        {
                            DataProviderWx.CouponSnDao.Insert(PublishmentSystemId, couponId, totalNum);
                        }

                        Body.AddSiteLog(PublishmentSystemId, "添加优惠劵", $"优惠劵:{TbTitle.Text}");

                        isChanged = true;
                    }
                }
                else
                {
                    var couponInfo = DataProviderWx.CouponDao.GetCouponInfo(_couponId);
                    couponInfo.Title = TbTitle.Text;

                    DataProviderWx.CouponDao.Update(couponInfo);

                    Body.AddSiteLog(PublishmentSystemId, "编辑优惠劵", $"优惠劵:{TbTitle.Text}");

                    isChanged = true;
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var targetPublishmentSystemID   = int.Parse(PublishmentSystemIDDropDownList.SelectedValue);
            var targetPublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(targetPublishmentSystemID);

            try
            {
                foreach (ListItem listItem in NodeIDListBox.Items)
                {
                    if (listItem.Selected)
                    {
                        var targetNodeID = TranslateUtils.ToInt(listItem.Value);
                        if (targetNodeID != 0)
                        {
                            var targetTableStyle = NodeManager.GetTableStyle(targetPublishmentSystemInfo, targetNodeID);
                            var targetTableName  = NodeManager.GetTableName(targetPublishmentSystemInfo, targetNodeID);
                            var tableStyle       = NodeManager.GetTableStyle(PublishmentSystemInfo, _nodeId);
                            var tableName        = NodeManager.GetTableName(PublishmentSystemInfo, _nodeId);
                            foreach (int contentID in _contentIdArrayList)
                            {
                                var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentID);
                                FileUtility.MoveFileByContentInfo(PublishmentSystemInfo, targetPublishmentSystemInfo, contentInfo as BackgroundContentInfo);
                                contentInfo.PublishmentSystemId = targetPublishmentSystemID;
                                contentInfo.SourceId            = contentInfo.NodeId;
                                contentInfo.NodeId = targetNodeID;

                                if (targetPublishmentSystemInfo.Additional.IsCrossSiteTransChecked)
                                {
                                    contentInfo.IsChecked = true;
                                }
                                else
                                {
                                    contentInfo.IsChecked = false;
                                }
                                contentInfo.CheckedLevel = 0;

                                DataProvider.ContentDao.Insert(targetTableName, targetPublishmentSystemInfo, contentInfo);
                            }
                        }
                    }
                }

                Body.AddSiteLog(PublishmentSystemId, _nodeId, 0, "跨站转发内容", string.Empty);

                SuccessMessage("内容转发成功,请选择后续操作。");
            }
            catch (Exception ex)
            {
                FailMessage(ex, "内容转发失败!");
            }

            PageUtils.CloseModalPage(Page);
        }
Example #22
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            if (_keywordId > 0)
            {
                try
                {
                    var keywordInfo = DataProvider.KeywordDao.GetKeywordInfo(_keywordId);
                    keywordInfo.Keyword     = tbKeyword.Text.Trim();
                    keywordInfo.Alternative = tbAlternative.Text.Trim();
                    keywordInfo.Grade       = EKeywordGradeUtils.GetEnumType(ddlGrade.SelectedValue);
                    DataProvider.KeywordDao.Update(keywordInfo);

                    isChanged = true;
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "修改敏感词失败!");
                }
            }
            else
            {
                if (DataProvider.KeywordDao.IsExists(tbKeyword.Text))
                {
                    FailMessage("敏感词添加失败,敏感词名称已存在!");
                }
                else
                {
                    try
                    {
                        var keywordInfo = new KeywordInfo
                        {
                            Keyword     = tbKeyword.Text.Trim(),
                            Alternative = tbAlternative.Text.Trim(),
                            Grade       = EKeywordGradeUtils.GetEnumType(ddlGrade.SelectedValue)
                        };
                        DataProvider.KeywordDao.Insert(keywordInfo);
                        isChanged = true;
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "添加敏感词失败!");
                    }
                }
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #23
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            var contentGroupInfo = new ContentGroupInfo
            {
                ContentGroupName    = PageUtils.FilterXss(ContentGroupName.Text),
                PublishmentSystemId = PublishmentSystemId,
                Description         = Description.Text
            };

            if (Body.IsQueryExists("GroupName"))
            {
                try
                {
                    DataProvider.ContentGroupDao.Update(contentGroupInfo);
                    Body.AddSiteLog(PublishmentSystemId, "修改内容组", $"内容组:{contentGroupInfo.ContentGroupName}");
                    isChanged = true;
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "内容组修改失败!");
                }
            }
            else
            {
                var contentGroupNameList = DataProvider.ContentGroupDao.GetContentGroupNameList(PublishmentSystemId);
                if (contentGroupNameList.IndexOf(ContentGroupName.Text) != -1)
                {
                    FailMessage("内容组添加失败,内容组名称已存在!");
                }
                else
                {
                    try
                    {
                        DataProvider.ContentGroupDao.Insert(contentGroupInfo);
                        Body.AddSiteLog(PublishmentSystemId, "添加内容组",
                                        $"内容组:{contentGroupInfo.ContentGroupName}");
                        isChanged = true;
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "内容组添加失败!");
                    }
                }
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #24
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            var stlTagInfo = new StlTagInfo();

            stlTagInfo.TagName             = TagName.Text;
            stlTagInfo.PublishmentSystemID = PublishmentSystemId;
            stlTagInfo.TagDescription      = Description.Text;
            stlTagInfo.TagContent          = Content.Text;

            if (Body.IsQueryExists("TagName"))
            {
                try
                {
                    DataProvider.StlTagDao.Update(stlTagInfo);
                    Body.AddSiteLog(PublishmentSystemId, "修改自定义模板语言", $"模板标签名:{stlTagInfo.TagName}");
                    isChanged = true;
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "自定义模板标签修改失败!");
                }
            }
            else
            {
                var stlTagNameArrayList = DataProvider.StlTagDao.GetStlTagNameArrayList(PublishmentSystemId);
                if (stlTagNameArrayList.IndexOf(TagName.Text) != -1)
                {
                    FailMessage("自定义模板标签添加失败,自定义模板标签名已存在!");
                }
                else
                {
                    try
                    {
                        DataProvider.StlTagDao.Insert(stlTagInfo);
                        Body.AddSiteLog(PublishmentSystemId, "添加自定义模板语言", $"模板标签名:{stlTagInfo.TagName}");
                        isChanged = true;
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "自定义模板标签添加失败!");
                    }
                }
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #25
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            var nodeGroupInfo = new NodeGroupInfo
            {
                NodeGroupName       = tbNodeGroupName.Text,
                PublishmentSystemID = PublishmentSystemId,
                Description         = tbDescription.Text
            };

            if (Body.IsQueryExists("GroupName"))
            {
                try
                {
                    DataProvider.NodeGroupDao.Update(nodeGroupInfo);
                    Body.AddSiteLog(PublishmentSystemId, "修改栏目组", $"栏目组:{nodeGroupInfo.NodeGroupName}");
                    isChanged = true;
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "栏目组修改失败!");
                }
            }
            else
            {
                var nodeGroupNameList = DataProvider.NodeGroupDao.GetNodeGroupNameList(PublishmentSystemId);
                if (nodeGroupNameList.IndexOf(tbNodeGroupName.Text) != -1)
                {
                    FailMessage("栏目组添加失败,栏目组名称已存在!");
                }
                else
                {
                    try
                    {
                        DataProvider.NodeGroupDao.Insert(nodeGroupInfo);
                        Body.AddSiteLog(PublishmentSystemId, "添加栏目组", $"栏目组:{nodeGroupInfo.NodeGroupName}");
                        isChanged = true;
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "栏目组添加失败!");
                    }
                }
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #26
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var grade = EKeywordGradeUtils.GetEnumType(ddlGrade.SelectedValue);

                var keywordArray = tbKeywords.Text.Split(',');
                foreach (var item in keywordArray)
                {
                    if (!string.IsNullOrEmpty(item))
                    {
                        var value       = item.Trim();
                        var keyword     = string.Empty;
                        var alternative = string.Empty;

                        if (value.IndexOf('|') != -1)
                        {
                            keyword     = value.Split('|')[0];
                            alternative = value.Split('|')[1];
                        }
                        else
                        {
                            keyword = value;
                        }

                        if (!string.IsNullOrEmpty(keyword) && !DataProvider.KeywordDao.IsExists(keyword))
                        {
                            var keywordInfo = new KeywordInfo(0, keyword, alternative, grade);
                            DataProvider.KeywordDao.Insert(keywordInfo);
                        }
                    }
                }

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "导入敏感词失败");
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #27
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var filePath = PathUtils.GetTemporaryFilesPath("cardsn-example.csv");
                FileUtils.DeleteFileIfExists(filePath);
                HifUpload.PostedFile.SaveAs(filePath);

                try
                {
                    var cardEntitySnInfoArrayList = GetCardEntitySnInfoArrayList(filePath);
                    if (cardEntitySnInfoArrayList.Count > 0)
                    {
                        isChanged = true;
                        var errorMessage = string.Empty;
                        for (var i = 0; i < cardEntitySnInfoArrayList.Count; i++)
                        {
                            var cardEntitySnInfo = cardEntitySnInfoArrayList[i] as CardEntitySnInfo;

                            var isExist = DataProviderWx.CardEntitySnDao.IsExist(PublishmentSystemId, _cardId, cardEntitySnInfo.Sn);
                            if (!isExist)
                            {
                                DataProviderWx.CardEntitySnDao.Insert(cardEntitySnInfo);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "失败:" + ex.Message);
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Example #28
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var switchToDepartmentID = TranslateUtils.ToInt(Request.Form["switchToDepartmentID"]);
                if (switchToDepartmentID == 0)
                {
                    FailMessage("转办失败,必须选择转办部门");
                    return;
                }
                var switchToDepartmentName = DepartmentManager.GetDepartmentName(switchToDepartmentID);

                foreach (int contentID in _idArrayList)
                {
                    var contentInfo = DataProvider.GovInteractContentDao.GetContentInfo(PublishmentSystemInfo, contentID);
                    if (contentInfo.State != EGovInteractState.Denied && contentInfo.State != EGovInteractState.Checked)
                    {
                        DataProvider.GovInteractContentDao.UpdateDepartmentId(PublishmentSystemInfo, contentID, switchToDepartmentID);

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

                        GovInteractApplyManager.LogSwitchTo(PublishmentSystemId, contentInfo.NodeId, contentID, switchToDepartmentName, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                    }
                }

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

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page, "alert(\'办件转办成功!\');");
            }
        }
Example #29
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var groupID = TranslateUtils.ToInt(UserGroupIDDropDownList.SelectedValue);

            var groupInfo = UserGroupManager.GetGroupInfo(groupID);

            foreach (var userID in _userIdList)
            {
                var userInfo = BaiRongDataProvider.UserDao.GetUserInfo(userID);

                userInfo.GroupId = groupID;

                BaiRongDataProvider.UserDao.Update(userInfo);
            }

            Body.AddAdminLog("设置用户类别", string.Empty);

            PageUtils.CloseModalPage(Page);
        }
        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(\'办件转移成功!\');");
            }
        }