private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                listChild.Title     = tbListChildTitle.Text;
                listChild.Detail    = tbListChildDetail.Text;
                listChild.StartTime = (DateTime)dtpStartTime.Value;
                listChild.EndTime   = (DateTime)dtpEndTime.Value;
                listChild.Mark      = ((MarkItem)cmbMark.SelectedItem).Mark;
                switch (dialogType)
                {
                case DialogType.Add:
                    listChild.FamilyId = selectedListFamilyId;
                    ListChild.AddListChild(listChild);
                    break;

                case DialogType.Edit:
                    ListChild.UpdateListChild(listChild);
                    break;
                }
            }
            catch (Exception ex)
            {
                App.writeLog.Error("保存失败", ex);
                MessageBox.Show("项目保存失败!\n错误日志请查看Error.log文件!", "噢噢,出错了", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            this.DialogResult = true;
        }
Example #2
0
        /// <summary>
        /// 插入帮助列表
        /// </summary>
        private void InsertHelpLists()
        {
            ListFamily whatsNewListFamily = new ListFamily
            {
                Title         = "最新更新 ",
                Detail        = ProjectVersion.GetLocalVersion().AssemblyVersion,
                DisplayWeight = listFamiliesDataTable.Rows.Count
            };

            ListFamily.AddListFamily(whatsNewListFamily);

            ListChild.AddListChild(new ListChild
            {
                Title         = "修复bug",
                Detail        = "",
                DisplayWeight = 0,
                Mark          = MarkType.Finished,
                StartTime     = new DateTime(2013, 1, 6, 11, 52, 00),
                EndTime       = DateTime.MaxValue,
                FamilyId      = ListFamily.GetListFamilyByWeight(whatsNewListFamily.DisplayWeight).Id
            });

            ListChild.AddListChild(new ListChild
            {
                Title         = "细节调整",
                Detail        = "将设置按钮名称改为属性",
                DisplayWeight = 1,
                Mark          = MarkType.Finished,
                StartTime     = new DateTime(2013, 1, 8, 9, 26, 00),
                EndTime       = DateTime.MaxValue,
                FamilyId      = ListFamily.GetListFamilyByWeight(whatsNewListFamily.DisplayWeight).Id
            });
            ListChild.AddListChild(new ListChild
            {
                Title         = "细节调整",
                Detail        = "在下方按钮中添加了上移和下移,方便移动",
                DisplayWeight = 1,
                Mark          = MarkType.Finished,
                StartTime     = new DateTime(2013, 1, 8, 9, 30, 00),
                EndTime       = DateTime.MaxValue,
                FamilyId      = ListFamily.GetListFamilyByWeight(whatsNewListFamily.DisplayWeight).Id
            });

            ListChild.AddListChild(new ListChild
            {
                Title         = "功能增加",
                Detail        = "现在可以调整窗口大小了",
                DisplayWeight = 2,
                Mark          = MarkType.Finished,
                StartTime     = new DateTime(2013, 1, 8, 14, 50, 00),
                EndTime       = DateTime.MaxValue,
                FamilyId      = ListFamily.GetListFamilyByWeight(whatsNewListFamily.DisplayWeight).Id
            });

            ReadListFamiles();
            lstListFamilies.SelectedIndex = whatsNewListFamily.DisplayWeight;

            GenerateLocalXml();
        }