Ejemplo n.º 1
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);
		}
Ejemplo n.º 2
0
		///<summary></summary>
		public static void Update(SigElementDef def) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),def);
				return;
			}
			Crud.SigElementDefCrud.Update(def);
		}
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 6
0
		///<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);
		}
Ejemplo n.º 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;
		}
Ejemplo n.º 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);
        }
Ejemplo n.º 9
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;
		}
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
		}
Ejemplo n.º 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);
		}