コード例 #1
0
ファイル: ProjectController.cs プロジェクト: XiaoYaTech/Demo
        public IHttpActionResult EditProject(PostSimpleWorkflowData postData)
        {
            var wfEntity = BaseWFEntity.GetWorkflowEntity(postData.ProjectId, postData.FlowCode);
            var result   = wfEntity.Edit();

            return(Ok(result));
        }
コード例 #2
0
ファイル: ProjectController.cs プロジェクト: XiaoYaTech/Demo
        public IHttpActionResult RecallProject(PostSimpleWorkflowData postData)
        {
            ApiProxy.SetCookies(Request.RequestUri.Host, HttpContext.Current.Request.Cookies);
            var rootPath = string.Concat(HttpContext.Current.Request.Url.Scheme, @"://", HttpContext.Current.Request.Url.Authority, HttpContext.Current.Request.ApplicationPath);

            switch (postData.FlowCode)
            {
                #region Closure
            case FlowCode.Closure_WOCheckList:
            {
                var entity = ClosureWOCheckList.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/ClosureWOCheckList/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_LegalReview:
            {
                var entity = ClosureLegalReview.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/LegalReview/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_ClosurePackage:
            {
                var entity = ClosurePackage.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/ClosurePackage/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_ConsInvtChecking:
            {
                var entity = ClosureConsInvtChecking.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/ClosureConsInvtChecking/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_ClosureTool:
            {
                var entity = ClosureTool.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/closureTool/Recall", "POST", null, postDataBytes);
            }
            break;

                #endregion Closure
            default:
                var wfEntity = BaseWFEntity.GetWorkflowEntity(postData.ProjectId, postData.FlowCode);
                wfEntity.Recall(postData.ProjectComment);
                break;
            }
            return(Ok());
        }