Beispiel #1
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dgNewsList.SelectedItem == null)
                {
                    MessageWindow.Show("", "请先选择一条新闻,再进行编辑!", MessageIcon.Error, MessageWindowType.Flow);

                    return;
                }
                viewModel.CurrentEntity.ParentVM = viewModel;
                NewsView addView = new NewsView(viewModel.CurrentEntity, ViewState.UPDATE);
                SMT.SAAS.Controls.Toolkit.Windows.Window host = ProgramManager.ShowProgram("修改新闻", "", UpdateFormID, addView, true, true, null);
                addView.Reset += (obj, arg) =>
                {
                    host.Close();
                };
                host.Closed += (obj, arg) =>
                {
                    //  viewModel.Refresh();
                };
            }
            catch (Exception ex)
            {

                 
            }

        }
Beispiel #2
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dgNewsList.SelectedItem == null)
                {
                    MessageWindow.Show("", "请先选择一条新闻,再进行编辑!", MessageIcon.Error, MessageWindowType.Flow);

                    return;
                }

                NewsViewModel item = (NewsViewModel)dgNewsList.SelectedItem;
                viewModel.CurrentEntity          = item;
                viewModel.CurrentEntity.ParentVM = viewModel;
                NewsView addView = new NewsView(viewModel.CurrentEntity, ViewState.UPDATE);
                SMT.SAAS.Controls.Toolkit.Windows.Window host = ProgramManager.ShowProgram("修改新闻", "", UpdateFormID, addView, true, true, null);
                addView.Reset += (obj, arg) =>
                {
                    host.Close();
                };
                host.Closed += (obj, arg) =>
                {
                    //  viewModel.Refresh();
                };
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #3
0
 private void BtnAdd_Click(object sender, RoutedEventArgs e)
 {
     NewsViewModel wm = new NewsViewModel() { NEWSID = Guid.NewGuid().ToString(), ParentVM = viewModel };
     NewsView addView = new NewsView(wm, ViewState.ADD);
     SMT.SAAS.Controls.Toolkit.Windows.Window host = ProgramManager.ShowProgram("新建新闻", "", AddFormID, addView, true, true, null);
     addView.Reset += (obj, arg) =>
     {
         host.Close();
     };
     host.Closed += (obj, arg) =>
     {
         // viewModel.Refresh();
     };
 }
Beispiel #4
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            NewsViewModel wm = new NewsViewModel()
            {
                NEWSID = Guid.NewGuid().ToString(), ParentVM = viewModel
            };
            NewsView addView = new NewsView(wm, ViewState.ADD);

            SMT.SAAS.Controls.Toolkit.Windows.Window host = ProgramManager.ShowProgram("新建新闻", "", AddFormID, addView, true, true, null);
            addView.Reset += (obj, arg) =>
            {
                host.Close();
            };
            host.Closed += (obj, arg) =>
            {
                // viewModel.Refresh();
            };
        }