templetcode
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| templetcode [2025/07/10 01:12] – admin | templetcode [2025/12/06 07:26] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 5: | 줄 5: | ||
| ==== BaseModule class ==== | ==== BaseModule class ==== | ||
| - | 업무화면을 만들때 상속받아가는 | + | 업무화면을 만들때 상속받아진 부모 클래스 |
| | | ||
| + | public class BaseModule : XtraUserControl, | ||
| + | { | ||
| + | public BaseModule(); | ||
| + | public Dictionary< | ||
| + | public Dictionary< | ||
| + | public bool IsLoaded { get; set; } | ||
| + | public string MenuSeq { get; set; } | ||
| + | public UBiDataManager DataBase { get; set; } | ||
| + | public string ModuleCode { get; set; } | ||
| + | public string ModuleName { get; set; } | ||
| + | public UBiEditModeEnum EditMode { get; } | ||
| + | public TabbedView ParentTab { get; set; } | ||
| + | public bool IsSearched { get; set; } | ||
| + | | ||
| + | // 권한이 저장된 Attribute | ||
| + | public UBiFormAuthority Authority { get; set; } | ||
| + | public event OpenRequeatEvent EventOpenRequest; | ||
| + | public bool CreateScreen(string screenName, Dictionary< | ||
| + | public virtual void Form_Show(); | ||
| + | public BaseModule GetInstance(string screenName, string popClass = "", | ||
| + | public UBiMdiForm GetLoadPopupScreen(string screenName, string title, UBiFormAuthority authority, Dictionary< | ||
| + | public void InitAuthority(UBiFormAuthority _au); | ||
| + | public void InitLanguage(); | ||
| + | public void LoadGridViewLayout(); | ||
| + | | ||
| + | // 이 클래스를 상속받은 자식 클래스에서 구현해야할 Mathod 들... | ||
| + | public virtual bool ModuleClosing(); | ||
| + | public virtual void OnAddClick(UBiMdiForm f); | ||
| + | public virtual void OnBookMarkClick(UBiMdiForm f); | ||
| + | public virtual void OnCloseAllClick(UBiMdiForm f); | ||
| + | public virtual void OnCloseClick(UBiMdiForm f); | ||
| + | public virtual void OnDeleteClick(UBiMdiForm f); | ||
| + | public virtual void OnHelpClick(UBiMdiForm f); | ||
| + | public virtual void OnInitClick(UBiMdiForm f); | ||
| + | public virtual void OnInitLayoutClick(UBiMdiForm f); | ||
| + | public virtual void OnLoadCDTClick(UBiMdiForm f); | ||
| + | public virtual void OnLoaded(object sender, EventArgs e); | ||
| + | public virtual void OnManualClick(UBiMdiForm f); | ||
| + | public virtual void OnPrintClick(UBiMdiForm f); | ||
| + | public virtual void OnSaveCDTClick(UBiMdiForm f); | ||
| + | public virtual void OnSaveClick(UBiMdiForm f); | ||
| + | public virtual void OnSaveLayoutClick(UBiMdiForm f); | ||
| + | public virtual void OnSearchClick(UBiMdiForm f); | ||
| + | public virtual void OnSerialData(string data); | ||
| + | | ||
| + | // 이화면에서 팝업을 호출하기 위해 준비된 Mathod | ||
| + | public BaseModule OpenModal(string screenModule, | ||
| + | public void UXEventLogWrite(string LogTitle); | ||
| + | protected override void Dispose(bool disposing); | ||
| + | protected override void OnLoad(EventArgs e); | ||
| + | | ||
| + | public enum FormPermissionEnum | ||
| + | { | ||
| + | ReadOnly = 0, | ||
| + | ReadWrite = 1 | ||
| + | } | ||
| + | | ||
| + | // 이 화면이 팝업으로 불리워진다면 이벤트가 작동함 | ||
| + | public delegate void OpenRequeatEvent(object sender, string ScreenName, Dictionary< | ||
| + | } | ||
| - | ==== Templet : BaseModule 의 code 부분 설먕 ==== | ||
| - | | + | [[ux|↑ 상위로 가기]] |
| + | |||
| + | ==== Templet : BaseModule 의 code 부분 설명 ==== | ||
| + | |||
| + | | ||
| + | |||
| + | namespace UX | ||
| + | { | ||
| + | /// < | ||
| + | /// 화면명 | ||
| + | /// 화면 설명 | ||
| + | /// 작성자 : 개발자 | ||
| + | /// 작성일 : 2022-09-21 | ||
| + | /// </ | ||
| + | [ToolboxItem(false)] | ||
| + | public partial class 프로젝트명을지정하시오 : BaseModule | ||
| + | { | ||
| + | public 프로젝트명을지정하시오() | ||
| + | { | ||
| + | InitializeComponent(); | ||
| + | Load += Form_Load; | ||
| + | } | ||
| + | |||
| + | private void Form_Load(object sender, EventArgs e) | ||
| + | { | ||
| + | // 호출된 부모로부터 받은 파라미터가 있으면 처리한다. | ||
| + | if (Param != null) | ||
| + | { | ||
| + | // | ||
| + | } | ||
| + | |||
| + | // 화면활성화 되면서 최 상위 DataAdapter의 자동조회 여부가 | ||
| + | // 초기에 DataManager에 만들어진 ADapter들을 초기화 하며 자동 load된 data를 각 화면의 Lookup에 바인딩한다. | ||
| + | // DataAdapter와 연결된 GridView의 컬럼들을 그리게 된다 | ||
| + | uBiDataManager1.Init(); | ||
| + | |||
| + | 화면에 배치된 그리드 컨트롤에 필가 있다면 제거 | ||
| + | gridMain.ClearColumnsFilter(); | ||
| + | |||
| + | GridView 일정조건에서 cell에 포커스가 가지 못하게 해야하는 경우 | ||
| + | |||
| + | // gridMain.ShowingEditor += (a, b) => | ||
| + | // { | ||
| + | // if (gridMain.GetFocusedDataRow()[" | ||
| + | // { | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // } | ||
| + | // }; | ||
| + | |||
| + | 그리드 컨트롤에 특정 컬럼 ' | ||
| + | |||
| + | // | ||
| + | //{ | ||
| + | // gridSub.UpdateCurrentRow(); | ||
| + | // | ||
| + | // if (!b.IsTotalSummary | ||
| + | // || !((b.Item as GridSummaryItem).FieldName == " | ||
| + | // return; | ||
| + | // | ||
| + | // if (b.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Start) | ||
| + | // { | ||
| + | // sumAMT = 0; | ||
| + | // } | ||
| + | // if (b.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Calculate) | ||
| + | // { | ||
| + | // if (b.Row is DataRowView r) | ||
| + | // { | ||
| + | // if (r.Row[" | ||
| + | // { | ||
| + | // if ((b.Item as GridSummaryItem).FieldName == " | ||
| + | // sumAMT += (decimal)b.FieldValue; | ||
| + | // } | ||
| + | // } | ||
| + | // } | ||
| + | // | ||
| + | // if (b.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Finalize) | ||
| + | // { | ||
| + | // if ((b.Item as GridSummaryItem).FieldName == " | ||
| + | // b.TotalValue = sumAMT; | ||
| + | // } | ||
| + | //}; | ||
| + | |||
| + | cell 체인지 | ||
| + | |||
| + | // | ||
| + | //{ | ||
| + | // if (b.Column.FieldName.Equals(" | ||
| + | // { | ||
| + | // // 처리코드 여기에... | ||
| + | // } | ||
| + | //}; | ||
| + | |||
| + | 조건에 의한 Row색상 지정 | ||
| + | // gridMain.RowCellStyle += (a, b) => | ||
| + | // { | ||
| + | // | ||
| + | // if (b.RowHandle >= 0) | ||
| + | // { | ||
| + | // UBiGridView view = a as UBiGridView; | ||
| + | // if (view.GetRowCellValue(b.RowHandle, | ||
| + | // { | ||
| + | // b.Appearance.ForeColor = Color.Blue; | ||
| + | // } | ||
| + | // if (b.Column.FieldName.Equals(" | ||
| + | // { | ||
| + | // if(b.CellValue.Nvl(" | ||
| + | // b.Appearance.ForeColor = Color.Red; | ||
| + | // } | ||
| + | // } | ||
| + | //}; | ||
| + | |||
| + | } | ||
| + | |||
| + | #region === IButton Interface 버튼 구현 === | ||
| + | |||
| + | /// < | ||
| + | /// 화면의 초기화 버튼 | ||
| + | /// </ | ||
| + | public override void OnInitClick(UBiMdiForm f) | ||
| + | { | ||
| + | base.OnInitClick(f); | ||
| + | // 아래 추가코드 작성 | ||
| + | } | ||
| + | |||
| + | /// < | ||
| + | /// 조회버튼 클릭 | ||
| + | /// </ | ||
| + | public override void OnSearchClick(UBiMdiForm f) | ||
| + | { | ||
| + | base.OnSearchClick(f); | ||
| + | try | ||
| + | { | ||
| + | UBiMessageBox.ShowWait(" | ||
| + | //조회를 실행하기 위해 아래코드중 적절한 문장을 활성화 하시오 | ||
| + | //1. 컨프롤.DataAdapter.Select(true); | ||
| + | //또는 | ||
| + | //2. uBiDataManager1.GetAdapter(" | ||
| + | } | ||
| + | catch (Exception ex) | ||
| + | { | ||
| + | ex.UBiShowException(this); | ||
| + | } | ||
| + | finally | ||
| + | { | ||
| + | UBiMessageBox.CloseWait(); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | /// < | ||
| + | /// 추가버튼 클릭 | ||
| + | /// </ | ||
| + | public override void OnAddClick(UBiMdiForm f) | ||
| + | { | ||
| + | base.OnAddClick(f); | ||
| + | // 아래 추가코드 작성 | ||
| + | } | ||
| + | |||
| + | /// < | ||
| + | /// 삭제버튼 클릭 | ||
| + | /// </ | ||
| + | public override void OnDeleteClick(UBiMdiForm f) | ||
| + | { | ||
| + | base.OnDeleteClick(f); | ||
| + | // 아래 추가코드 작성 | ||
| + | |||
| + | gridMain. | ||
| + | } | ||
| + | |||
| + | /// < | ||
| + | /// 저장 버튼 클릭 | ||
| + | /// </ | ||
| + | public override void OnSaveClick(UBiMdiForm f) | ||
| + | { | ||
| + | base.OnSaveClick(f); | ||
| + | try | ||
| + | { | ||
| + | UBiMessageBox.ShowWait(" | ||
| + | // ====== 저장 예문 ======= | ||
| + | // 필요시 정합성 체크를 수행한다. | ||
| + | // ResponseDB res = 컨트롤.DataAdapter.Update(); | ||
| + | //if (res.Code == 0) | ||
| + | //{ | ||
| + | // UBiMessageBox.Show(res.Message, | ||
| + | // OnSearchClick(f); | ||
| + | //} | ||
| + | //else | ||
| + | // UBiMessageBox.Show(res.Message, | ||
| + | |||
| + | } | ||
| + | catch (Exception ex) | ||
| + | { | ||
| + | ex.UBiShowException(this); | ||
| + | } | ||
| + | finally | ||
| + | { | ||
| + | UBiMessageBox.CloseWait(); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | /// < | ||
| + | /// 메뉴얼등의 로딩처리 | ||
| + | /// </ | ||
| + | public override void OnHelpClick(UBiMdiForm f) | ||
| + | { | ||
| + | base.OnHelpClick(f); | ||
| + | // 필요시에 아래 추가코드 작성 | ||
| + | |||
| + | } | ||
| + | |||
| + | # | ||
| + | |||
| + | /// < | ||
| + | /// 화면을 닫으려 한다. | ||
| + | /// </ | ||
| + | public override void OnCloseClick(UBiMdiForm f) | ||
| + | { | ||
| + | base.OnCloseClick(f); | ||
| + | // 아래 추가코드 작성 | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | [[ux|↑ 상위로 가기]] | ||
templetcode.1752109974.txt.gz · 마지막으로 수정됨: (바깥 편집)
