public void DomainAdd(StepTemplate item)
 {
     if (!Items.Any(o => o.CurrentInput == item.CurrentInput && o.CurrentUnit == item.CurrentUnit && o.CutOffConditionValue == item.CutOffConditionValue && o.CutOffConditionType == item.CutOffConditionType))
     {
         Items.Add(item);
     }
 }
 public void DatabaseUpdate(StepTemplate item)
 {
     using (var uow = new UnitOfWork(new AppDbContext()))
     {
         uow.StepTemplates.Update(item);
         uow.Commit();
     }
 }
 public void DomainUpdate(StepTemplate item)
 {
     //var edittarget = Items.SingleOrDefault(o => o.Id == item.Id);
     //edittarget.BatteryType = item.BatteryType;
     //edittarget.Name = item.Name;
     //edittarget.CycleCount = item.CycleCount;
     //edittarget.AssetUseCount = item.AssetUseCount;
     //edittarget.Records = item.Records;
 }
        private StepTemplate CreateRCStepTemplate(double currentInput, CurrentUnitEnum currentUnit, double cutOffConditionValue, CutOffConditionTypeEnum cutOffConditionType, StepTemplateServiceClass stepTemplateService)
        {
            var output = new StepTemplate()
            {
                CurrentInput = currentInput, CurrentUnit = currentUnit, CutOffConditionValue = cutOffConditionValue, CutOffConditionType = cutOffConditionType
            };

            stepTemplateService.SuperAdd(output);
            return(output);
        }
 public void DatabaseAdd(StepTemplate item)
 {
     using (var uow = new UnitOfWork(new AppDbContext()))
     {
         if (!uow.StepTemplates.GetAll().Any(o => o.CurrentInput == item.CurrentInput && o.CurrentUnit == item.CurrentUnit && o.CutOffConditionValue == item.CutOffConditionValue && o.CutOffConditionType == item.CutOffConditionType))
         {
             uow.StepTemplates.Insert(item);
             uow.Commit();
         }
         else
         {
             MessageBox.Show("Already existed.");
         }
     }
 }
 public void SuperUpdate(StepTemplate item)
 {
     DatabaseUpdate(item);
     DomainUpdate(item);
 }
 public void SuperAdd(StepTemplate item)
 {
     DatabaseAdd(item);
     DomainAdd(item);
 }
Beispiel #8
0
 public Step(StepTemplate stepTemplate)
 {
     StepTemplate = stepTemplate;
 }