Exemplo n.º 1
0
        private async Task <bool> SaveSP_ROLE_DTL_SAVE(BaseDataAccess _da, MenuListByRole _item)
        {
            bool isRtnValue = true;

            #region + 파라메터 변수 선언 및 값 할당
            DataTable dtRtnValue       = null;
            var       strProcedureName = "PK_C1005.SP_ROLE_DTL_SAVE";
            Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
            string[] arrOutputParam = { "O_RSLT" };

            var strCenterCD   = this.BaseClass.CenterCD;                                            // 센터코드
            var strRoleCD     = (this.gridLeft_RoleList.SelectedItem as RoleMgnt).ROLE_CD;          // 권한코드
            var strMenuID     = _item.MENU_ID;                                                      // 메뉴 ID
            var strRoleMenuCD = _item.ROLE_MENU_CD;                                                 // 권한 타입
            var strUserID     = this.BaseClass.UserID;                                              // 사용자 ID
            #endregion

            #region + Input 파라메터
            dicInputParam.Add("P_CNTR_CD", strCenterCD);                        // 센터코드
            dicInputParam.Add("P_ROLE_CD", strRoleCD);                          // 권한코드
            dicInputParam.Add("P_MENU_ID", strMenuID);                          // 메뉴 ID
            dicInputParam.Add("P_ROLE_MENU_CD", strRoleMenuCD);                 // 권한 타입
            dicInputParam.Add("P_USER_ID", strUserID);                          // 사용자 ID
            #endregion

            #region + 데이터 조회
            await System.Threading.Tasks.Task.Run(() =>
            {
                dtRtnValue = _da.GetSpDataTable(strProcedureName, dicInputParam, arrOutputParam);
            }).ConfigureAwait(true);

            #endregion

            if (dtRtnValue != null)
            {
                if (dtRtnValue.Rows.Count > 0)
                {
                    if (dtRtnValue.Rows[0]["CODE"].ToString().Equals("0") == false)
                    {
                        var strMessage = dtRtnValue.Rows[0]["MSG"].ToString();
                        this.BaseClass.MsgError(strMessage, BaseEnumClass.CodeMessage.MESSAGE);
                        isRtnValue = false;
                    }
                }
                else
                {
                    // ERR_SAVE - 저장 중 오류가 발생했습니다.
                    this.BaseClass.MsgError("ERR_SAVE");
                    isRtnValue = false;
                }
            }

            return(isRtnValue);
        }
Exemplo n.º 2
0
        private async Task <bool> SaveSP_ROLE_DTL_SAVE(BaseDataAccess _da, MenuListByRole _item)
        {
            bool isRtnValue = true;

            #region + 파라메터 변수 선언 및 값 할당
            DataTable dtRtnValue       = null;
            var       strProcedureName = "UI_ROLE_DTL_INS";
            Dictionary <string, object> dicInputParam = new Dictionary <string, object>();
            Dictionary <object, BaseEnumClass.MSSqlOutputDataType> dicOutPutParam = new Dictionary <object, BaseEnumClass.MSSqlOutputDataType>();
            Dictionary <object, object> dicRtnValue = new Dictionary <object, object>();

            var strRoleCD     = (this.gridLeft_RoleList.SelectedItem as RoleMgnt).ROLE_CD;          // 권한코드
            var strMenuID     = _item.MENU_ID;                                                      // 메뉴 ID
            var strRoleMenuCD = _item.ROLE_MENU_CD;                                                 // 권한 타입
            var strUserID     = this.BaseClass.UserID;                                              // 사용자 ID
            #endregion

            #region + Input 파라메터
            dicInputParam.Add("ROLE_CD", strRoleCD);                            // 권한코드
            dicInputParam.Add("MENU_ID", strMenuID);                            // 메뉴 ID
            dicInputParam.Add("ROLE_MENU_CD", strRoleMenuCD);                   // 권한 타입
            dicInputParam.Add("L_USER_ID", strUserID);                          // 사용자 ID
            #endregion

            #region + Output 파라메터
            dicOutPutParam.Add("RTN_VAL", BaseEnumClass.MSSqlOutputDataType.INT32);
            dicOutPutParam.Add("RTN_MSG", BaseEnumClass.MSSqlOutputDataType.VARCHAR);
            #endregion

            #region + 데이터 조회
            await System.Threading.Tasks.Task.Run(() =>
            {
                dtRtnValue = _da.GetSpDataTable(strProcedureName, dicInputParam, dicOutPutParam, ref dicRtnValue);
            }).ConfigureAwait(true);

            #endregion

            if (dicRtnValue["RTN_VAL"].ToString().Equals("0") == false)
            {
                var strMessage = dicRtnValue["RTN_MSG"].ToString();
                this.BaseClass.MsgError(strMessage, BaseEnumClass.CodeMessage.MESSAGE);
                isRtnValue = false;
            }

            return(isRtnValue);
        }