public string ConvertEnumStatusToText(RotationInfoStatus status) { if (status == RotationInfoStatus.Create) { return("新建"); } else if (status == RotationInfoStatus.Fail) { return("失败"); } else if (status == RotationInfoStatus.Finish) { return("完成"); } else if (status == RotationInfoStatus.Processing) { return("运行"); } else if (status == RotationInfoStatus.Stop) { return("停止"); } else if (status == RotationInfoStatus.Suspend) { return("暂停"); } else { return(null); } }
public void UpdataRotationOperateStatus(RotationOperate _RotationOperate, RotationInfoStatus State) { using (WanTaiEntities _WanTaiEntities = new WanTaiEntities()) { RotationOperate NewRotationOperate = _WanTaiEntities.RotationOperates.Where(rotationOperate => (rotationOperate.OperationID == _RotationOperate.OperationID && rotationOperate.RotationID == _RotationOperate.RotationID)).FirstOrDefault(); if (NewRotationOperate == null) { NewRotationOperate = new RotationOperate(); NewRotationOperate.RotationOperateID = WanTaiObjectService.NewSequentialGuid(); NewRotationOperate.StartTime = _RotationOperate.StartTime; NewRotationOperate.ExperimentID = _RotationOperate.ExperimentID; NewRotationOperate.OperationConfigurationReference.Value = _WanTaiEntities.OperationConfigurations.Where(Operation => Operation.OperationID == _RotationOperate.OperationID).FirstOrDefault(); NewRotationOperate.RotationID = _RotationOperate.RotationID; NewRotationOperate.State = (short)State; _WanTaiEntities.AddToRotationOperates(NewRotationOperate); } else { NewRotationOperate.State = (short)State; NewRotationOperate.EndTime = _RotationOperate.EndTime; NewRotationOperate.ErrorLog = _RotationOperate.ErrorLog; } _WanTaiEntities.SaveChanges(); } }
public Dictionary <Guid, RotationInfo> GetRotations(RotationInfoStatus state) { using (WanTaiEntities _WanTaiEntities = new WanTaiEntities()) { return(_WanTaiEntities.RotationInfoes.Where( P => (P.ExperimentID == SessionInfo.ExperimentID && P.State == (short)state)).ToDictionary(P => P.RotationID)); } }
public void UpdataRotationStatus(Guid RotationID, RotationInfoStatus State) { using (WanTaiEntities _WanTaiEntities = new WanTaiEntities()) { RotationInfo Rotation = _WanTaiEntities.RotationInfoes.Where(_Rotation => _Rotation.RotationID == RotationID).FirstOrDefault(); if (Rotation != null) { Rotation.State = (short)State; } _WanTaiEntities.SaveChanges(); } }
public void UpdataExperimentStatus(Guid ExperimentID, bool isFinal, ExperimentStatus State, Guid RotationID, RotationInfoStatus RotationState) { using (WanTaiEntities _WanTaiEntities = new WanTaiEntities()) { ExperimentsInfo experiment = _WanTaiEntities.ExperimentsInfoes.Where(c => c.ExperimentID == ExperimentID).FirstOrDefault(); if (experiment != null) { experiment.State = (short)State; if (isFinal) { experiment.EndTime = DateTime.Now; } } RotationInfo Rotation = _WanTaiEntities.RotationInfoes.Where(_Rotation => _Rotation.RotationID == RotationID).FirstOrDefault(); if (Rotation != null) { Rotation.State = (short)RotationState; } _WanTaiEntities.SaveChanges(); } }