Exemple #1
0
    public static bool CheckOverLapId(string pId)
    {
        if (!string.IsNullOrEmpty(pId.Trim()))
        {
            BizMember bizMember = new BizMember();
            BmMember bmMember = new BmMember();

            bmMember.Id = pId;

            var result = bizMember.GetMemberList(bmMember);

            if (result.Count == 0)
            {
                return true;
            }
        }

        return false;
    }
Exemple #2
0
    /// <summary>Member 등록</summary>
    private void InsertMember()
    {
        string strMsg = "";

        BizMember bizMember = new BizMember();
        BmMember bmMemberRq = new BmMember();

        bmMemberRq.Id = tbxId.Text;

        var checkId = bizMember.GetMemberList(bmMemberRq);

        if (checkId.Count == 0)
        {
            #region Set InsertModel Rq

            bmMemberRq.Id = tbxId.Text;
            bmMemberRq.Pw = tbxPw.Text;
            bmMemberRq.Name = tbxNm.Text;
            bmMemberRq.Addr = tbxAddr.Text;
            bmMemberRq.Sex = ddlSex.SelectedValue;
            bmMemberRq.Lv = Convert.ToInt32(ddlLevel.SelectedValue);
            bmMemberRq.Cash = Convert.ToDouble(tbxCash.Text);
            bmMemberRq.Point = Convert.ToDouble(tbxPoint.Text);
            bmMemberRq.State = Convert.ToInt32(ddlUserState.SelectedValue);
            bmMemberRq.Registrant = LoginMgr.Id;

            #endregion Set InsertModel Rq

            bool result = bizMember.InsertMember(bmMemberRq);

            if (result)
            {
                strMsg = "회원 등록이 완료 되었습니다.";

                strId = tbxId.Text;
                GetMember();
            }
            else
            {
                strMsg = "회원 등록이 실패하였습니다.";
            }
        }
        else
        {
            strMsg = "이미 존재하는 ID입니다.";
        }
        SetAndShowCmmModal("회원등록", strMsg);
    }
Exemple #3
0
    /// <summary>Member 수정</summary>
    private void ModifyMember()
    {
        string strMsg = "";

        BizMember bizMember = new BizMember();

        #region Set UpdateModel Rq

        upMemberRq.Pw = tbxPw.Text;
        upMemberRq.Name = tbxNm.Text;
        upMemberRq.Addr = tbxAddr.Text;
        upMemberRq.Sex = ddlSex.SelectedValue;
        upMemberRq.Lv = Convert.ToInt32(ddlLevel.SelectedValue);
        upMemberRq.Cash = Convert.ToDouble(tbxCash.Text);
        upMemberRq.Point = Convert.ToDouble(tbxPoint.Text);
        upMemberRq.State = Convert.ToInt32(ddlUserState.SelectedValue);
        upMemberRq.Modifyer = LoginMgr.Id;

        #endregion Set UpdateModel Rq

        bool result = bizMember.UpdateMember(upMemberRq);

        if (result)
        {
            strMsg = "회원 수정이 완료 되었습니다.";
            iSeq = upMemberRq.Seq;
            GetMember();
        }
        else
        {
            strMsg = "회원 수정이 실패하였습니다.";
        }

        SetAndShowCmmModal("회원수정", strMsg);
    }
Exemple #4
0
    /// <summary>회원 삭제</summary>
    private void DeleteMember(int pSeq)
    {
        string strMsg = "";

        if (pSeq > 0)
        {
            BmMember bmMember = new BmMember();
            BizMember bizMember = new BizMember();

            bmMember = vwMemberList.FirstOrDefault(o => o.Seq.Equals(pSeq));

            if (bmMember != null)
            {
                bmMember.Modifyer = LoginMgr.Id;

                bool result = bizMember.DeleteMember(bmMember);

                if (result)
                {
                    strMsg = "회원삭제가 완료되었습니다.";
                }
                else
                {
                    strMsg = "회원삭제에 실패하였습니다.";
                }
            }
        }
        else
        {
            strMsg = "잘못된 회원입니다.";
        }

        SetAndShowCmmModal("회원삭제", strMsg);

        ucPaging.CurPage = 0;
        Search();
        ucPaging.ReSetPageControl();
    }
Exemple #5
0
    /// <summary>멤버 가져오기</summary>
    private void GetMember()
    {
        if (iSeq != 0 || !string.IsNullOrEmpty(strId.Trim()))
        {
            BizMember bizMember = new BizMember();
            BmMember bmMember = new BmMember();

            if (iSeq != 0) { bmMember.Seq = iSeq; }
            if (!string.IsNullOrEmpty(strId)) { bmMember.Id = strId; }

            var result = bizMember.GetMemberList(bmMember);

            if (result.Count == 1)
            {
                upMemberRq = result[0];
                ViewState["upMemberRq"] = upMemberRq;

                BindCtrls(result[0]);
            }
            else
            {
                ResetControl();
            }
        }
        else
        {
            ResetControl();
        }
    }
Exemple #6
0
    private void Search()
    {
        BizMember bizMember = new BizMember();
        BmMemberPagingRq bmMemberRq = new BmMemberPagingRq();

        #region Set Rq

        bmMemberRq.Paging.CurPage = ucPaging.CurPage;
        bmMemberRq.Paging.PageSize = ucPaging.PageSize;

        if (string.IsNullOrEmpty(tbxSearch.Text) == false)
        {
            if (ddlSearchType.SelectedValue == "Id")
            {
                bmMemberRq.Member.Id = tbxSearch.Text;
            }
            else
            {
                bmMemberRq.Member.Name = tbxSearch.Text;
            }
        }

        #endregion Set Rq

        var result = bizMember.GetMemberPagingList(bmMemberRq);

        ucPaging.TotalRowCount = result.TotalCount;
        vwMemberList = result.List;

        rptMemberList.DataSource = vwMemberList;
        rptMemberList.DataBind();
    }
Exemple #7
0
    /// <summary>관리자 수정</summary>
    private void ModifyAdminMember()
    {
        string strMsg = "";

        BizMember bizMember = new BizMember();

        #region Set UpdateModel Rq

        BmAdminMember upBmAdminMember = vwBmAdminMember;

        upBmAdminMember.Pw = tbxPw.Text;
        upBmAdminMember.Name = tbxNm.Text;
        upBmAdminMember.AuthLevel = Convert.ToInt32(ddlAuthLevel.SelectedValue);
        upBmAdminMember.State = Convert.ToInt32(ddlState.SelectedValue);
        upBmAdminMember.Modifyer = LoginMgr.Id;

        #endregion Set UpdateModel Rq

        bool result = bizMember.UpdateAdminMember(upBmAdminMember);

        if (result)
        {
            strMsg = "관리자 수정이 완료 되었습니다.";

            ListSearch();
            BindAdminMemberDetail(upBmAdminMember.Seq);
        }
        else
        {
            strMsg = "관리자 수정이 실패하였습니다.";
        }

        SetAndShowCmmModal("관리자 수정", strMsg);
    }
Exemple #8
0
    /// <summary>관리자 등록</summary>
    private void InsertAdminMember()
    {
        string strMsg = "";

        BizMember bizMember = new BizMember();
        BmAdminMember bmAdminMemberRq = new BmAdminMember();

        bmAdminMemberRq.Id = tbxId.Text;

        var checkId = bizMember.GetAdminMemberList(bmAdminMemberRq);

        if (checkId.Count == 0)
        {
            #region Set InsertModel Rq

            bmAdminMemberRq.Id = tbxId.Text;
            bmAdminMemberRq.Pw = tbxPw.Text;
            bmAdminMemberRq.Name = tbxNm.Text;
            bmAdminMemberRq.AuthLevel = Convert.ToInt32(ddlAuthLevel.SelectedValue);
            bmAdminMemberRq.State = Convert.ToInt32(ddlState.SelectedValue);
            bmAdminMemberRq.Registrant = LoginMgr.Id;

            #endregion Set InsertModel Rq

            bool result = bizMember.InsertAdminMember(bmAdminMemberRq);

            if (result)
            {
                strMsg = "관리자 등록이 완료 되었습니다.";

                ListSearch();
                BindAdminMemberDetail(vwBmAdminMemberList.FirstOrDefault(o => o.Id.Equals(bmAdminMemberRq.Id)).Seq);
            }
            else
            {
                strMsg = "관리자 등록이 실패하였습니다.";
            }
        }
        else
        {
            strMsg = "이미 존재하는 ID입니다.";
        }
        SetAndShowCmmModal("관리자 등록", strMsg);
    }
Exemple #9
0
        /// <summary>현재 접속중인 세션아이디 가져오기</summary>
        private static string GetConnectSession(int pSeq)
        {
            BizMember bizMember = new BizMember();
            BmAdminMember bmAdminMember = new BmAdminMember();

            bmAdminMember.Seq = pSeq;
            var result = bizMember.GetAdminMemberList(bmAdminMember)[0];

            return result.SessionId;
        }
Exemple #10
0
        /// <summary>로그인</summary>
        /// <returns>
        /// 0 = 성공
        /// , -1 = 비밀번호 오류
        /// , -2 = 아이디 오류
        /// , -3 = 세션 갱신 실패
        /// , -4 = Exception
        /// , -5 = 접속로그 오류
        /// </returns>
        public static int Login(string Id, string Pw)
        {
            try
            {
                HttpContext context = HttpContext.Current;

                BizMember bizMember = new BizMember();
                BmAdminMember bmAdminMember = new BmAdminMember();

                bmAdminMember.Id = Id;
                bmAdminMember.State = 1;

                var AccountList = bizMember.GetAdminMemberList(bmAdminMember);

                if (AccountList.Count == 1)
                {
                    BmAdminMember Account = AccountList[0];

                    if (Pw == Account.Pw)
                    {
                        Account.SessionId = context.Session.SessionID;
                        SessionId = context.Session.SessionID;

                        if (bizMember.UpdateAdminMemberSession(Account))
                        {
                            BizLog bizLog = new BizLog();
                            BmConnectLog bmConnectLog = new BmConnectLog();

                            //접속세션이 없을시 접속세션 등록
                            if (context.Session["ConnectSeq"] == null)
                            {
                                bmConnectLog.ReconnectYn = "Y";

                                bmConnectLog.SessionId = context.Session.SessionID;

                                bmConnectLog.Ip = context.Request.ServerVariables["REMOTE_ADDR"] != null ? context.Request.ServerVariables["REMOTE_ADDR"] : "";
                                bmConnectLog.LinkUrl = context.Request.ServerVariables["HTTP_REFERER"] != null ? context.Request.ServerVariables["HTTP_REFERER"] : "";

                                context.Session["ConnectSeq"] = bizLog.InsertConnectLogScalar(bmConnectLog);
                            }

                            bmConnectLog.Seq = (int)context.Session["ConnectSeq"];
                            bmConnectLog.Id = bmAdminMember.Id;

                            //접속로그 로그인Id, 시간 업데이트
                            if (bizLog.UpdateLoginLog(bmConnectLog))
                            {
                                //로그인 성공 세션 등록
                                foreach (string colName in strLoginColumnArray)
                                {
                                    Type t = Account.GetType();
                                    context.Session.Add("Login" + colName, t.GetProperties().FirstOrDefault(o => o.Name.Equals(colName)).GetValue(Account).ToString());
                                }
                                return 0;
                            }
                            //접속 로그 오류
                            else
                                return -5;
                        }
                        else
                        {
                            //세션 갱신 실패
                            return -3;
                        }
                    }
                    else
                    {
                        //비밀번호가 다를 경우
                        return -1;
                    }
                }
                else
                {
                    //아이디가 1개가 아닐경우
                    return -2;
                }
            }
            catch (Exception ex)
            {
                _cLib.WriteLog("Exception", ex.Message);
                return -4;
            }
        }