/// <summary> /// 기업변경이력 생성 /// </summary> /// <param name="entrprsChghstT">기업변경이력 정보</param> /// <returns>생성된 Row의 Key값</returns> public object InsertEntrprsChghst(EntrprsChghstT entrprsChghstT) { return new EntrprsDac().InsertEntrprsChghst(entrprsChghstT); }
/// <summary> /// 기업변경이력 생성 /// </summary> /// <param name="entrprsChghstT">기업변경이력 정보</param> /// <returns>생성된 Row의 Key값</returns> public object InsertEntrprsChghst(EntrprsChghstT entrprsChghstT) { return Js_Instance.Insert("EntrprsDac.InsertEntrprsChghst", entrprsChghstT); }
/// <summary> /// 기업정보 수정 /// </summary> /// <param name="entrprsT"></param> /// <returns></returns> public long UpdateEntrprs(EntrprsT entrprsT) { EntrprsDac entrprsDac = new EntrprsDac(); long entrprsSn = entrprsT.EntrprsSn; long updateCount = 0; // 제조업여부 entrprsT.MfcrtrAt = string.IsNullOrEmpty(entrprsT.MfcrtrAt) ? "N" : entrprsT.MfcrtrAt; // 수입업여부 entrprsT.IrtbAt = string.IsNullOrEmpty(entrprsT.IrtbAt) ? "N" : entrprsT.IrtbAt; // 수리업여부 entrprsT.RepairIndutyAt = string.IsNullOrEmpty(entrprsT.RepairIndutyAt) ? "N" : entrprsT.RepairIndutyAt; // 계량증명업여부 entrprsT.MesurProofIndutyAt = string.IsNullOrEmpty(entrprsT.MesurProofIndutyAt) ? "N" : entrprsT.MesurProofIndutyAt; // 계량기사용자여부 entrprsT.MrnrEmplyrAt = string.IsNullOrEmpty(entrprsT.MrnrEmplyrAt) ? "N" : entrprsT.MrnrEmplyrAt; BeginTran(); try { updateCount = entrprsDac.UpdateEntrprs(entrprsT); if (updateCount > 0) { //기업주소 삭제 entrprsDac.DeleteEntrprsAdres(entrprsSn); //기업주소 INSERT 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); } } //이력정보가 있는 경우 INSERT if (!String.IsNullOrEmpty(entrprsT.changeDe) && !String.IsNullOrEmpty(entrprsT.changeCn)) { EntrprsChghstT entrprsChghstT = new EntrprsChghstT(); entrprsChghstT.EntrprsSn = entrprsSn; entrprsChghstT.ChangeDe = entrprsT.changeDe; entrprsChghstT.ChangeCn = entrprsT.changeCn; entrprsChghstT.RegisterSeCode = entrprsT.RegisterSeCode; entrprsChghstT.RegisterId = entrprsT.RegisterId; entrprsDac.InsertEntrprsChghst(entrprsChghstT); } } Commit(); } catch (Exception e) { this.RollBack(); throw e; } return new EntrprsDac().UpdateEntrprs(entrprsT); }