コード例 #1
0
ファイル: Workflow.svc.cs プロジェクト: paraneye/WebService
        /**********************************************************************************************
         * Mehtod   명 : SaveWorkflowCrew
         * 개   발  자 : 양영석
         * 생   성  일 : 2014-03-04
         * 용       도 : Workflow 관련 테이블에 기본 정보들을 등록한다.
         * Input    값 : SaveWorkflowCrew(Workflow Type 코드, , TransitionStatus순번, 상세순번, 담당자순번, 담당자ID,
         *                                상태코드(Y:승인, N:대기; X:거부), 각패키지별ID, IWPID)
         * Ouput    값 : string
         **********************************************************************************************/
        /// <summary>
        /// SaveWorkflowCrew : Workflow 관련 테이블에 기본 정보들을 등록한다.
        /// </summary>
        /// <param name="WorkflowTypeCode">Workflow Type 코드</param>
        /// <param name="TransitionStatusSeq">TransitionStatus순번</param>
        /// <param name="LoginID">기안자ID</param>
        /// <param name="TransitionLst">각단계별승인자정보</param>
        /// <param name="Title">기안제목</param>
        /// <param name="Context">기안내용</param>
        /// <param name="Comment">기안자코멘트</param>
        /// <param name="TargetId">각패키지별ID</param>
        /// <param name="IwpId">IWPID</param>
        /// <returns>Document용Guid</returns>
        public SigmaResultType SaveWorkflowCrew(string WorkflowTypeCode, int TransitionStatusSeq, string LoginID, List<TypeTransition> TransitionLst, string Title, string Context, string Comment, int TargetId, int IwpId)
        {
            SigmaResultType result = new SigmaResultType();

            try
            {
                WorkflowMgr workflowMgr = new WorkflowMgr();

                 workflowMgr.SaveWorkflowCrew(WorkflowTypeCode, TransitionStatusSeq, LoginID, TransitionLst, Title, Context, Comment, TargetId, IwpId);

                 result.AffectedRow = 1;
                 result.IsSuccessful = true;
                 return result;
            }
            catch (Exception ex)
            {
                // Log Exception
                ExceptionHelper.logException(ex);
                result.IsSuccessful = false;
                result.ErrorMessage = ex.Message;
                return result;
            }
        }
コード例 #2
0
ファイル: DataSync.cs プロジェクト: paraneye/WebService
        private void RFIWorkFlowSubmit(String loginId)
        {
            // Get connection string
            string connStr = ConnStrHelper.getDbConnString();

            // Compose parameters
            SqlParameter[] parameters = new SqlParameter[] {
                    new SqlParameter("@LoginId", loginId)
                };

            DataSet ds = SqlHelper.ExecuteDataset(connStr, "usp_ListRfi", parameters);
            WorkflowMgr workflowMgr = new WorkflowMgr();
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    List<Element.Sigma.Web.Biz.Types.Common.TypeTransition> transitionList = new List<Element.Sigma.Web.Biz.Types.Common.TypeTransition>();
                    Element.Sigma.Web.Biz.Types.Common.TypeTransition typeTransition = new Element.Sigma.Web.Biz.Types.Common.TypeTransition();

                    transitionList.Add(typeTransition);
                    Common common = new Common();
                    UserInfoDTO userInfo = common.GetUserInfo(ds.Tables[0].Rows[i]["ToUserId"].ToString());

                    typeTransition.UserId = ds.Tables[0].Rows[i]["ToUserId"].ToString();
                    typeTransition.Role = userInfo.CurrentSigmaRoleId;
                    typeTransition.Row = 0;
                    transitionList.Add(typeTransition);

                    workflowMgr.GetWorkflowRoleTitle("WORKFLOW_TYPE_RFI");
                    workflowMgr.SaveWorkflowCrew("WORKFLOW_TYPE_RFI", 0, loginId, transitionList, ds.Tables[0].Rows[i]["Subject"].ToString(), ds.Tables[0].Rows[i]["ReasonRequested"].ToString(), ds.Tables[0].Rows[i]["ProposedSolution"].ToString(), (int)ds.Tables[0].Rows[i]["RfiId"], (int)ds.Tables[0].Rows[i]["IwpId"]);
                    workflowMgr.SaveWorkflowForEasyEx("WORKFLOW_TYPE_RFI", (int)ds.Tables[0].Rows[i]["RfiId"], 0, "Y", loginId, ds.Tables[0].Rows[i]["ReasonRequested"].ToString(), ds.Tables[0].Rows[i]["ProposedSolution"].ToString());

                    TransactionScope scope = null;
                    SigmaResultTypeDTO result = new SigmaResultTypeDTO();

                    List<SqlParameter> paramList = new List<SqlParameter>();
                    paramList.Add(new SqlParameter("@RfiId", (int)ds.Tables[0].Rows[i]["RfiId"]));
                    paramList.Add(new SqlParameter("@ClientRfiNo", loginId));

                    using (scope = new TransactionScope(TransactionScopeOption.Required))
                    {
                        result.AffectedRow = SqlHelper.ExecuteNonQuery(connStr, CommandType.StoredProcedure, "usp_UpdateRfi", paramList.ToArray());
                        result.IsSuccessful = true;
                        scope.Complete();
                    }
                }
            }
        }