/// <summary>
        /// 아이디 중복확인 팝업 화면
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public ActionResult DuplicateUserIdPopup(string userId, string returnHandler)
        {
            string existYn = new UserBiz().SelectUserExistYn(userId);

            ViewBag.UserId = userId;
            ViewBag.ReturnHandler = returnHandler;
            ViewBag.ExistYn = existYn;

            return View();
        }
 /// <summary>
 /// ID,비밀번호 찾기결과 팝업 화면
 /// </summary>
 /// <param name="userT"></param>
 /// <returns></returns>
 public ActionResult SearchIdPwPopup(UserT userT)
 {
     userT = new UserBiz().FindIdPw(userT);
     return View(userT);
 }
Beispiel #3
0
        /// <summary>
        /// 기업회원정보 수정
        /// </summary>
        /// <param name="entrprsT"></param>
        public void UpdateEntrprsMember(EntrprsT entrprsT)
        {
            EntrprsDac entrprsDac = new EntrprsDac();

            long entrprsSn = entrprsT.EntrprsSn;
            long updateCount = 0;
            string EntrprsAuthCD = "AC019003";

            // 제조업여부
            entrprsT.MfcrtrAt = string.IsNullOrEmpty(entrprsT.MfcrtrAt) ? "N" : "Y";

            // 수입업여부
            entrprsT.IrtbAt = string.IsNullOrEmpty(entrprsT.IrtbAt) ? "N" : "Y";

            // 수리업여부
            entrprsT.RepairIndutyAt = string.IsNullOrEmpty(entrprsT.RepairIndutyAt) ? "N" : "Y";

            // 계량증명업여부
            entrprsT.MesurProofIndutyAt = string.IsNullOrEmpty(entrprsT.MesurProofIndutyAt) ? "N" : "Y";

            // 계량기사용자여부
            entrprsT.MrnrEmplyrAt = string.IsNullOrEmpty(entrprsT.MrnrEmplyrAt) ? "N" : "Y";

            //계량기사용자여부 판별후 승인대기or승인
            if (entrprsT.MfcrtrAt == "N" && entrprsT.IrtbAt == "N" && entrprsT.RepairIndutyAt == "N" && entrprsT.MesurProofIndutyAt == "N")
            {
                if (entrprsT.MrnrEmplyrAt == "Y")
                {
                    EntrprsAuthCD = "AC019001"; //기업사용자상태코드(승인 설정)
                }
                else
                {
                    EntrprsAuthCD = "AC019003"; //기업사용자상태코드(승인 설정)
                }
            }

            BeginTran();

            try
            {
                //회원여부 상태 업데이트 - 기존입력된 회원업체 DB 때문
                entrprsT.MberAt = "Y";

                //기업정보 수정
                updateCount = entrprsDac.UpdateEntrprs(entrprsT);

                if (updateCount > 0)
                {
                    entrprsDac.DeleteEntrprsAdres(entrprsSn);

                    if (entrprsT.entrprsAdresList != null && entrprsT.entrprsAdresList.Count > 0)
                    {
                        for (int i = 0; i < entrprsT.entrprsAdresList.Count; i++)
                        {
                            EntrprsAdresT entrprsAdresT = entrprsT.entrprsAdresList[i];
                            entrprsAdresT.EntrprsSn = entrprsSn;

                            entrprsDac.InsertEntrprsAdres(entrprsAdresT);
                        }
                    }
                }

                EntrprsUserT entrprsUserT = new EntrprsUserT();
                entrprsUserT.EntrprsSn = entrprsSn;
                entrprsUserT.UserId = entrprsT.UserId;
                entrprsUserT.UserNm = entrprsT.UserNm;
                entrprsUserT.Telno = entrprsT.Telno;
                entrprsUserT.Mbtlnum = entrprsT.Mbtlnum;
                entrprsUserT.EmailAdres = entrprsT.EmailAdres;
                entrprsUserT.MberAt = entrprsT.MberAt;

                //TODO 변경사항
                entrprsUserT.MngrAt = "Y"; //관리자여부
                //entrprsUserT.EntrprsUserSttusCode = "AC019003";   //기업사용자상태코드(승인대기)
                entrprsUserT.EntrprsUserSttusCode = EntrprsAuthCD;  //기업사용자상태코드
                entrprsUserT.RegisterSeCode = "AC007002";   //등록자구분코드( 기업사용자: AC007002)
                entrprsUserT.RegisterId = entrprsT.UserId;
                entrprsUserT.UpdusrSeCode = "AC007002";     //수정자구분코드( 기업사용자: AC007002)
                entrprsUserT.UpdusrId = entrprsT.UserId;

                /**/
                string existYn = new UserBiz().SelectUserExistYn(entrprsT.UserId);
                if (existYn == "Y")
                {
                    // 기업사용자 UPDATE
                    new EntrprsUserDac().UpdateEntrprsUser(entrprsUserT);
                }
                else
                {
                    // 사용자 생성
                    UserT userT = new UserT();
                    userT.UserId = entrprsUserT.UserId;
                    userT.Password = Security.Security.Encrypt(entrprsT.Password);
                    userT.UserSeCode = "AC007002"; //사용자구분코드( 기업사용자: AC007002)

                    new UserBiz().InsertUser(userT, "N");

                    // 기업사용자 INSERT
                    new EntrprsUserDac().InsertEntrprsUser(entrprsUserT);
                }

                Commit();
            }
            catch (Exception e)
            {
                this.RollBack();
                throw e;
            }
        }