Exemplo n.º 1
0
        /// <summary>
        /// SetApprovalRep
        ///     : 상신 처리 (2006.06.21)
        /// </summary>
        /// <param name="asaPrcKey"></param>
        /// <returns></returns>
        public int SetApprovalRep(string asRepEmpID, string[,] asaPrcKey)
        {
            int iTmp = 0;
            int iRet = 0;

            string sSaveAppRefID = "";  // APP_REF_ID;APP_CODE;

            string[,] saSaveAppRefID;

            string sAppRefID     = "";
            string sPrevAppRefID = "";

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Suppress))
            {
                Dac_App_Code_TypeUtility dacType = new Dac_App_Code_TypeUtility();

                // KPI 臾몄꽌踰덊샇(KPI_REF_ID);?ㅼ쟻??EVENT_ADD_ID);寃곗옱?€??APP_CODE);?됯?湲곌컙肄붾뱶(TERM_REF_ID);
                for (int i = 0; i <= asaPrcKey.GetUpperBound(0); i++)
                {
                    //sAppRefID = dacType.GetDocNo("APP");

                    while (sPrevAppRefID == sAppRefID)
                    {
                        sAppRefID = dacType.GetDocNo("APP");
                    }

                    sPrevAppRefID = sAppRefID;

                    sSaveAppRefID += sAppRefID + ";" + asaPrcKey[i, 2] + ";";

                    iTmp = SetAppTableRep(sAppRefID, asaPrcKey[i, 0], asaPrcKey[i, 1], asaPrcKey[i, 2], asRepEmpID, asaPrcKey[i, 3]);

                    // 해당 처리를 하지 못했으면 상신처리 롤백.
                    if (iTmp <= 0)
                    {
                        return(0);
                    }

                    iRet += iTmp;
                }

                scope.Complete();
            }

            #region 상신시 메일링처리
            Biz_App_Code_PageUtility biz = new Biz_App_Code_PageUtility();
            saSaveAppRefID = biz.GetSplit(sSaveAppRefID, 2);

            for (int i = 0; i <= saSaveAppRefID.GetUpperBound(0); i++)
            {
                SendAlertMail(saSaveAppRefID[i, 0], "1", saSaveAppRefID[i, 1], BSC_SendMailType.TYPE_APP_REPORT);
            }
            #endregion

            return(iRet);
        }
Exemplo n.º 2
0
        /// <summary>
        /// SetApprovalEnd
        ///     : 선택한 정보들에 대한 결재처리 로직
        /// </summary>
        /// <param name="asaPrcKey"></param>
        /// <returns></returns>
        public int SetApprovalEnd(string[,] asaPrcKey)
        {
            int iTmp = 0;
            int iRet = 0;

            string sSaveAppInfo = "";   // APP_REF_ID;APP_STEP;APP_CODE;

            string[,] saSaveAppInfo;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Suppress))
            {
                // 문서번호(V_APP_REF_ID);문서타입(V_APP_CODE);KPI문서정보(V_EVENT_ID);KPI문서추가정보(V_EVENT_ADD_ID);평가기간코드(V_TERM_REF_ID);현재결재단계(V_APP_STEP);전체결재단계(V_MAX_APP_STEP)
                for (int i = 0; i <= asaPrcKey.GetUpperBound(0); i++)
                {
                    sSaveAppInfo += asaPrcKey[i, 0] + ";" + asaPrcKey[i, 5] + ";" + asaPrcKey[i, 1] + ";";

                    // V_APP_CODE : KPIINF => KPI_INFO.CONFIRMSTATUS = 1
                    //            : KPIRST => KPI_RESULT.CONFIRMSTATUS = 1
                    iTmp = SetKPIConfirmStatus(asaPrcKey[i, 1], asaPrcKey[i, 2], asaPrcKey[i, 3], 1);

                    // 해당 처리를 하지 못했으면 결재처리 롤백.
                    if (iTmp <= 0)
                    {
                        return(0);
                    }

                    iTmp = SetAppTableApproval(asaPrcKey[i, 0], asaPrcKey[i, 5], asaPrcKey[i, 4]);

                    // 해당 처리를 하지 못했으면 결재처리 롤백.
                    if (iTmp <= 0)
                    {
                        return(0);
                    }

                    iRet += iTmp;
                }

                scope.Complete();
            }

            #region 결재시 메일링처리
            Biz_App_Code_PageUtility biz = new Biz_App_Code_PageUtility();
            saSaveAppInfo = biz.GetSplit(sSaveAppInfo, 3);

            for (int i = 0; i <= saSaveAppInfo.GetUpperBound(0); i++)
            {
                SendAlertMail(saSaveAppInfo[i, 0], saSaveAppInfo[i, 1], saSaveAppInfo[i, 2], BSC_SendMailType.TYPE_APP_APPROVAL);
            }
            #endregion

            return(iRet);
        }
Exemplo n.º 3
0
        /// <summary>
        /// SendAlertMail
        ///     : 결재시 Alert메일 발송
        /// </summary>
        /// <param name="asAppRefID"></param>
        /// <param name="enType"></param>
        /// <returns></returns>
        public void SendAlertMail(string asAppRefID, string asAppStep, string asAppCode, BSC_SendMailType enType)
        {
            string sInfo = "";

            string[,] sArray;

            DataSet lDS = new DataSet();
            Biz_App_Code_PageUtility biz = new Biz_App_Code_PageUtility();


            switch (enType)
            {
            case BSC_SendMailType.TYPE_APP_REPORT:
                // 상신했을때 첫번째 결재자에게 메일발송
                sArray = biz.GetSplit(GetSplitReportMailInfo(asAppRefID));
                sInfo  = sArray[0, 0] + ";" + sArray[1, 0] + ";" + asAppCode;

                biz.SendMail(biz.GetSplit(sInfo), sArray[2, 0], sArray[3, 0], enType);

                break;

            case BSC_SendMailType.TYPE_APP_APPROVAL:
                // 결재했을때 상신자에게 메일발송
                sArray = biz.GetSplit(GetSplitApprovalMailInfo(asAppRefID, asAppStep));
                sInfo  = sArray[0, 0] + ";" + sArray[1, 0] + ";" + asAppCode;

                biz.SendMail(biz.GetSplit(sInfo), sArray[2, 0], sArray[3, 0], enType);

                break;

            case BSC_SendMailType.TYPE_APP_CANCEL:
                // 반려했을때 상신자에게 메일발송
                sArray = biz.GetSplit(GetSplitCancelMailInfo(asAppRefID, asAppStep));
                sInfo  = sArray[0, 0] + ";" + sArray[1, 0] + ";" + asAppCode;

                biz.SendMail(biz.GetSplit(sInfo), sArray[2, 0], sArray[3, 0], enType);

                break;
            }
        }