コード例 #1
0
 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);
     }
 }
コード例 #2
0
 public void DatabaseUpdate(StepTemplate item)
 {
     using (var uow = new UnitOfWork(new AppDbContext()))
     {
         uow.StepTemplates.Update(item);
         uow.Commit();
     }
 }
コード例 #3
0
 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;
 }
コード例 #4
0
        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);
        }
コード例 #5
0
 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.");
         }
     }
 }
コード例 #6
0
 public void SuperUpdate(StepTemplate item)
 {
     DatabaseUpdate(item);
     DomainUpdate(item);
 }
コード例 #7
0
 public void SuperAdd(StepTemplate item)
 {
     DatabaseAdd(item);
     DomainAdd(item);
 }
コード例 #8
0
ファイル: Step.cs プロジェクト: happylennychen/BCLabManagerV2
 public Step(StepTemplate stepTemplate)
 {
     StepTemplate = stepTemplate;
 }