private void OnAddCommand()
 {
     IsNotAddorModify = false;
     SelectProductPartTimeEntity = new ProductPartTimeEntity();
     SelectProductPartTimeEntity.ProductPartTime = new ProductManager.Web.Model.product_part_time();
     SelectProductPartTimeEntity.ProductPartTime.start_time = DateTime.Now;
     SelectProductPartTimeEntity.StartTime = DateTime.Now;
     SelectProductPartTimeEntity.Update();
     SelectProductPartTimeEntity.ProductPartID = 1;
     SelectProductPartTimeEntity.ProductID = ProductEntity.ProductID;
     productPartTimeWindowState = ProductPartTimeWindowState.Add;
 }
 private void LoadOperationProductPartTimeCompleted(LoadOperation<ProductManager.Web.Model.product_part_time> aLoadOperation)
 {
     if (ProductPartTypeEntityDictionary != null)
     {
         String lProductPartTimeInfo = "";
         foreach (ProductManager.Web.Model.product_part_time product_part_time in aLoadOperation.Entities)
         {
             String lProductPartTimeInfoTemp = "";
             ProductPartTimeEntity productPartTimeEntity = new ProductPartTimeEntity();
             productPartTimeEntity.ProductPartTime = product_part_time;
             productPartTimeEntity.Update();
             ProductPartTypeEntity lproductPartTypeEntity;
             if (ProductPartTypeEntityDictionary.TryGetValue(productPartTimeEntity.ProductPartID, out lproductPartTypeEntity))
             {
                 lProductPartTimeInfoTemp += "[阶段:" + lproductPartTypeEntity.ProductPartTypeName + "(" + productPartTimeEntity.StartTimeString + "-" + productPartTimeEntity.FinishTimeString + ")]";
                 lProductPartTimeInfo += lProductPartTimeInfoTemp;
             }
         }
         ProductPartTimeInfo = lProductPartTimeInfo;
     }
 }
 private void LoadOperationProductPartTimeCompleted(LoadOperation<ProductManager.Web.Model.product_part_time> aLoadOperation)
 {
     ProductPartTimeEntityList.Clear();
     foreach (ProductManager.Web.Model.product_part_time product_part_time in aLoadOperation.Entities)
     {
         ProductPartTimeEntity productPartTimeEntity = new ProductPartTimeEntity();
         productPartTimeEntity.ProductPartTime = product_part_time;
         productPartTimeEntity.Update();
         ProductPartTypeEntity productPartTypeEntity;
         if (ProductPartTypeDictionary.TryGetValue(productPartTimeEntity.ProductPartID, out productPartTypeEntity))
         {
             productPartTimeEntity.ProductPartName = productPartTypeEntity.ProductPartTypeName;
         }
         ProductPartTimeEntityList.Add(productPartTimeEntity);
     }
     if (aLoadOperation.TotalEntityCount != -1)
     {
         this.productPartTimeView.SetTotalItemCount(aLoadOperation.TotalEntityCount);
     }
     UpdateChanged("ProductPartTimeEntityList");
     this.IsBusy = false;
 }