๐Ÿ“–
BPackCore CodingConventions
  • ๊ณตํ†ต
  • Desktop Application
    • UI ๋””์ž์ธ ๋ฐ ์‹คํ–‰๊ตฌ์กฐ
    • ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ
    • ๋ช…๋ช…๊ทœ์น™ ๋ฐ ๊ตฌํ˜„
      • Model
      • IPocket
      • Pocket
      • Zipper
      • Carrying
        • Args (FormArgs)
        • MainForm
        • SubForm
        • EditForm
        • StrapControl
        • FileUp/Download
      • Tips
    • ๋‹ค๊ตญ์–ด์ฒ˜๋ฆฌ
  • Web Application - Mobile
    • UI ๋””์ž์ธ
    • ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ
    • ๋ช…๋ช…๊ทœ์น™ ๋ฐ ๊ตฌํ˜„
      • Model
      • Controller
      • View
      • Tips
    • ๋‹ค๊ตญ์–ด์ฒ˜๋ฆฌ
  • Database
    • ๋ช…๋ช…๊ทœ์น™
      • ์šฉ์–ด์‚ฌ์ „
    • SP ๊ตฌํ˜„
      • Template
      • ์ผ๋ จ๋ฒˆํ˜ธ๋ฐœํ–‰
    • ERD ์ž‘์„ฑ๊ทœ์น™ ๋ฐ ์ƒ˜ํ”Œ
  • ์†Œ์Šคํ˜•์ƒ๊ด€๋ฆฌ(Git/Gitlab)
  • WebAPI
Powered by GitBook
On this page
  • Carrying - MainForm ์ƒ์„ฑ
  • Parent Class
  • ์ฃผ์š” Field(Member) ๋ณ€์ˆ˜
  • Override Method
  • Sample
  1. Desktop Application
  2. ๋ช…๋ช…๊ทœ์น™ ๋ฐ ๊ตฌํ˜„
  3. Carrying

MainForm

PreviousArgs (FormArgs)NextSubForm

Last updated 5 years ago

Carrying - MainForm ์ƒ์„ฑ

BPack.Carrying.App ํ”„๋กœ์ ํŠธ - ์—…๋ฌด๋ชจ๋“ˆํด๋” โ€“ ํ”„๋กœ๊ทธ๋žจ์ฝ”๋“œํด๋”๋‚ด ์ƒ์„ฑ : BPack.Carrying.App.์—…๋ฌด๋ชจ๋“ˆ.ํ”„๋กœ๊ทธ๋žจ์ฝ”๋“œ.XxxMain.cs ex) BPack.Carrying.App.MM.PurInbound.PurInboundMain.cs

Parent Class

StrapMainForm

์ฃผ์š” Field(Member) ๋ณ€์ˆ˜

private PurInboundArgs _purInboundArgs; //FormArgs
private InHeaderList _inHeaderList; //ํ—ค๋” ์„œ๋ธŒํผ
private InDetailList _inDetailList; //๋””ํ…Œ์ผ ์„œ๋ธŒํผ
private InHuList _inHuList; //๋””ํ…Œ์ผ ์„œ๋ธŒํผ
private PurInboundZipper _purInboundZipper; //Zipper

Override Method

InitStrap()

MDI Container์˜ OpenForm()์— ์˜ํ•ด ํ˜ธ์ถœ๋˜๋ฉฐ, ๋ฉ”์ธํผ ์ดˆ๊ธฐํ™” ๋ฉ”์„œ๋“œ์ด๋‹ค.

public override void InitStrap()
{
    base.InitStrap();
    _purInboundArgs = new PurInboundArgs(); //FormArgs
    _inHeaderList = new InHeaderList(_purInboundArgs, _purInboundZipper); //ํ•ด๋” ์„œ๋ธŒํผ
    _inDetailList = new InDetailList(_purInboundArgs, _purInboundZipper); //๋””ํ…Œ์ผ ์„œ๋ธŒํผ
    _inHuList = new InHuList(_purInboundArgs, _purInboundZipper); //๋””ํ…Œ์ผ ์„œ๋ธŒํผ
    AddSubForm(this, _inHeaderList, layoutControlGroup2); //ํ—ค๋”์„œ๋ธŒํผ์„ Layout์— ์ถ”๊ฐ€
    AddSubForm(this, _inDetailList, layoutControlGroup3); //๋””ํ…Œ์ผ์„œ๋ธŒํผ์„ Layout์— ์ถ”๊ฐ€
    AddSubForm(this, _inHuList, layoutControlGroup4); //๋””ํ…Œ์ผ์„œ๋ธŒํผ์„ Layout์— ์ถ”๊ฐ€
    _inHeaderList.AddRefreshTargetSubForm(_inDetailList); //๋ฐ์ดํ„ฐ ๊ฐฑ์‹ ์‹œ ๋ฏธ์ €์žฅ๋ฐ์ดํ„ฐ ์ฒดํฌ
    _inHeaderList.AddRefreshTargetSubForm(_inHuList); //๋ฐ์ดํ„ฐ ๊ฐฑ์‹ ์‹œ ๋ฏธ์ €์žฅ๋ฐ์ดํ„ฐ ์ฒดํฌ
    _inDetailList.AddRefreshTargetSubForm(_inHuList); //๋ฐ์ดํ„ฐ ๊ฐฑ์‹ ์‹œ ๋ฏธ์ €์žฅ๋ฐ์ดํ„ฐ ์ฒดํฌ
    InitFields(new FieldArgs_StrapMainForm() //๋ฉ”์ธํผ ์ดˆ๊ธฐํ™” ๋ฉ”์„œ๋“œ
    {
        FormArgs = _purInboundArgs,
        InitlistForm = _inHeaderList,
        StrapLayout = strapLayout1
    });
    InitRibbonButtons(true, true, false, true, true);   //๋ฆฌ๋ณธ๋ฉ”๋‰ด ์ดˆ๊ธฐํ™”
    _inHeaderList.ModelSelectedEvent += InHeaderList_ModelSelectedEvent; //ํ—ค๋”ํผ์˜ ๋ชจ๋ธ์…€๋ ‰ํ‹ฐ๋“œ ์ด๋ฒคํŠธ
    _inDetailList.ModelSelectedEvent += InDetailList_ModelSelectedEvent; //๋””ํ…Œ์ผ ์„œ๋ธŒํผ์˜ ์…€๋ ‰ํ‹ฐ๋“œ ์ด๋ฒคํŠธ
    this.SelectedSubFormChanged += PurInboundMain_SelectedSubFormChanged; //์„œ๋ธŒํผ ์„ ํƒ ๋ณ€๊ฒฝ์‹œ ์ด๋ฒคํŠธ(๋ฆฌ๋ณธ๋ฒ„ํŠผ์กฐ์ •)
    _lep = LookUpEditPocket.GetInstance(); 
    _lep.SetByQuery(strapLookUpEdit1, "MM.PurInbound.BpList_WithAll", new
    {
        COMP_CD = Common.LoginInfo.UserInfo.CompCode
    }, "๊ฑฐ๋ž˜์ฒ˜์ฝ”๋“œ", "๊ฑฐ๋ž˜์ฒ˜๋ช…");
    strapLookUpEdit2.EditValueChanged += StrapLookUpEdit2_EditValueChanged;
    strapLookUpEdit3.EditValueChanged += StrapLookUpEdit3_EditValueChanged;
}

InitZipper()

Mdi Container์—์„œ OpenForm() ํ˜ธ์ถœ์‹œ InitZipper()์— CoreManager์—์„œ ์„ค์ •๋œ ๋ฐ์ดํ„ฐ์— ์˜ํ•ด Zipper ์ธ์Šคํ„ด์Šค๋ฅผ ํ• ๋‹นํ•œ๋‹ค.

public override void InitZipper(ZipperBase zipper)
{
    _purInboundZipper = zipper as PurInboundZipper;
}

Control ๋ช…๋ช…๊ทœ์น™

Control์˜ ๊ฐ’์€ Args Class์— ์ „๋‹ฌ ํ›„ ํ•ด๋‹น Control Name์œผ๋กœ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ๊ฐ€ ๊ฑฐ์˜ ์—†์œผ๋ฏ€๋กœ Naming Rule์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์Œ โ€“ ๊ฐœ๋ฐœ์ž ๊ฐœ๋ณ„ ํŒ๋‹จ์— ๋”ฐ๋ผ ์‚ฌ์šฉํ•  ๊ฒƒ

_purInboundArgs.PurInboundModelArgs.Select_Comp_Cd = Common.LoginInfo.UserInfo.CompCode;
_purInboundArgs.PurInboundModelArgs.Select_Main_Bp_Cd = strapLookUpEdit1.EditValue?.ToString();
_purInboundArgs.PurInboundModelArgs.Select_Main_Pih_No = strapTextEdit1.EditValue?.ToString();

โ”” Args์˜ ์†์ •์— ๊ฐ’์ด ์ „๋‹ฌ๋˜๋ฉด strapLookUpEdit1์ด๋ผ๋Š” ๋ช…์นญ์œผ๋กœ ์ ‘๊ทผํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๊ทนํžˆ ๋“œ๋ฌผ์–ด ๊ตณ์ด Name์„ ์„ค์ •ํ•  ํ•„์š”๊ฐ€ ์—†์Œ

Sample

SubForm์ด 1๊ฐœ ์ผ๋•Œ

public partial class MessageManagerMain : StrapMainForm
{
    private MessageManagerArgs _messageManagerArgs; //FormArgs
    private MessageManagerZipper _messageManagerZipper; //Zipper
    private MessageList _messageList; //SubForm
    public MessageManagerMain()
    {
        InitializeComponent();
    }
    public override void InitStrap()
    {
        base.InitStrap();
        _messageManagerArgs = new MessageManagerArgs();
        _messageList = new MessageList(_messageManagerArgs, _messageManagerZipper);
        AddSubForm(this, _messageList, layoutControlGroup2);
        InitFields(new FieldArgs_StrapMainForm() {
            FormArgs = _messageManagerArgs,
            InitlistForm = _messageList,
            StrapLayout = strapLayout1
        });
        InitRibbonButtons(true, true, true, true);
    }
    protected override void Refresh_From_ExecuteByRibbonButton()
    {
        _messageManagerArgs.MessageManagerModelArgs.Select_Msg_Title = strapTextEdit1.EditValue?.ToString();
        _messageManagerArgs.MessageManagerModelArgs.Select_Msg_Text = strapTextEdit2.EditValue?.ToString();
        base.Refresh_From_ExecuteByRibbonButton();
    }
    public override void InitZipper(ZipperBase zipper)
    {
        _messageManagerZipper = zipper as MessageManagerZipper;
    }
}