///<summary></summary> public static void Update(Schedule sched) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), sched); return; } Validate(sched); Crud.ScheduleCrud.Update(sched); string command = "DELETE FROM scheduleop WHERE ScheduleNum=" + POut.Long(sched.ScheduleNum); Db.NonQ(command); ScheduleOp op; for (int i = 0; i < sched.Ops.Count; i++) { op = new ScheduleOp(); op.ScheduleNum = sched.ScheduleNum; op.OperatoryNum = sched.Ops[i]; ScheduleOps.Insert(op); } }
///<summary>Set validate to true to throw an exception if start and stop times need to be validated. If validate is set to false, then the calling code is responsible for the validation.</summary> public static long Insert(Schedule sched, bool validate) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { sched.ScheduleNum = Meth.GetLong(MethodBase.GetCurrentMethod(), sched, validate); return(sched.ScheduleNum); } if (validate) { Validate(sched); } Crud.ScheduleCrud.Insert(sched); ScheduleOp op; for (int i = 0; i < sched.Ops.Count; i++) { op = new ScheduleOp(); op.ScheduleNum = sched.ScheduleNum; op.OperatoryNum = sched.Ops[i]; ScheduleOps.Insert(op); } return(sched.ScheduleNum); }