/// <summary>
        /// 新增稿件作者信息
        /// </summary>
        /// <param name="contributionAuthorEntity"></param>
        /// <param name="trans"></param>
        /// <returns></returns>
        public bool AddContributionAuthor(ContributionAuthorEntity contributionAuthorEntity, DbTransaction trans = null)
        {
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" @CID");
            sqlCommandText.Append(", @JouranalID");
            sqlCommandText.Append(", @AuthorID");
            sqlCommandText.Append(", @AuthorName");
            sqlCommandText.Append(", @Gender");
            sqlCommandText.Append(", @Birthday");
            sqlCommandText.Append(", @Tel");
            sqlCommandText.Append(", @Mobile");
            sqlCommandText.Append(", @Email");
            sqlCommandText.Append(", @Nation");
            sqlCommandText.Append(", @NativePlace");
            sqlCommandText.Append(", @WorkUnit");
            sqlCommandText.Append(", @SectionOffice");
            sqlCommandText.Append(", @Address");
            sqlCommandText.Append(", @ZipCode");
            sqlCommandText.Append(", @IsFirst");
            sqlCommandText.Append(", @IsCommunication");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.ContributionAuthor ({0},AddDate) VALUES ({1},getdate())", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@CID", DbType.Int64, contributionAuthorEntity.CID);
            db.AddInParameter(cmd, "@JouranalID", DbType.Int64, contributionAuthorEntity.JouranalID);
            db.AddInParameter(cmd, "@AuthorID", DbType.Int64, contributionAuthorEntity.AuthorID);
            db.AddInParameter(cmd, "@AuthorName", DbType.AnsiString, contributionAuthorEntity.AuthorName.TextFilter());
            db.AddInParameter(cmd, "@Gender", DbType.AnsiString, contributionAuthorEntity.Gender);
            db.AddInParameter(cmd, "@Birthday", DbType.DateTime, contributionAuthorEntity.Birthday);
            db.AddInParameter(cmd, "@Tel", DbType.AnsiString, contributionAuthorEntity.Tel.TextFilter());
            db.AddInParameter(cmd, "@Mobile", DbType.AnsiString, contributionAuthorEntity.Mobile.TextFilter());
            db.AddInParameter(cmd, "@Email", DbType.AnsiString, contributionAuthorEntity.Email.TextFilter());
            db.AddInParameter(cmd, "@Nation", DbType.AnsiString, contributionAuthorEntity.Nation.TextFilter());
            db.AddInParameter(cmd, "@NativePlace", DbType.AnsiString, contributionAuthorEntity.NativePlace.TextFilter());
            db.AddInParameter(cmd, "@WorkUnit", DbType.AnsiString, contributionAuthorEntity.WorkUnit.TextFilter());
            db.AddInParameter(cmd, "@SectionOffice", DbType.AnsiString, contributionAuthorEntity.SectionOffice.TextFilter());
            db.AddInParameter(cmd, "@Address", DbType.AnsiString, contributionAuthorEntity.Address.TextFilter());
            db.AddInParameter(cmd, "@ZipCode", DbType.AnsiString, contributionAuthorEntity.ZipCode.TextFilter());
            db.AddInParameter(cmd, "@IsFirst", DbType.Boolean, contributionAuthorEntity.IsFirst);
            db.AddInParameter(cmd, "@IsCommunication", DbType.Boolean, contributionAuthorEntity.IsCommunication);
            try
            {
                bool result = false;
                if (trans == null)
                    result = db.ExecuteNonQuery(cmd) > 0;
                else
                    result = db.ExecuteNonQuery(cmd, trans) > 0;
                if (!result)
                    throw new Exception("新增稿件作者失败!");
                return result;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 /// <summary>
 /// 查看稿件作者信息
 /// </summary>
 /// <returns></returns>
 public ActionResult ViewContributionAuthor(long CAuthorID)
 {
     ContributionAuthorEntity CAuthorEntity = new ContributionAuthorEntity();
     ContributionAuthorQuery query= new ContributionAuthorQuery();
     query.JournalID = CurAuthor.JournalID;
     query.CAuthorID = CAuthorID;
     IContributionFacadeService service = ServiceContainer.Instance.Container.Resolve<IContributionFacadeService>();
     CAuthorEntity=service.GetContributionAuthorInfo(query);
     return View(CAuthorEntity);
 }
 /// <summary>
 /// 编辑稿件作者信息
 /// </summary>
 /// <param name="contributionAuthorEntity"></param>      
 /// <returns></returns>
 public bool UpdateContributionAuthor(ContributionAuthorEntity contributionAuthorEntity)
 {
     return ContributionInfoDataAccess.Instance.UpdateContributionAuthor(contributionAuthorEntity);
 }
Пример #4
0
        public ActionResult CreateReviewBillContent(Int64 CID, string IsView,Boolean IsEnExpert=false, Int64 authorID=0)
        {
            IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
            string html = service.GetReviewBillContentStr(CurAuthor.JournalID, authorID==0?CurAuthor.AuthorID:authorID, CID);
            string head = service.GetReviewBillContentHead(CurAuthor.JournalID, authorID==0?CurAuthor.AuthorID:authorID, CID);
            ViewBag.html = html;
            ViewBag.content = head;
            ViewBag.CID = CID;
            ViewBag.IsEnExpert = IsEnExpert;
            ViewBag.authorID = authorID;
            if (string.IsNullOrEmpty(IsView))
            {
                ViewBag.IsView = "";
            }
            else
            {
                ViewBag.IsView = IsView;
            }

            //2013-9-4  文海峰

            //获取模版

            ISiteConfigFacadeService siteConfigService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            SiteConfigEntity currentEntity = siteConfigService.GetSiteConfigModel(new SiteConfigQuery() { JournalID = CurAuthor.JournalID });

            XmlDocument xmlDoc = new XmlDocument();
            string utl = Utils.GetMapPath(SiteConfig.RootPath + "/data/reviewtemplate.config");
            xmlDoc.Load(Utils.GetMapPath(SiteConfig.RootPath + "/data/reviewtemplate.config"));
            XmlNode signNode = xmlDoc.SelectSingleNode("ContributionSign");
            //获取数据
            IAuthorPlatformFacadeService cService = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
            ContributionInfoQuery query = new ContributionInfoQuery();
            query.JournalID = CurAuthor.JournalID;
            query.CIDs = new Int64[] { CID };
            query.IsAuxiliary = true;
            IList<ContributionInfoEntity> list = cService.GetContributionInfoList(query);

            if (list == null || list.Count == 0)
            {
                ViewBag.SignContent = "获取稿件信息失败";
                return View();
            }

            //替换内容
            StringBuilder strHtml = new StringBuilder();
            foreach (var model in list)
            {
                var linkAuthor = model.AuthorList.SingleOrDefault(p => p.IsCommunication == true);//要求[AuthorDetail]表中作者信息不重复
                var firstAuthor = model.AuthorList.SingleOrDefault(p => p.IsFirst == true);
                if (linkAuthor == null)
                {
                    linkAuthor = new ContributionAuthorEntity();
                }
                if (firstAuthor == null)
                {
                    firstAuthor = new ContributionAuthorEntity();
                }
                strHtml.Append(signNode.InnerText
                    .Replace("${审稿单}$", currentEntity != null ? currentEntity.Title + "审稿单" : "审稿单")
                    .Replace("${稿件编号}$", model.CNumber)
                    .Replace("${投稿日期}$", model.AddDate.ToString("yyyy-MM-dd"))
                    .Replace("${期刊栏目}$", model.JChannelName)
                    .Replace("${中文标题}$", model.Title)
                    .Replace("${作者}$", firstAuthor.AuthorName)
                    .Replace("${联系人单位}$", linkAuthor.WorkUnit)
                    );
            }

            //IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
            //string html = strHtml.ToString();
            //html += "<br></br>";
            //html += service.GetReviewBillContentStr(CurAuthor.JournalID, CurAuthor.AuthorID, CID);
            ViewBag.contributeInfo = strHtml.ToString();
            ViewBag.header = (currentEntity != null ? currentEntity.Title : "") + "审稿单";

            return View();
        }
Пример #5
0
        public ActionResult BillContentReport(Int64 CID)
        {
            try
            {
                //获取模版
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(Utils.GetMapPath(SiteConfig.RootPath + "/data/signtemplate.config"));
                XmlNode signNode = xmlDoc.SelectSingleNode("ContributionSign");

                //获取数据
                IAuthorPlatformFacadeService cService = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
                ContributionInfoQuery query = new ContributionInfoQuery();
                query.JournalID = CurAuthor.JournalID;
                query.CIDs = new Int64[] { CID };
                query.IsAuxiliary = true;
                IList<ContributionInfoEntity> list = cService.GetContributionInfoList(query);

                if (list == null || list.Count == 0)
                {
                    ViewBag.SignContent = "获取稿件信息失败";
                    return View();
                }

                //替换内容
                StringBuilder strHtml = new StringBuilder();
                foreach (var model in list)
                {
                    var linkAuthor = model.AuthorList.SingleOrDefault(p => p.IsCommunication == true);
                    var firstAuthor = model.AuthorList.SingleOrDefault(p => p.IsFirst == true);
                    if (linkAuthor == null)
                    {
                        linkAuthor = new ContributionAuthorEntity();
                    }
                    if (firstAuthor == null)
                    {
                        firstAuthor = new ContributionAuthorEntity();
                    }
                    strHtml.Append(signNode.InnerText
                        .Replace("${稿件编号}$", model.CNumber)
                        .Replace("${投稿日期}$", model.AddDate.ToString("yyyy-MM-dd"))
                        .Replace("${期刊栏目}$", model.JChannelName)
                        .Replace("${中文标题}$", model.Title)
                        .Replace("${英文标题}$", model.EnTitle)
                        .Replace("${关键词}$", model.Keywords)
                        .Replace("${作者}$", firstAuthor.AuthorName)
                        .Replace("${联系人}$", linkAuthor.AuthorName)
                        .Replace("${联系人电子邮件}$", linkAuthor.Email)
                        .Replace("${联系人电话}$", linkAuthor.Tel)
                        .Replace("${联系人地址}$", linkAuthor.Address)
                        .Replace("${联系人邮编}$", linkAuthor.ZipCode)
                        .Replace("${联系人单位}$", linkAuthor.WorkUnit)
                        );
                }

                IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
                string html = service.GetReviewBillContentStr(CurAuthor.JournalID, CurAuthor.AuthorID, CID);
                html += strHtml;
                // RenderToWord.HtmlToWord(Server.UrlDecode(head + html), "空白审稿单.doc", true);
                return Content(html);
            }
            catch (Exception ex)
            {
                LogProvider.Instance.Error("打印空白审稿单出现异常:" + ex.Message);
                return Content("打印空白审稿单异常!");
            }
        }
Пример #6
0
        /// <summary>
        /// 打印信封
        /// </summary>
        /// <param name="CID"></param>
        /// <returns></returns>
        public ActionResult PrintSign(string CIDS)
        {
            if (string.IsNullOrWhiteSpace(CIDS))
            {
                ViewBag.SignContent = "请选择需要打印稿签的稿件";
                return View();
            }

            Int64[] CIDArray = CIDS.Split(',').Where(p => !string.IsNullOrWhiteSpace(p))
                .Select(p => TypeParse.ToLong(p)).ToArray();

            if (CIDArray == null || CIDArray.Length == 0)
            {
                ViewBag.SignContent = "请选择需要打印稿签的稿件";
                return View();
            }

            //获取模版
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(Utils.GetMapPath(SiteConfig.RootPath + "/data/signtemplate.config"));
            XmlNode signNode = xmlDoc.SelectSingleNode("ContributionSign");

            //获取数据
            IAuthorPlatformFacadeService cService = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
            ContributionInfoQuery query = new ContributionInfoQuery();
            query.JournalID = CurAuthor.JournalID;
            query.CIDs = CIDArray;
            query.IsAuxiliary = true;
            IList<ContributionInfoEntity> list = cService.GetContributionInfoList(query);

            if (list == null || list.Count == 0)
            {
                ViewBag.SignContent = "获取稿件信息失败";
                return View();
            }

            ISiteConfigFacadeService siteConfigService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            SiteConfigEntity currentEntity = siteConfigService.GetSiteConfigModel(new SiteConfigQuery() { JournalID = CurAuthor.JournalID });
            StringBuilder strHtml = new StringBuilder();
            foreach (var model in list)
            {
                var linkAuthor = model.AuthorList.SingleOrDefault(p => p.IsCommunication == true);
                var firstAuthor = model.AuthorList.SingleOrDefault(p => p.IsFirst == true);
                if (linkAuthor == null)
                {
                    linkAuthor = new ContributionAuthorEntity();
                }
                if (firstAuthor == null)
                {
                    firstAuthor = new ContributionAuthorEntity();
                }
                strHtml.Append(signNode.InnerText
                     .Replace("${审稿单}$", currentEntity != null ? currentEntity.Title + "稿签" : "稿签")
                    .Replace("${稿件编号}$", model.CNumber)
                    .Replace("${投稿日期}$", model.AddDate.ToString("yyyy-MM-dd"))
                    .Replace("${期刊栏目}$", model.JChannelName)
                    .Replace("${中文标题}$", model.Title)
                    .Replace("${英文标题}$", model.EnTitle)
                    .Replace("${关键词}$", model.Keywords)
                    .Replace("${作者}$", firstAuthor.AuthorName)
                    .Replace("${联系人}$", linkAuthor.AuthorName)
                    .Replace("${联系人电子邮件}$", linkAuthor.Email)
                    .Replace("${联系人电话}$", linkAuthor.Tel)
                    .Replace("${联系人地址}$", linkAuthor.Address)
                    .Replace("${联系人邮编}$", linkAuthor.ZipCode)
                    .Replace("${联系人单位}$", linkAuthor.WorkUnit)
                    );
            }
            ViewBag.SignContent = strHtml.ToString();
            return View();
        }
 /// <summary>
 /// 编辑稿件作者信息
 /// </summary>
 /// <param name="contributionAuthorEntity"></param>      
 /// <returns></returns>
 public bool UpdateContributionAuthor(ContributionAuthorEntity contributionAuthorEntity)
 {
     return ContributionInfoBusProvider.UpdateContributionAuthor(contributionAuthorEntity);
 }
 /// <summary>
 /// 新增稿件作者信息
 /// </summary>
 /// <param name="contributionAuthorEntity"></param>
 /// <param name="trans"></param>
 /// <returns></returns>
 public bool AddContributionAuthor(ContributionAuthorEntity contributionAuthorEntity)
 {
     return ContributionInfoBusProvider.AddContributionAuthor(contributionAuthorEntity);
 }