private bool Save()
        {
            bool flag = true;

            if (!CheckData())
            {
                return(false);
            }
            GetData();
            if (mm.Guid.Equals(Guid.Empty))
            {
                mm.Guid = Guid.NewGuid();
                flag    = new DeliveryProcessOutConsole().Insert(mm, data);
                if (!flag)
                {
                    MessageBox.Show("数据有误");
                    return(false);
                }
            }
            else
            {
                flag = new DeliveryProcessOutConsole().Update(mm, data);
                if (!flag)
                {
                    MessageBox.Show("数据有误");
                    return(false);
                }
            }
            return(flag);
        }
 private void MenuItem_Click(object sender, RoutedEventArgs e)
 {
     #region  除方法
     if (this.DataGrid.SelectedCells.Count != 0)
     {
         ProductManagement_DevlieryDetailModel m = DataGrid.SelectedCells[0].Item as ProductManagement_DevlieryDetailModel;
         CellId = m.Id;
         if (!m.ProductID.Equals(Guid.Empty))
         {
             if (MessageBox.Show("是否删除此行数据?", "确认信息", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
             {
                 bool flag = new DeliveryProcessOutConsole().DeleteDetail(m);
                 if (!flag)
                 {
                     MessageBox.Show("删除不成功!未找到对应数据!");
                 }
             }
             else
             {
                 return;
             }
         }
         m.Number    = "";
         m.Name      = "";
         m.QuantityA = 0;
         m.QuantityB = 0;
         m.QuantityC = 0;
     }
     #endregion
 }