Esempio n. 1
0
        private void AddGoodsInfo(MODEL.GoodsInfo model)
        {
            this.DgDevBoardListVisibility = Visibility.Collapsed;
            this.DgGoodsListVisibility    = Visibility.Visible;
            GoodsInfoDetailViewModel giDetailViewModel = new GoodsInfoDetailViewModel()
            {
                cmd = "Add"
            };

            giDetailViewModel.bllGoodsInfo = bllGoodsInfo;
            if (model == null)
            {
                giDetailViewModel.EditModel = new MODEL.GoodsInfo();
            }
            else
            {
                giDetailViewModel.EditModel = model;
            }
            Views.GoodsInfoDetailWindow giDetailWindow = new Views.GoodsInfoDetailWindow();
            //giDetailWindow.DataContext = giDetailViewModel;
            giDetailWindow.DataContext    = giDetailViewModel;
            giDetailWindow.tbGiCount.Text = "0";
            giDetailWindow.ShowDialog();
            RefreshGoodsInfo();
        }
Esempio n. 2
0
        private void EditGoodsInfo(MODEL.GoodsInfo model)
        {
            if (model == null)
            {
                MessageBox.Show("请先选择一行进行编辑");
                return;
            }
            this.DgDevBoardListVisibility = Visibility.Collapsed;
            this.DgGoodsListVisibility    = Visibility.Visible;
            GoodsInfoDetailViewModel gidDetailViewModel = new GoodsInfoDetailViewModel()
            {
                cmd = "Edit", EditModel = model
            };

            gidDetailViewModel.bllGoodsInfo = bllGoodsInfo;
            Views.GoodsInfoDetailWindow giDetailWindow = new Views.GoodsInfoDetailWindow();
            giDetailWindow.DataContext            = gidDetailViewModel;
            giDetailWindow.tbGIEncoder.IsReadOnly = true;
            giDetailWindow.tbGiCount.IsReadOnly   = true;
            giDetailWindow.ShowDialog();
        }