예제 #1
0
        /// <summary>
        /// 保存期设置
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ExecResult SaveIssueSet(IssueSetEntity model)
        {
            ExecResult execResult = new ExecResult();

            if (IssueSetIsExists(model))
            {
                execResult.result = EnumJsonResult.failure.ToString();
                execResult.msg    = "该期设置已经存在!";
                return(execResult);
            }
            bool result = false;

            if (model.IssueSetID == 0)
            {
                result = AddIssueSet(model);
            }
            else
            {
                result = UpdateIssueSet(model);
            }
            if (result)
            {
                execResult.result = EnumJsonResult.success.ToString();
                execResult.msg    = "保存期设置成功!";
            }
            else
            {
                execResult.result = EnumJsonResult.failure.ToString();
                execResult.msg    = "保存期设置失败!";
            }
            return(execResult);
        }
예제 #2
0
        public IssueSetEntity GetIssueSetModel(IssueSetQuery query)
        {
            IIssueService  service = ServiceContainer.Instance.Container.Resolve <IIssueService>();
            IssueSetEntity model   = null;

            if (query.IssueSetID == 0)
            {
                model = service.GetMaxIssueSet(query.JournalID);
            }
            else
            {
                model = service.GetIssueSet(query.IssueSetID);
            }
            if (model != null)
            {
                Pager <IssueSetEntity> currentEntity = service.GetIssueSetPageList(query);
                if (currentEntity != null && currentEntity.ItemList != null && currentEntity.ItemList.Count > 0)
                {
                    IList <IssueSetEntity> list   = currentEntity.ItemList;
                    IssueSetEntity         single = list.Where(o => o.Issue == model.Issue).SingleOrDefault();
                    model.PrintExpenses = single.PrintExpenses;
                }
            }
            return(model);
        }
예제 #3
0
        /// <summary>
        /// 保存期设置
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public ExecResult SaveIssueSet(IssueSetEntity model)
        {
            HttpClientHelper clientHelper = new HttpClientHelper();
            ExecResult       result       = clientHelper.Post <ExecResult, IssueSetEntity>(GetAPIUrl(APIConstant.ISSUESET_SAVE), model);

            return(result);
        }
예제 #4
0
        /// <summary>
        /// 获取期设置实体
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public IssueSetEntity GetIssueSetModel(IssueSetQuery query)
        {
            HttpClientHelper clientHelper = new HttpClientHelper();
            IssueSetEntity   model        = clientHelper.Post <IssueSetEntity, IssueSetQuery>(GetAPIUrl(APIConstant.ISSUESET_GETMODEL), query);

            return(model);
        }
예제 #5
0
        public ActionResult SaveIssueSet(IssueSetEntity model)
        {
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>();

            model.JournalID = CurAuthor.JournalID;
            ExecResult result = service.SaveIssueSet(model);

            return(Json(new { result = result.result, msg = result.msg }));
        }
예제 #6
0
        public ActionResult CreateIssueSet(Int64 IssueSetID = 0, int year = 0)
        {
            IssueSetEntity model = GetIssueSetModel(IssueSetID, year);

            if (IssueSetID == 0)
            {
                model.Status = 1;
            }
            ViewBag.year = year;

            return(View(model));
        }
예제 #7
0
        private IssueSetEntity GetIssueSetModel(Int64 IssueSetID, int year)
        {
            IssueSetQuery query = new IssueSetQuery();

            query.JournalID  = CurAuthor.JournalID;
            query.IssueSetID = IssueSetID;
            query.Year       = year;
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>();
            IssueSetEntity      model   = service.GetIssueSetModel(query);

            if (model == null)
            {
                model = new IssueSetEntity();
            }
            return(model);
        }
예제 #8
0
        public ExecResult SaveIssueSet(IssueSetEntity model)
        {
            IIssueService service = ServiceContainer.Instance.Container.Resolve <IIssueService>();

            return(service.SaveIssueSet(model));
        }
예제 #9
0
 /// <summary>
 /// 期设置是否存在
 /// </summary>
 /// <param name="issueSetEntity"></param>
 /// <returns></returns>
 public bool IssueSetIsExists(IssueSetEntity issueSetEntity)
 {
     return(IssueBusProvider.IssueSetIsExists(issueSetEntity));
 }
예제 #10
0
 /// <summary>
 /// 编辑期设置
 /// </summary>
 /// <param name="issueSetEntity"></param>
 /// <returns></returns>
 public bool UpdateIssueSet(IssueSetEntity issueSetEntity)
 {
     return(IssueBusProvider.UpdateIssueSet(issueSetEntity));
 }
예제 #11
0
 /// <summary>
 /// 新增期设置
 /// </summary>
 /// <param name="issueSetEntity"></param>
 /// <returns></returns>
 public bool AddIssueSet(IssueSetEntity issueSetEntity)
 {
     return(IssueBusProvider.AddIssueSet(issueSetEntity));
 }
예제 #12
0
 /// <summary>
 /// 期设置是否存在
 /// </summary>
 /// <param name="issueSetEntity"></param>
 /// <returns></returns>
 public bool IssueSetIsExists(IssueSetEntity issueSetEntity)
 {
     return(IssueDataAccess.Instance.IssueSetIsExists(issueSetEntity));
 }
예제 #13
0
 /// <summary>
 /// 编辑期设置
 /// </summary>
 /// <param name="issueSetEntity"></param>
 /// <returns></returns>
 public bool UpdateIssueSet(IssueSetEntity issueSetEntity)
 {
     return(IssueDataAccess.Instance.UpdateIssueSet(issueSetEntity));
 }
예제 #14
0
 /// <summary>
 /// 新增期设置
 /// </summary>
 /// <param name="issueSetEntity"></param>
 /// <returns></returns>
 public bool AddIssueSet(IssueSetEntity issueSetEntity)
 {
     return(IssueDataAccess.Instance.AddIssueSet(issueSetEntity));
 }