Esempio n. 1
0
		///<summary></summary>
		public static void Update(PhoneNumber phoneNumber) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),phoneNumber);
				return;
			}
			Crud.PhoneNumberCrud.Update(phoneNumber);
		}
Esempio n. 2
0
		///<summary></summary>
		public static long Insert(PhoneNumber phoneNumber) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				phoneNumber.PhoneNumberNum=Meth.GetLong(MethodBase.GetCurrentMethod(),phoneNumber);
				return phoneNumber.PhoneNumberNum;
			}
			return Crud.PhoneNumberCrud.Insert(phoneNumber);
		}
Esempio n. 3
0
		public static void Add(PhoneTile tile){
			//if(selectedTile.PhoneCur==null) {//already validated
			if(tile.PhoneCur.CustomerNumber=="") {
				MsgBox.Show(langThis,"No phone number present.");
				return;
			}
			long patNum=tile.PhoneCur.PatNum;
			if(FormOpenDental.CurPatNum==0) {
				MsgBox.Show(langThis,"Please select a patient in the main window first.");
				return;
			}
			if(patNum!=0) {
				MsgBox.Show(langThis,"The current number is already attached to a different customer.");
				return;
				//if(!MsgBox.Show(langThis,MsgBoxButtons.OKCancel,"The current number is already attached to a patient. Attach it to this patient instead?")) {
				//	return;
				//}
				//This crashes because we don't actually know what the number is.  Enhance later by storing actual number in phone grid.
				//PhoneNumber ph=PhoneNumbers.GetByVal(tile.PhoneCur.CustomerNumber);
				//ph.PatNum=FormOpenDental.CurPatNum;
				//PhoneNumbers.Update(ph);
			}
			else {
				string patName=Patients.GetLim(FormOpenDental.CurPatNum).GetNameLF();
				if(MessageBox.Show("Attach this phone number to "+patName+"?","",MessageBoxButtons.OKCancel)!=DialogResult.OK) {
					return;
				}
				PhoneNumber ph=new PhoneNumber();
				ph.PatNum=FormOpenDental.CurPatNum;
				ph.PhoneNumberVal=tile.PhoneCur.CustomerNumber;
				PhoneNumbers.Insert(ph);
			}
			//tell the phone server to refresh this row with the patient name and patnum
			DataValid.SetInvalid(InvalidType.PhoneNumbers);
		}
Esempio n. 4
0
		private void menuItemAdd_Click(object sender,EventArgs e) {
			if(FormOpenDental.CurPatNum==0) {
				MsgBox.Show(this,"Please select a patient in the main window first.");
				return;
			}
			if(PhoneList[rowI].PatNum!=0) {
				if(!MsgBox.Show(this,MsgBoxButtons.OKCancel,"The current number is already attached to a patient. Attach it to this patient instead?")) {
					return;
				}
				PhoneNumber ph=PhoneNumbers.GetByVal(PhoneList[rowI].CustomerNumber);
				ph.PatNum=FormOpenDental.CurPatNum;
				PhoneNumbers.Update(ph);
			}
			else {
				string patName=Patients.GetLim(FormOpenDental.CurPatNum).GetNameLF();
				if(MessageBox.Show("Attach this phone number to "+patName+"?","",MessageBoxButtons.OKCancel)!=DialogResult.OK) {
					return;
				}
				PhoneNumber ph=new PhoneNumber();
				ph.PatNum=FormOpenDental.CurPatNum;
				ph.PhoneNumberVal=PhoneList[rowI].CustomerNumber;
				PhoneNumbers.Insert(ph);
			}
			//tell the phone server to refresh this row with the patient name and patnum
			DataValid.SetInvalid(InvalidType.PhoneNumbers);
		}
		private void butAdd_Click(object sender,EventArgs e) {
			InputBox input=new InputBox("Phone Number");
			input.ShowDialog();
			if(input.DialogResult!=DialogResult.OK) {
				return;
			}
			PhoneNumber phoneNumber=new PhoneNumber();
			phoneNumber.PatNum=PatNum;
			phoneNumber.PhoneNumberVal=input.textResult.Text;
			PhoneNumbers.Insert(phoneNumber);
			FillList();
		}