本文整理汇总了C#中Procedure.CheckOut方法的典型用法代码示例。如果您正苦于以下问题:C# Procedure.CheckOut方法的具体用法?C# Procedure.CheckOut怎么用?C# Procedure.CheckOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Procedure
的用法示例。
在下文中一共展示了Procedure.CheckOut方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryAutoCheckOut
/// <summary>
/// Helper method implements some fuzzy logic to try and determine whether the procedure
/// should be checked-out, and check it out if necessary.
/// </summary>
/// <param name="rp"></param>
/// <param name="timestamp"></param>
protected void TryAutoCheckOut(Procedure rp, DateTime? timestamp)
{
if (rp.IsCheckedIn)
{
var allMpsTerminated = rp.ModalityProcedureSteps.TrueForAll(mps => mps.IsTerminated);
if (allMpsTerminated)
{
// auto check-out
rp.CheckOut(timestamp);
}
}
}
示例2: Test_CheckOut
public void Test_CheckOut()
{
DateTime? now = DateTime.Now;
var procedure = new Procedure { ProcedureCheckIn = new ProcedureCheckIn() };
var regStep = new RegistrationProcedureStep(procedure);
var staff = TestStaffFactory.CreateStaff();
procedure.CheckIn(staff, now);
Assert.IsFalse(procedure.IsPreCheckIn);
Assert.IsTrue(procedure.IsCheckedIn);
Assert.IsFalse(procedure.IsCheckedOut);
Assert.AreEqual(ActivityStatus.IP, regStep.State);
Assert.IsNull(regStep.EndTime);
procedure.CheckOut(now);
Assert.IsFalse(procedure.IsPreCheckIn);
Assert.IsFalse(procedure.IsCheckedIn);
Assert.IsTrue(procedure.IsCheckedOut);
Assert.AreEqual(now, procedure.ProcedureCheckIn.CheckOutTime);
Assert.AreEqual(ActivityStatus.CM, regStep.State);
Assert.AreEqual(staff, regStep.PerformingStaff);
Assert.AreEqual(now, regStep.EndTime);
}