Esempio n. 1
0
        public ActionResult PointHistory(CommonModel SearchParam)
        {
            try
            {
                int totalRowCnt; //개시물 총갯수

                //검색처리
                if (SearchParam.SearchKeyword != "")
                {
                    SearchParam.SearchString = string.Format(" AND memId = '{0}' ", SearchParam.SearchKeyword);
                }

                MemberPointHistoryList M = new MemberPointHistoryList
                {
                    CommonParam = SearchParam
                    ,
                    PointHistoryList = _MemberService.MemberPointHistoryList(SearchParam, out totalRowCnt)
                };

                ViewBag.totalRowCount = totalRowCnt;

                return View(M);
            }
            catch (System.Exception ex)
            {
                CustomLog4Net customLog = new CustomLog4Net();
                customLog.logger.Error(this.ControllerContext.Controller, ex);
                throw;
            }
        }
Esempio n. 2
0
        public ActionResult Index(CommonModel SearchParam)
        {
            try
            {
                int totalRowCnt; //개시물 총갯수

                if (TempData["commonModelParam"] != null)
                {
                    SearchParam = (CommonModel)TempData["commonModelParam"];
                }

                //검색처리
                if (SearchParam.SearchKeyword != "")
                {
                    if (SearchParam.SearchField == "")
                    {
                        //하...여기를 어찌해야하느냐...
                        //일단 필드가 추가되면 빌드를 다시해야하는 어처구니 없는 상황으로 내비둠.....
                        SearchParam.SearchString = string.Format(" AND ( memId Like '%{0}%' OR memName Like '%{0}%' )", SearchParam.SearchKeyword);
                    }
                    else
                    {
                        SearchParam.SearchString = string.Format(" AND {0} Like '%{1}%'", SearchParam.SearchField, SearchParam.SearchKeyword);
                    }
                }

                MemberList M = new MemberList
                {
                    PermissionCode = SearchParam.PermissionCode
                    ,
                    CommonParam = SearchParam
                    ,
                    ListInfo = _MemberService.MemberList(SearchParam, out totalRowCnt)
                };

                ViewBag.totalRowCount = totalRowCnt;

                return View(M);
            }
            catch (System.Exception ex)
            {
                CustomLog4Net customLog = new CustomLog4Net();
                customLog.logger.Error(this.ControllerContext.Controller, ex);
                throw;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 회원 포인트 적립/사용 내역 목록
        /// </summary>
        /// <param name="param"></param>
        /// <param name="outTotalRowCount"></param>
        /// <returns></returns>
        public List<SPMemberPointHistoryList_Result> MemberPointHistoryList(CommonModel param, out int outTotalRowCount)
        {
            if (!param.Page.HasValue || param.Page == 0)
            {
                param.Page = 1;
            }
            if (!param.Pagesize.HasValue || param.Pagesize == 0)
            {
                param.Pagesize = 10;
            }

            ObjectParameter totalRowCount = new ObjectParameter("totalRowCount", typeof(int));

            List<SPMemberPointHistoryList_Result> lst = new List<SPMemberPointHistoryList_Result>();
            using (MemberEntities EfContext = new MemberEntities())
            {
                lst = EfContext.SPMemberPointHistoryList(param.PermissionCode, param.Page, param.Pagesize, param.SearchString, totalRowCount).ToList();
            }

            outTotalRowCount = (int)totalRowCount.Value;

            return lst;
        }
Esempio n. 4
0
        public ActionResult ViewInfo(string memId, CommonModel param)
        {
            //파라미터가 없는 접근을 차단
            if (!NoParamValueCheck(memId))
            {
                return RedirectToAction("NoParameterValue", "Home");
            }

            if (TempData["commonModelParam"] != null)
            {
                param = (CommonModel)TempData["commonModelParam"];
            }

            MemberView M = new MemberView
            {
                CommonParam = param
                ,
                MemberInfo = _MemberService.MemberView(memId, MemberInfo.GetMemberGradeCode(), param)
            };

            //의도적인 예외처리
            if (M.MemberInfo == null)
            {
                CustomLog4Net customLog = new CustomLog4Net();
                customLog.ErrorToLog(this.ControllerContext);
                return RedirectToAction("WrongParameterValue", "Home");
            }
            return View(M);
        }
Esempio n. 5
0
        public ActionResult Delete(string permissionCode, CommonModel param, MemberDTO dto)
        {
            //파라미터가 없는 접근을 차단
            if (!NoParamValueCheck(permissionCode) || !NoParamValueCheck(dto.memId))
            {
                return RedirectToAction("NoParameterValue", "Home");
            }

            param.SearchField = Request.Params["SearchField"];
            param.SearchKeyword = Request.Params["SearchKeyword"];

            int result;

            dto.regIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

            _MemberService.MemberDelete(permissionCode, param, dto, out result);

            TempData["resultNum"] = result;
            TempData["commonModelParam"] = param;

            return RedirectToAction("", new { Page = Request.Params["Page"] });
        }
Esempio n. 6
0
        public ActionResult EditPasswordProc(string permissionCode, CommonModel param, MemberDTO dto)
        {
            //파라미터가 없는 접근을 차단
            if (!NoParamValueCheck(permissionCode) || !NoParamValueCheck(dto.memId))
            {
                return RedirectToAction("NoParameterValue", "Home");
            }

            //넘어온 인자값 확인
            if (dto.memPassword != Request.Params["memPassword2"])
            {
                return Content("<script type='text/javascript'>alert('비밀번호/비밀번호 확인 이 일치하지 않습니다.');history.go(-1);</script>");
            }

            param.SearchField = Request.Params["SearchField"];
            param.SearchKeyword = Request.Params["SearchKeyword"];

            int result;

            dto.regIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

            //비밀번호 암호화
            string noneHashPwd = dto.memPassword;
            AES256Cipher objEnc = new AES256Cipher();
            string M_PWD_MD5_HASH = objEnc.MD5Hash(noneHashPwd);   //MD5: PW -> M_PWD_MD5_HASH
            string M_PWD_SHA256_HASH = objEnc.SHA256Hash(M_PWD_MD5_HASH);   //MD5: M_PWD_MD5_HASH -> M_PWD_SHA256_HASH
            dto.memPassword = M_PWD_SHA256_HASH;

            _MemberService.MemberUpdatePassword(permissionCode, param, dto, out result);

            //http://blog.i6020345.com/life-cycle-of-tempdata-in-asp-net-mvc/
            TempData["resultNum"] = result;
            TempData["commonModelParam"] = param;

            return RedirectToAction("ViewInfo", new { memId = dto.memId, Page = Request.Params["Page"] });
        }
Esempio n. 7
0
        public ActionResult EditProc(string permissionCode, CommonModel param, MemberDTO dto)
        {
            //파라미터가 없는 접근을 차단
            if (!NoParamValueCheck(permissionCode) || !NoParamValueCheck(dto.memId))
            {
                return RedirectToAction("NoParameterValue", "Home");
            }

            param.SearchField = Request.Params["SearchField"];
            param.SearchKeyword = Request.Params["SearchKeyword"];

            int result;

            dto.regIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

            _MemberService.MemberUpdateInfo(permissionCode, param, dto, out result);

            //http://blog.i6020345.com/life-cycle-of-tempdata-in-asp-net-mvc/
            TempData["resultNum"] = result;
            TempData["commonModelParam"] = param;

            return RedirectToAction("ViewInfo", new { memId = dto.memId, Page = Request.Params["Page"] });
            //return ViewInfo(dto.memId, param);
            //return RedirectToAction(c => c.ViewInfo)
        }
Esempio n. 8
0
        /// <summary>
        /// 회원정보 삭제
        /// </summary>
        /// <param name="permissionCode"></param>
        /// <param name="param"></param>
        /// <param name="memberDTO"></param>
        /// <param name="outReturnValue"></param>
        public void MemberDelete(string permissionCode, CommonModel param, MemberDTO dto, out int outReturnValue)
        {
            ObjectParameter returnValue = new ObjectParameter("returnValue", typeof(int));

            using (MemberEntities EfContext = new MemberEntities())
            {
                EfContext.SPMemberDelete(permissionCode, dto.memId, dto.regIP, returnValue);
            }

            outReturnValue = (int)returnValue.Value;
        }
Esempio n. 9
0
        /// <summary>
        /// 회원정보 수정
        /// </summary>
        /// <param name="permissionCode"></param>
        /// <param name="param"></param>
        /// <param name="memberDTO"></param>
        /// <returns></returns>
        public void MemberUpdateInfo(string permissionCode, CommonModel param, MemberDTO dto, out int outReturnValue)
        {
            ObjectParameter returnValue = new ObjectParameter("returnValue", typeof(int));

            using (MemberEntities EfContext = new MemberEntities())
            {
                EfContext.SPMemberUpdateInfo(permissionCode, dto.memId, dto.memName, dto.memMobile
                    , dto.memSite, dto.memSMSListenYN, dto.memDMListenYN
                    , ""//dto.memPicturePath.ToString()
                    , dto.memGradeCode, dto.regIP, dto.memStatusCode, returnValue);
            }

            outReturnValue = (int)returnValue.Value;
        }
Esempio n. 10
0
 public void MemberInsert(string permissionCode, CommonModel param, MemberDTO dto, out int outReturnValue)
 {
     throw new NotImplementedException();
 }
Esempio n. 11
0
 /// <summary>
 /// 회원 정보 조회
 /// </summary>
 /// <param name="memId"></param>
 /// <param name="param"></param>
 /// <returns></returns>
 public SPMemberSelect_Result MemberView(string memId, string permissionCode, CommonModel param)
 {
     SPMemberSelect_Result result = new SPMemberSelect_Result();
     using (MemberEntities EfContext = new MemberEntities())
     {
         result = EfContext.SPMemberSelect(permissionCode, memId).FirstOrDefault();
     }
     return result;
 }