private void btnAdd_Click(object sender, EventArgs e)
        {
            // 呼叫新增畫面
            Forms.AddABCardSubjectNameForm asnf = new AddABCardSubjectNameForm(_ABCardTemplateTransfer.GetAllSubjectNameList());

            if (asnf.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
            {
                string SubjectName = asnf.GetAddSubjectName();
                if (!string.IsNullOrEmpty(SubjectName))
                {
                    XElement elm = new XElement("Subject");
                    elm.SetAttributeValue("label", SubjectName);
                    DAO.UDT_ABCardTemplateDefinitionDef abtdf = new DAO.UDT_ABCardTemplateDefinitionDef();
                    abtdf.SubjectName = SubjectName;
                    abtdf.Content = elm.ToString();

                    // 呼叫UDT 新增資料
                    List<DAO.UDT_ABCardTemplateDefinitionDef> addList = new List<DAO.UDT_ABCardTemplateDefinitionDef>();
                    addList.Add(abtdf);
                    DAO.UDTTransfer.InsertABCardTemplate(addList);

                    // 畫面重新載入
                    _BGRun();
                }
            }
        }
Example #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            // 呼叫新增畫面
            Forms.AddABCardSubjectNameForm asnf = new AddABCardSubjectNameForm(_ABCardTemplateTransfer.GetAllSubjectNameList());

            if (asnf.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
            {
                string SubjectName = asnf.GetAddSubjectName();
                if (!string.IsNullOrEmpty(SubjectName))
                {
                    XElement elm = new XElement("Subject");
                    elm.SetAttributeValue("label", SubjectName);
                    DAO.UDT_ABCardTemplateDefinitionDef abtdf = new DAO.UDT_ABCardTemplateDefinitionDef();
                    abtdf.SubjectName = SubjectName;
                    abtdf.Content     = elm.ToString();

                    // 呼叫UDT 新增資料
                    List <DAO.UDT_ABCardTemplateDefinitionDef> addList = new List <DAO.UDT_ABCardTemplateDefinitionDef>();
                    addList.Add(abtdf);
                    DAO.UDTTransfer.InsertABCardTemplate(addList);

                    // 畫面重新載入
                    _BGRun();
                }
            }
        }