BPack.Carrying.App ํ๋ก์ ํธ - ์
๋ฌด๋ชจ๋ํด๋ โ ํ๋ก๊ทธ๋จ์ฝ๋ํด๋๋ด ์์ฑ
: BPack.Carrying.App.์
๋ฌด๋ชจ๋.ํ๋ก๊ทธ๋จ์ฝ๋.XxxMain.cs
ex) BPack.Carrying.App.MM.PurInbound.PurInboundMain.cs
private PurInboundArgs _purInboundArgs; //FormArgs
private InHeaderList _inHeaderList; //ํค๋ ์๋ธํผ
private InDetailList _inDetailList; //๋ํ
์ผ ์๋ธํผ
private InHuList _inHuList; //๋ํ
์ผ ์๋ธํผ
private PurInboundZipper _purInboundZipper; //Zipper
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;
}
Mdi Container์์ OpenForm() ํธ์ถ์ InitZipper()์ CoreManager์์ ์ค์ ๋ ๋ฐ์ดํฐ์ ์ํด Zipper ์ธ์คํด์ค๋ฅผ ํ ๋นํ๋ค.
public override void InitZipper(ZipperBase zipper)
{
_purInboundZipper = zipper as PurInboundZipper;
}
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์ ์ค์ ํ ํ์๊ฐ ์์
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;
}
}