public ManageTemplate ShowTemplate(int TemplateId, int ProductId) { ManageTemplate mt = new ManageTemplate(); var product = GetById(ProductId); TemplateModel DefaultTemplate = ServerResponse.Invoke <TemplateModel>("api/template/getDetail?id=" + product.DefaultTemplateID, "", "GET"); TemplateModel MarkDownTemplate = ServerResponse.Invoke <TemplateModel>("api/template/getDetail?id=" + product.MarkDownTemplateID, "", "GET"); TemplateModel CommanTemplate = ServerResponse.Invoke <TemplateModel>("api/template/getDetail?id=" + product.DefaultTemplateID, "", "GET"); DefaultTemplate.TemplateHtml = ShowTemplate(DefaultTemplate, ProductId, "def"); CommanTemplate.TemplateHtml = ShowTemplate(CommanTemplate, ProductId, "def1"); MarkDownTemplate.TemplateHtml = ShowTemplate(MarkDownTemplate, ProductId, "mark"); mt.DefaultTemplate = DefaultTemplate; mt.MarkDownTemplate = MarkDownTemplate; mt.CommanTemplate = CommanTemplate; return(mt); }
private void btn_ManageTemplate_Click(object sender, EventArgs e) { ManageTemplate form = new ManageTemplate(); form.ShowDialog(); }