Example #1
0
		///<summary>Inserts this lettermergefield into database.</summary>
		public static long Insert(LetterMergeField lmf) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				lmf.FieldNum=Meth.GetLong(MethodBase.GetCurrentMethod(),lmf);
				return lmf.FieldNum;
			}
			return Crud.LetterMergeFieldCrud.Insert(lmf);
		}
Example #2
0
 ///<summary>Inserts this lettermergefield into database.</summary>
 public static long Insert(LetterMergeField lmf)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         lmf.FieldNum = Meth.GetLong(MethodBase.GetCurrentMethod(), lmf);
         return(lmf.FieldNum);
     }
     return(Crud.LetterMergeFieldCrud.Insert(lmf));
 }
Example #3
0
		private void butOK_Click(object sender, System.EventArgs e) {
			if(textDescription.Text==""){
				MsgBox.Show(this,"Please enter a description");
				return;
			}
			if(this.textDataFileName.Text==""
				|| this.textTemplateName.Text=="")
			{
				MsgBox.Show(this,"Filenames cannot be left blank.");
				return;
			}
			if(comboCategory.SelectedIndex==-1){
				MsgBox.Show(this,"Please select a category");
				return;
			}
			if(listPatSelect.SelectedIndices.Count==0
				&& listReferral.SelectedIndices.Count==0)
			{
				MsgBox.Show(this,"Please select at least one field.");
				return;
			}
			Cursor.Current=Cursors.WaitCursor;
			LetterMergeCur.Description=textDescription.Text;
			LetterMergeCur.TemplateName=textTemplateName.Text;
			LetterMergeCur.DataFileName=textDataFileName.Text;
			LetterMergeCur.Category
				=DefC.Short[(int)DefCat.LetterMergeCats][comboCategory.SelectedIndex].DefNum;
			if(IsNew){
				LetterMerges.Insert(LetterMergeCur);
			}
			else{
				LetterMerges.Update(LetterMergeCur);
			}
			LetterMergeFields.DeleteForLetter(LetterMergeCur.LetterMergeNum);
			LetterMergeField field;
			for(int i=0;i<listPatSelect.SelectedItems.Count;i++){
				field=new LetterMergeField();
				field.LetterMergeNum=LetterMergeCur.LetterMergeNum;
				field.FieldName=(string)listPatSelect.SelectedItems[i];
					//(string)listPatSelect.Items[listPatSelect.SelectedIndices[i]];
				LetterMergeFields.Insert(field);
			}
			for(int i=0;i<listReferral.SelectedItems.Count;i++){
				field=new LetterMergeField();
				field.LetterMergeNum=LetterMergeCur.LetterMergeNum;
				field.FieldName="referral."+(string)listReferral.SelectedItems[i];
				LetterMergeFields.Insert(field);
			}
			for(int i=0;i<listOther.SelectedItems.Count;i++){
				field=new LetterMergeField();
				field.LetterMergeNum=LetterMergeCur.LetterMergeNum;
				field.FieldName=(string)listOther.SelectedItems[i];
				LetterMergeFields.Insert(field);
			}
			Cursor.Current=Cursors.Default;
			DialogResult=DialogResult.OK;
		}