Example #1
0
        /// <summary> 
        /// 기업사용자 생성 
        /// </summary>  
        /// <param name="entrprsUserT">기업사용자 정보</param> 
        /// <returns>생성된 Row의 Key값</returns> 
        public void InsertEntrprsUser(EntrprsUserT entrprsUserT)
        {
            BeginTran();
            try
            {
                string existYn = new UserDac().SelectUserExistYn(entrprsUserT.UserId);
                if (existYn == "Y")
                {
                    // 사용자 ID 중복체크
                    throw new Exception("해당 사용자ID 는 이미 사용중입니다.");
                }

                // 사용자 생성
                UserT userT = new UserT();
                userT.UserId = entrprsUserT.UserId;
                userT.UserSeCode = "AC007002"; //사용자구분코드( 기업사용자: AC007002)

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

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

                Commit();
            }
            catch (Exception ex)
            {
                RollBack();
                throw (ex);
            }
        }
Example #2
0
 /// <summary> 
 /// 기업사용자 상태변경 
 /// </summary>  
 /// <param name="entrprsUserT">기업사용자 정보</param> 
 /// <returns>삭제된 Row 수</returns> 
 public int UpdateEntrprsUserSttusCode(EntrprsUserT entrprsUserT)
 {
     return new EntrprsUserDac().UpdateEntrprsUserSttusCode(entrprsUserT);
 }
Example #3
0
 /// <summary> 
 /// 기업사용자 수정 
 /// </summary>  
 /// <param name="entrprsUserT">기업사용자 정보</param> 
 /// <returns>수정된 Row 수</returns> 
 public int UpdateEntrprsUser(EntrprsUserT entrprsUserT)
 {
     return new EntrprsUserDac().UpdateEntrprsUser(entrprsUserT);
 }
Example #4
0
        /// <summary>
        /// 기업회원가입 등록
        /// </summary>
        /// <param name="entrprsT"></param>
        public void JoinEntrprsMember(EntrprsT entrprsT)
        {
            EntrprsDac entrprsDac = new EntrprsDac();

            long entrprsSn = 0;

            // 제조업여부
            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";

            BeginTran();

            try
            {
                //기업정보 등록
                entrprsSn = entrprsDac.InsertEntrprs(entrprsT);

                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.MngrAt = "Y"; //관리자여부
                entrprsUserT.EntrprsUserSttusCode = "AC019003"; //기업사용자상태코드(승인대기로 설정)
                entrprsUserT.RegisterSeCode = "AC007002";   //등록자구분코드( 기업사용자: AC007002)
                entrprsUserT.RegisterId = entrprsT.UserId;
                entrprsUserT.UpdusrSeCode = "AC007002";     //수정자구분코드( 기업사용자: AC007002)
                entrprsUserT.UpdusrId = entrprsT.UserId;

                //기업사용자 ID 중복체크
                string existYn = new UserDac().SelectUserExistYn(entrprsUserT.UserId);
                if (existYn == "Y")
                {
                    // 사용자 ID 중복체크
                    throw new Exception("해당 사용자ID 는 이미 사용중입니다.");
                }

                // 사용자 생성
                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;
            }
        }
Example #5
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;
            }
        }
Example #6
0
 /// <summary> 
 /// 기업사용자 상태변경 
 /// </summary>  
 /// <param name="entrprsUserT">기업사용자 정보</param> 
 /// <returns>삭제된 Row 수</returns> 
 public int UpdateEntrprsUserSttusCode(EntrprsUserT entrprsUserT)
 {
     return Js_Instance.Delete("EntrprsUserDac.UpdateEntrprsUserSttusCode", entrprsUserT);
 }
Example #7
0
 /// <summary> 
 /// 기업사용자 수정 
 /// </summary>  
 /// <param name="entrprsUserT">기업사용자 정보</param> 
 /// <returns>수정된 Row 수</returns> 
 public int UpdateEntrprsUser(EntrprsUserT entrprsUserT)
 {
     return Js_Instance.Update("EntrprsUserDac.UpdateEntrprsUser", entrprsUserT);
 }
Example #8
0
 /// <summary> 
 /// 기업사용자 생성 
 /// </summary>  
 /// <param name="entrprsUserT">기업사용자 정보</param> 
 /// <returns>생성된 Row의 Key값</returns> 
 public object InsertEntrprsUser(EntrprsUserT entrprsUserT)
 {
     return Js_Instance.Insert("EntrprsUserDac.InsertEntrprsUser", entrprsUserT);
 }