Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Wu ChengYiWu

View GitHub Profile
View gist:f39192c563a10b2be939d3c2156ba177
// TODO
const validEbPayIdCardInfoGroup = (err, values) => {
if (err && (err.eb_pay_id_card_date || err.eb_pay_id_card_place || err.eb_pay_id_from || err.eb_pay_id_pic)) {
setEbPayIdCardInfoGroupValid({
status: 'error',
message: '請填寫負責人身份證相關資訊'
});
} else {
setEbPayIdCardInfoGroupValid({ status: null, message: null });
}
@ChengYiWu
ChengYiWu / Decortor_PrintWord2.cs
Last active Jul 21, 2017
【Design Patterns】Decorator 實作與應用
View Decortor_PrintWord2.cs
public Document PrintWord2(IList<AttachmentModel> attachments){
// 「封面一」 + 「空白頁」
MeetingMinutesWordPrinter cover1 = new MinutesCoverDocumentPrinter("(附件一)"); // 產生「封面一」的文件
MeetingMinutesWordPrinter conver1WithWhitePage = new WhitePageDecorator(cover1); // 將「封面一」文件後面加入「空白頁」
// 「附件」 + 「區塊」 + 「頁碼」
MeetingMinutesWordPrinter attachment = new MinutesAttachmentPrinter(attachments); // 產生「附件」的文件
MeetingMinutesWordPrinter attachmentWithPageNumber = new PageNumberDecorator(new NewSectionDecorator(attachment)); // 將「附件」文件區域加入「頁碼」顯示
// 「封面二」 + 「區塊」
@ChengYiWu
ChengYiWu / PrintWord2.cs
Last active Jul 21, 2017
【Design Patterns】Decorator 實作與應用
View PrintWord2.cs
public Document PrintWord2(IList<PlanModel> plans){
// 產生一份空白文件
Document doc = new Document();
// 產生封面
// ...
// 產生空白頁
// ...
// 產生附件
// ...
// 設定區塊
You can’t perform that action at this time.