Exemple #1
0
        /**********************************************************************************************
         * Mehtod   명 : SaveWorkflowForEasyEx
         * 개   발  자 : 양영석
         * 생   성  일 : 2014-03-05
         * 용       도 : 해당 Workflow에 대한 의견을 확정한다.(확장용)
         * Input    값 : SaveWorkflowForEasyEx(Workflow Type 코드, 해당ID, 해당순번, 승인여부, 로그인ID, 내용, 결재사유)
         * Ouput    값 : SigmaResultType
         **********************************************************************************************/
        /// <summary>
        /// SaveWorkflowForEasyEx : 해당 Workflow에 대한 의견을 확정한다.(확장용)
        /// </summary>
        /// <param name="WorkflowTypeCode">Workflow Type 코드</param>
        /// <param name="TargetId">해당ID</param>
        /// <param name="TargetSeq">해당순번(0일때 가장 마지막 값로딩)</param>
        /// <param name="AgreeInfo">승인여부(Y:승인, N:보류, X:거절)</param>
        /// <param name="UserID">로그인ID</param>
        /// <param name="Context">내용</param>
        /// <param name="Comment">결재사유</param>
        /// <returns>SigmaResultType</returns>
        public SigmaResultType SaveWorkflowForEasyEx(string WorkflowTypeCode, int TargetId, int TargetSeq, string AgreeInfo, string UserID, string Context, string Comment)
        {
            SigmaResultType result = new SigmaResultType();

            try
            {
                WorkflowMgr workflowMgr = new WorkflowMgr();

                workflowMgr.SaveWorkflowForEasyEx(WorkflowTypeCode, TargetId, TargetSeq, AgreeInfo, UserID, Context, Comment);

                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;
            }
        }
Exemple #2
0
        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();
                    }
                }
            }
        }