public VMAddOrUpdateSkuEncode(SKUEncodeModel model)
 {
     _isAdd = false;
     _model = new SKUEncodeModel(model.Entity);
     this.CmdSave = new DelegateCommand(this.CmdSaveExecute);
     _bll = new BLLSKUEncodeManagement();
 }
 public AddOrUpdateSkuEncode(SKUEncodeModel model)
 {
     InitializeComponent();
     this.Title = "修改SKU编码";
     this.ViewModel = new VMAddOrUpdateSkuEncode(model);
     this.ViewModel.HandleCompleted += ViewModel_HandleCompleted;
 }
 public VMAddOrUpdateSkuEncode(SKUEncodeDetail detail)
 {
     _isAdd = true;
     _model = new SKUEncodeModel()
     {
         Code = detail.Code,
         Name = detail.Name,
         Att3ID = detail.ATT3.ID,
         Att4ID = detail.ATT4.ID,
         Att5ID = detail.ATT5.ID,
         Att6ID = detail.ATT6.ID,
         Att7ID = detail.ATT7.ID,
     };
     this.CmdSave = new DelegateCommand(this.CmdSaveExecute);
     _bll = new BLLSKUEncodeManagement();
 }
 private void GetSKUEncodeByConditionComplete(Task<List<SKUEncode>> task)
 {
     if (task.Exception != null)
     {
         this.RefreshingVisibility = Visibility.Collapsed;
         Trace.TraceError(string.Format(@"{0},{1}", DateTime.Now.ToString(), task.Exception.Message));
         MessageBox.Show("获取SKU编码信息出错!");
         return;
     }
     List<SKUEncode> list = task.Result;
     if (list == null || list.Count == 0)
     {
         this.RefreshingVisibility = Visibility.Collapsed;
         return;
     }
     SKUEncodeModel model;
     foreach (SKUEncode encode in list)
     {
         model = new SKUEncodeModel(encode);
         this.ItemsSource.Add(model);
     }
     this.RefreshingVisibility = Visibility.Collapsed;
 }