示例#1
0
        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();
            }
        }
示例#2
0
 /// <summary>
 /// 状态(0 Create ,10 processing 运行,20完成 finish、30失败 falled )
 /// </summary>
 public void AddToRotationOperate(RotationOperate _RotationOperate)
 {
     using (WanTaiEntities _WanTaiEntities = new WanTaiEntities())
     {
         _WanTaiEntities.AddToRotationOperates(_RotationOperate);
         _WanTaiEntities.SaveChanges();
     }
 }