///<summary></summary>
		public static long Insert(SigElementDef def) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				def.SigElementDefNum=Meth.GetLong(MethodBase.GetCurrentMethod(),def);
				return def.SigElementDefNum;
			}
			return Crud.SigElementDefCrud.Insert(def);
		}
		///<summary></summary>
		public static void Update(SigElementDef def) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),def);
				return;
			}
			Crud.SigElementDefCrud.Update(def);
		}
示例#3
0
        ///<summary>Used by MoveUp and MoveDown.</summary>
        private static void SetOrder(int mySelNum, int myItemOrder, SigElementDef[] subList)
        {
            //No need to check RemotingRole; no call to db.
            SigElementDef temp = subList[mySelNum];

            temp.ItemOrder = myItemOrder;
            Update(temp);
        }
示例#4
0
 ///<summary></summary>
 public static long Insert(SigElementDef def)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         def.SigElementDefNum = Meth.GetLong(MethodBase.GetCurrentMethod(), def);
         return(def.SigElementDefNum);
     }
     return(Crud.SigElementDefCrud.Insert(def));
 }
示例#5
0
 ///<summary></summary>
 public static void Update(SigElementDef def)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), def);
         return;
     }
     Crud.SigElementDefCrud.Update(def);
 }
		///<summary>No need to surround with try/catch, because all deletions are allowed.  This routine, deletes references in the SigButDefElement table.  References in the SigElement table are left hanging.  The user interface needs to be able to handle missing elementdefs.</summary>
		public static void Delete(SigElementDef def) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),def);
				return;
			}
			string command="DELETE FROM sigbutdefelement WHERE SigElementDefNum="+POut.Long(def.SigElementDefNum);
			Db.NonQ(command);
			command="DELETE FROM sigelementdef WHERE SigElementDefNum ="+POut.Long(def.SigElementDefNum);
			Db.NonQ(command);
		}
示例#7
0
		///<summary></summary>
		public SigElementDef Copy() {
			SigElementDef s=new SigElementDef();
			s.SigElementDefNum=SigElementDefNum;
			s.LightRow=LightRow;
			s.LightColor=LightColor;
			s.SigElementType=SigElementType;
			s.SigText=SigText;
			s.Sound=Sound;
			s.ItemOrder=ItemOrder;
			return s;
		}
示例#8
0
        ///<summary></summary>
        public static void Delete(SigElementDef def)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), def);
                return;
            }
            string command = "DELETE FROM sigelementdef WHERE SigElementDefNum =" + POut.Long(def.SigElementDefNum);

            Db.NonQ(command);
        }
		///<summary></summary>
		public static SigElementDef[] GetSubList(SignalElementType sigElementType){
			//No need to check RemotingRole; no call to db.
			ArrayList AL=new ArrayList();
			for(int i=0;i<List.Length;i++){
				if(sigElementType==List[i].SigElementType){
					AL.Add(List[i]);
				}
			}
			SigElementDef[] retVal=new SigElementDef[AL.Count];
			AL.CopyTo(retVal);
			return retVal;
		}
示例#10
0
        ///<summary></summary>
        public SigElementDef Copy()
        {
            SigElementDef s = new SigElementDef();

            s.SigElementDefNum = SigElementDefNum;
            s.LightRow         = LightRow;
            s.LightColor       = LightColor;
            s.SigElementType   = SigElementType;
            s.SigText          = SigText;
            s.Sound            = Sound;
            s.ItemOrder        = ItemOrder;
            return(s);
        }
示例#11
0
        ///<summary></summary>
        public static SigElementDef[] GetSubList(SignalElementType sigElementType)
        {
            //No need to check RemotingRole; no call to db.
            ArrayList AL = new ArrayList();

            for (int i = 0; i < List.Length; i++)
            {
                if (sigElementType == List[i].SigElementType)
                {
                    AL.Add(List[i]);
                }
            }
            SigElementDef[] retVal = new SigElementDef[AL.Count];
            AL.CopyTo(retVal);
            return(retVal);
        }
示例#12
0
		///<summary>Moves the selected item up in the supplied sub list.</summary>
		public static void MoveUp(int selected,SigElementDef[] subList){
			//No need to check RemotingRole; no call to db.
			if(selected<0) {
				throw new ApplicationException(Lans.g("SigElementDefs","Please select an item first."));
			}
			if(selected==0) {//already at top
				return;
			}
			if(selected>subList.Length-1){
				throw new ApplicationException(Lans.g("SigElementDefs","Invalid selection."));
			}
			SetOrder(selected-1,subList[selected].ItemOrder,subList);
			SetOrder(selected,subList[selected].ItemOrder-1,subList);
			//Selected-=1;
		}
示例#13
0
		///<summary>Used by MoveUp and MoveDown.</summary>
		private static void SetOrder(int mySelNum,int myItemOrder,SigElementDef[] subList) {
			//No need to check RemotingRole; no call to db.
			SigElementDef temp=subList[mySelNum];
			temp.ItemOrder=myItemOrder;
			Update(temp);
		}