示例#1
0
 public static LabGroup FromUpdateBudget(LabGroup original, double increaseAmount)
 {
     return(new LabGroup(
                original.Id,
                original.GroupNumber,
                original.Members,
                original.BudgetBalance + increaseAmount,
                original.Budget + increaseAmount,
                original.LabBenchId,
                original.LabCourseId,
                original.CheckedOut,
                original.Transactions,
                original.Status
                ));
 }
示例#2
0
 public static LabGroup FromUpdate(LabGroup original, LabGroupUpdate update)
 {
     return(new LabGroup(
                original.Id,
                update.GroupNumber,
                update.Members,
                update.BudgetBalance,
                update.Budget,
                update.LabBenchId,
                update.LabCourseId,
                original.CheckedOut,
                update.Transactions,
                update.Status
                ));
 }
示例#3
0
 public static LabGroup FromAddRemoveBench(LabGroup original, string benchId)
 {
     return(new LabGroup(
                original.Id,
                original.GroupNumber,
                original.Members,
                original.BudgetBalance,
                original.Budget,
                benchId,
                original.LabCourseId,
                original.CheckedOut,
                original.Transactions,
                original.Status
                ));
 }
示例#4
0
 public static LabGroupView FromGroup(LabGroup group)
 {
     return(new LabGroupView(
                group.Id,
                group.GroupNumber,
                group.Members,
                new List <string>(),
                group.BudgetBalance,
                group.Budget,
                group.LabBenchId,
                null,
                group.LabCourseId,
                null,
                group.CheckedOut,
                group.Transactions,
                group.Status
                ));
 }
示例#5
0
        public static LabGroup FromCheckOut(LabGroup original, string stockId)
        {
            List <string> checkedOut = original.CheckedOut;

            checkedOut.Add(stockId);

            return(new LabGroup(
                       original.Id,
                       original.GroupNumber,
                       original.Members,
                       original.BudgetBalance,
                       original.Budget,
                       original.LabBenchId,
                       original.LabCourseId,
                       checkedOut,
                       original.Transactions,
                       original.Status
                       ));
        }