コード例 #1
0
ファイル: Workflow.svc.cs プロジェクト: paraneye/WebService
        /**********************************************************************************************
         * Mehtod   명 : GetWorkflowRoleTitle
         * 개   발  자 : 양영석
         * 생   성  일 : 2014-03-11
         * 용       도 : WorkflowRoleTitle 테이블에서 부여된 타이틀을 조회한다.
         * Input    값 : GetWorkflowRoleTitle(Scheme Code, Scheme Sequence)
         * Ouput    값 : SigmaResultType
         **********************************************************************************************/
        /// <summary>
        /// GetWorkflowRoleTitle : WorkflowRoleTitle 테이블에 부여된 타이틀을 등록한다.
        /// </summary>
        /// <param name="SchemeCode">SchemeSeq</param>
        /// <param name="SchemeSeq">SchemeSeq</param>
        /// <returns>SigmaResultType</returns>
        public SigmaResultType GetWorkflowRoleTitle(string SchemeCode, int SchemeSeq)
        {
            SigmaResultType result = new SigmaResultType();

            try
            {
                WorkflowMgr workflowMgr = new WorkflowMgr();

                // wfp_GetWorkflowRoleTitle
                result = workflowMgr.GetWorkflowRoleTitle(SchemeCode, SchemeSeq);
                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();
                    }
                }
            }
        }