Пример #1
0
		///<summary></summary>
		public static long Insert(ScheduleOp op) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				op.ScheduleOpNum=Meth.GetLong(MethodBase.GetCurrentMethod(),op);
				return op.ScheduleOpNum;
			}
			return Crud.ScheduleOpCrud.Insert(op);
		}
Пример #2
0
 ///<summary></summary>
 public static long Insert(ScheduleOp op)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         op.ScheduleOpNum = Meth.GetLong(MethodBase.GetCurrentMethod(), op);
         return(op.ScheduleOpNum);
     }
     return(Crud.ScheduleOpCrud.Insert(op));
 }
Пример #3
0
        ///<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);
            }
        }
Пример #4
0
        ///<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);
        }
Пример #5
0
		///<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.  Also inserts necessary scheduleop enteries.</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;
		}
Пример #6
0
		///<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);
			}
		}