///<summary></summary>
		public SigButDefElement Copy(){
			SigButDefElement s=new SigButDefElement();
			s.ElementNum=ElementNum;
			s.SigButDefNum=SigButDefNum;
			s.SigElementDefNum=SigElementDefNum;
			return s;
		}
Example #2
0
		/*
		///<summary>This will never happen</summary>
		public void Update(){
			string command= "UPDATE SigButDefElement SET " 
				+"FromUser = '******'"
				+",ITypes = '"     +POut.PInt   ((int)ITypes)+"'"
				+",DateViewing = '"+POut.PDate  (DateViewing)+"'"
				+",SigType = '"    +POut.PInt   ((int)SigType)+"'"
				+" WHERE SigButDefElementNum = '"+POut.PInt(SigButDefElementNum)+"'";
			DataConnection dcon=new DataConnection();
 			Db.NonQ(command);
		}*/

		///<summary></summary>
		public static long Insert(SigButDefElement element) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				element.ElementNum=Meth.GetLong(MethodBase.GetCurrentMethod(),element);
				return element.ElementNum;
			}
			return Crud.SigButDefElementCrud.Insert(element);
		}
Example #3
0
		///<summary></summary>
		public static void Delete(SigButDefElement element){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),element);
				return;
			}
			string command= "DELETE from sigbutdefelement WHERE ElementNum = '"+POut.Long(element.ElementNum)+"'";
 			Db.NonQ(command);
		}
Example #4
0
        /*
         * ///<summary>This will never happen</summary>
         * public void Update(){
         *      string command= "UPDATE SigButDefElement SET "
         +"FromUser = '******'"
         +",ITypes = '"     +POut.PInt   ((int)ITypes)+"'"
         +",DateViewing = '"+POut.PDate  (DateViewing)+"'"
         +",SigType = '"    +POut.PInt   ((int)SigType)+"'"
         +" WHERE SigButDefElementNum = '"+POut.PInt(SigButDefElementNum)+"'";
         *      DataConnection dcon=new DataConnection();
         *      Db.NonQ(command);
         * }*/

        ///<summary></summary>
        public static long Insert(SigButDefElement element)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                element.ElementNum = Meth.GetLong(MethodBase.GetCurrentMethod(), element);
                return(element.ElementNum);
            }
            return(Crud.SigButDefElementCrud.Insert(element));
        }
Example #5
0
        ///<summary></summary>
        public SigButDefElement Copy()
        {
            SigButDefElement s = new SigButDefElement();

            s.ElementNum       = ElementNum;
            s.SigButDefNum     = SigButDefNum;
            s.SigElementDefNum = SigElementDefNum;
            return(s);
        }
Example #6
0
        ///<summary></summary>
        public static void Delete(SigButDefElement element)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), element);
                return;
            }
            string command = "DELETE from sigbutdefelement WHERE ElementNum = '" + POut.Long(element.ElementNum) + "'";

            Db.NonQ(command);
        }
Example #7
0
		///<summary>Loops through the SigButDefElement list and pulls out all elements for one specific button.</summary>
		public static SigButDefElement[] GetForButton(long sigButDefNum) {
			//No need to check RemotingRole; no call to db.
			ArrayList AL=new ArrayList();
			for(int i=0;i<List.Length;i++){
				if(List[i].SigButDefNum==sigButDefNum){
					AL.Add(List[i].Copy());
				}
			}
			SigButDefElement[] retVal=new SigButDefElement[AL.Count];
			AL.CopyTo(retVal);
			return retVal;
			//already ordered because List is ordered.
		}
Example #8
0
        ///<summary>Loops through the SigButDefElement list and pulls out all elements for one specific button.</summary>
        public static SigButDefElement[] GetForButton(long sigButDefNum)
        {
            //No need to check RemotingRole; no call to db.
            ArrayList AL = new ArrayList();

            for (int i = 0; i < List.Length; i++)
            {
                if (List[i].SigButDefNum == sigButDefNum)
                {
                    AL.Add(List[i].Copy());
                }
            }
            SigButDefElement[] retVal = new SigButDefElement[AL.Count];
            AL.CopyTo(retVal);
            return(retVal);
            //already ordered because List is ordered.
        }
		private void butOK_Click(object sender, System.EventArgs e) {
			if(textSynchIcon.errorProvider1.GetError(textSynchIcon)!=""
				) {
				MsgBox.Show(this,"Please fix data entry errors first.");
				return;
			}
			if(textButtonText.Text==""){
				MsgBox.Show(this,"Please enter a text description first.");
				return;
			}
			if(textSynchIcon.Text==""){
				textSynchIcon.Text="0";
			}
			ButtonCur.ButtonText=textButtonText.Text;
			ButtonCur.SynchIcon=PIn.Byte(textSynchIcon.Text);
			if(IsNew){
				SigButDefs.Insert(ButtonCur);
			}
			else{
				SigButDefs.Update(ButtonCur);
			}
			//delete all the existing elements
			SigButDefs.DeleteElements(ButtonCur);
			SigButDefElement element;
			if(comboTo.SelectedIndex!=0){
				element=new SigButDefElement();
				element.SigButDefNum=ButtonCur.SigButDefNum;
				element.SigElementDefNum=sigElementDefUser[comboTo.SelectedIndex-1].SigElementDefNum;
				SigButDefElements.Insert(element);
			}
			if(comboExtras.SelectedIndex!=0) {
				element=new SigButDefElement();
				element.SigButDefNum=ButtonCur.SigButDefNum;
				element.SigElementDefNum=sigElementDefExtras[comboExtras.SelectedIndex-1].SigElementDefNum;
				SigButDefElements.Insert(element);
			}
			if(comboMessage.SelectedIndex!=0) {
				element=new SigButDefElement();
				element.SigButDefNum=ButtonCur.SigButDefNum;
				element.SigElementDefNum=sigElementDefMessages[comboMessage.SelectedIndex-1].SigElementDefNum;
				SigButDefElements.Insert(element);
			}
			DialogResult=DialogResult.OK;
		}