Esempio n. 1
0
		///<summary></summary>
		public static long Insert(SheetFieldDef sheetFieldDef) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				sheetFieldDef.SheetFieldDefNum=Meth.GetLong(MethodBase.GetCurrentMethod(),sheetFieldDef);
				return sheetFieldDef.SheetFieldDefNum;
			}
			return Crud.SheetFieldDefCrud.Insert(sheetFieldDef);
		}
Esempio n. 2
0
        public static SheetFieldDef NewGrid(string fieldName, int xPos, int yPos, int width, int height, float fontSize = 8.5f, string fontName = "")
        {
            SheetFieldDef retVal = new SheetFieldDef(SheetFieldType.Grid, fieldName, "", fontSize, fontName, false,
                                                     xPos, yPos, width, height, GrowthBehaviorEnum.DownGlobal, "");

            return(retVal);
        }
Esempio n. 3
0
		///<summary></summary>
		public static void Update(SheetFieldDef sheetFieldDef) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),sheetFieldDef);
				return;
			}
			Crud.SheetFieldDefCrud.Update(sheetFieldDef);
		}
Esempio n. 4
0
        public static SheetFieldDef NewMobileHeader(string uiLabelMobile)
        {
            SheetFieldDef retVal = new SheetFieldDef(SheetFieldType.MobileHeader, "misc", "", 8.5f, "", false,
                                                     0, 0, 0, 0, GrowthBehaviorEnum.DownGlobal, "", isNew: true);

            retVal.UiLabelMobile = uiLabelMobile;
            return(retVal);
        }
Esempio n. 5
0
 ///<summary></summary>
 public static long Insert(SheetFieldDef sheetFieldDef)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         sheetFieldDef.SheetFieldDefNum = Meth.GetLong(MethodBase.GetCurrentMethod(), sheetFieldDef);
         return(sheetFieldDef.SheetFieldDefNum);
     }
     return(Crud.SheetFieldDefCrud.Insert(sheetFieldDef));
 }
Esempio n. 6
0
 ///<summary>Sorts fields in the order that they shoudl be drawn on top of eachother. First Images, then Drawings, Lines, Rectangles, Text, Check Boxes, and SigBoxes. In that order.</summary>
 public static int SortDrawingOrderLayers(SheetFieldDef f1, SheetFieldDef f2)
 {
     if (f1.FieldType != f2.FieldType)
     {
         return(SheetFields.FieldTypeSortOrder(f1.FieldType).CompareTo(SheetFields.FieldTypeSortOrder(f2.FieldType)));
     }
     return(f1.YPos.CompareTo(f2.YPos));
     //return f1.SheetFieldNum.CompareTo(f2.SheetFieldNum);
 }
Esempio n. 7
0
 ///<summary></summary>
 public static void Update(SheetFieldDef sheetFieldDef)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), sheetFieldDef);
         return;
     }
     Crud.SheetFieldDefCrud.Update(sheetFieldDef);
 }
Esempio n. 8
0
		/// <summary></summary>
		public static string RunAll() {
			string retVal="";
			//GetString
			string strResult=WebServiceTests.GetString("Input");
			if(strResult!="Input-Processed"){
				throw new Exception("Should be Input-Processed");
			}
			retVal+="GetString: Passed.\r\n";
			strResult=WebServiceTests.GetStringNull("Input");
			if(strResult!=null){
				throw new Exception("Should be null");
			}
			retVal+="GetStringNull: Passed.\r\n";
			strResult=WebServiceTests.GetStringCarriageReturn("Carriage\r\nReturn");
			if(strResult!="Carriage\r\nReturn-Processed") {
				throw new Exception("Should be Carriage\r\nReturn-Processed");
			}
			retVal+="GetStringCarriageReturn: Passed.\r\n";
			//GetInt
			int intResult=WebServiceTests.GetInt(1);
			if(intResult!=2){
				throw new Exception("Should be 2");
			}
			retVal+="GetInt: Passed.\r\n";
			//GetLong
			long longResult=WebServiceTests.GetLong(1);
			if(longResult!=2){
				throw new Exception("Should be 2");
			}
			retVal+="GetLong: Passed.\r\n";
			//GetVoid
			WebServiceTests.GetVoid();
			retVal+="GetVoid: Passed.\r\n";
			//GetBool
			bool boolResult=WebServiceTests.GetBool();
			if(boolResult!=true){
				throw new Exception("Should be true");
			}
			retVal+="GetBool: Passed.\r\n";
			//GetObject
			Patient pat=WebServiceTests.GetObjectPat();
			if(pat.LName!="Smith"){
				throw new Exception("Should be Smith");
			}
			if(pat.FName!=null){
				throw new Exception("Should be null");
			}
			retVal+="GetObjectPat: Passed.\r\n";
			//GetTable
			DataTable table=WebServiceTests.GetTable();
			if(table.Rows[0][0].ToString()!="cell00"){
				throw new Exception("Should be cell00");
			}
			retVal+="GetTable: Passed.\r\n";
			//GetTable with carriage return
			table=WebServiceTests.GetTableCarriageReturn();
			if(table.Rows[0][0].ToString()!="cell\r\n00"){
				throw new Exception("Should be cell\r\n00");
			}
			retVal+="GetTableCarriageReturn: Passed.\r\n";
			//Get2by3
			table=WebServiceTests.GetTable2by3();
			for(int i=0;i<table.Rows.Count;i++) {
				for(int j=0;j<table.Columns.Count;j++) {
					if(table.Rows[i][j].ToString()!="cell"+i.ToString()+j.ToString()) {
						throw new Exception("Should be cell"+i.ToString()+j.ToString());
					}
				}
			}
			retVal+="GetTable2by3: Passed.\r\n";
			//GetSpecialChars
			table=WebServiceTests.GetTableSpecialChars();
			char[] chars={'|','<','>','&','\'','"','\\','/'};
			for(int i=0;i<table.Rows.Count;i++) {
				for(int j=0;j<table.Columns.Count;j++) {
					if(table.Rows[i][j].ToString()!="cell"+i.ToString()+j.ToString()+chars[i*2+j].ToString()) {
						throw new Exception("Should be cell"+i.ToString()+j.ToString()+chars[i*2+j].ToString());
					}
				}
			}
			retVal+="GetTableSpecialChars: Passed.\r\n";
			//GetDataTypes
			table=WebServiceTests.GetTableDataTypes();
			if(table.Rows[0][0].GetType()!=typeof(string)) {
				throw new Exception("Should be "+typeof(string).ToString());
			}
			if(table.Rows[0][1].GetType()!=typeof(decimal)) {
				throw new Exception("Should be "+typeof(decimal).ToString());
			}
			if(table.Rows[0][2].GetType()!=typeof(DateTime)) {
				throw new Exception("Should be "+typeof(DateTime).ToString());
			}
			retVal+="GetTableDataTypes: Passed.\r\n";
			//GetDataSet
			DataSet ds=WebServiceTests.GetDataSet();
			if(ds.Tables[0].TableName!="table0"){
				throw new Exception("Should be table0");
			}
			retVal+="GetDataSet: Passed.\r\n";
			//GetList
			List<int> listInt=WebServiceTests.GetListInt();
			if(listInt[0]!=2){
				throw new Exception("Should be 2");
			}
			retVal+="GetListInt: Passed.\r\n";
			//GetArrayPatient
			Patient[] arrayPat=WebServiceTests.GetArrayPatient();
			if(arrayPat[0].LName!="Jones"){
				throw new Exception("Should be Jones");
			}
			if(arrayPat[1]!=null){
				throw new Exception("Should be null");
			}
			retVal+="GetArrayPatient: Passed.\r\n";
			//SendNullParam
			strResult=WebServiceTests.SendNullParam(null);
			if(strResult!="nullOK"){
				throw new Exception("Should be nullOK");
			}
			retVal+="SendNullParam: Passed.\r\n";
			//GetObjectNull
			Patient pat2=WebServiceTests.GetObjectNull();
			if(pat2!=null){
				throw new Exception("Should be null");
			}
			retVal+="GetObjectNull: Passed.\r\n";
			//SendColorParam
			Color colorResult=WebServiceTests.SendColorParam(Color.Fuchsia);
			if(colorResult.ToArgb()!=Color.Green.ToArgb()) {
				throw new Exception("Should be green.");
			}
			retVal+="SendColorParam: Passed.\r\n";
			//SendProviderColor
			Provider prov=new Provider();
			prov.ProvColor=Color.Fuchsia;
			strResult=WebServiceTests.SendProviderColor(prov);
			if(strResult!="fuchsiaOK") {
				throw new Exception("Should be fuchsiaOK.");
			}
			retVal+="SendProviderColor: Passed.\r\n";
			//SendSheetParameter
			SheetParameter sheetParam=new SheetParameter(false,"ParamNameOK");
			strResult=WebServiceTests.SendSheetParameter(sheetParam);
			if(strResult!="paramNameOK") {
				throw new Exception("Should be paramNameOK.");
			}
			retVal+="SendSheetParameter: Passed.\r\n";
			//SendSheetWithFields
			Sheet sheet=new Sheet();
			sheet.SheetFields=new List<SheetField>();
			sheet.Parameters=new List<SheetParameter>();
			SheetField field=new SheetField();
			field.FieldName="FieldNameGreen";
			sheet.SheetFields.Add(field);
			strResult=WebServiceTests.SendSheetWithFields(sheet);
			if(strResult!="fieldOK") {
				throw new Exception("Should be fieldOK.");
			}
			retVal+="SendSheetWithFields: Passed.\r\n";
			//SendSheetDefWithFields
			SheetDef sheetdef=new SheetDef();
			sheetdef.SheetFieldDefs=new List<SheetFieldDef>();
			sheetdef.Parameters=new List<SheetParameter>();
			SheetFieldDef fielddef=new SheetFieldDef();
			fielddef.FieldName="FieldNameTeal";
			sheetdef.SheetFieldDefs.Add(fielddef);
			strResult=WebServiceTests.SendSheetDefWithFieldDefs(sheetdef);
			if(strResult!="fielddefOK") {
				throw new Exception("Should be fielddefOK.");
			}
			retVal+="SendSheetDefWithFieldDefs: Passed.\r\n";
			//TimeSpanNeg
			TimeSpan tspan=WebServiceTests.GetTimeSpan();
			if(tspan!=new TimeSpan(1,0,0)) {
				throw new Exception("Should be 1 hour.");
			}
			retVal+="GetTimeSpan: Passed.\r\n";
			//GetStringContainingCR
			strResult=WebServiceTests.GetStringContainingCR();
			//strResult=strResult.Replace("\\r","\r");
			if(strResult!="Line1\r\nLine2") {
				throw new Exception("Should be Line1\r\nLine2");
			}
			retVal+="GetStringContainingCR: Passed.\r\n";
			/*
			//GetListTasksContainingCR
			Task task=WebServiceTests.GetListTasksContainingCR()[0];
			if(task.Descript!="Line1\r\nLine2") {
				throw new Exception("Should be Line1\r\nLine2");
			}
			retVal+="GetListTasksContainingCR: Passed.\r\n";*/


			
			return retVal;
		}
Esempio n. 9
0
		private void butDelete_Click(object sender,EventArgs e) {
			SheetFieldDefCur=null;
			DialogResult=DialogResult.OK;
		}
Esempio n. 10
0
		///<summary>Only for editing fields that already exist.</summary>
		private void LaunchEditWindow(SheetFieldDef field){
			bool refreshBuffer=false;
			//not every field will have been saved to the database, so we can't depend on SheetFieldDefNum.
			int idx=SheetDefCur.SheetFieldDefs.IndexOf(field);
			switch(field.FieldType){
				case SheetFieldType.InputField:
					FormSheetFieldInput FormS=new FormSheetFieldInput();
					FormS.SheetDefCur=SheetDefCur;
					FormS.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormS.IsReadOnly=true;
					}
					FormS.ShowDialog();
					if(FormS.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormS.SheetFieldDefCur==null){
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.OutputText:
					FormSheetFieldOutput FormSO=new FormSheetFieldOutput();
					FormSO.SheetDefCur=SheetDefCur;
					FormSO.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormSO.IsReadOnly=true;
					}
					FormSO.ShowDialog();
					if(FormSO.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormSO.SheetFieldDefCur==null){
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.StaticText:
					FormSheetFieldStatic FormSS=new FormSheetFieldStatic();
					FormSS.SheetDefCur=SheetDefCur;
					FormSS.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormSS.IsReadOnly=true;
					}
					FormSS.ShowDialog();
					if(FormSS.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormSS.SheetFieldDefCur==null){
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.Image:
					FormSheetFieldImage FormSI=new FormSheetFieldImage();
					FormSI.SheetDefCur=SheetDefCur;
					FormSI.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormSI.IsReadOnly=true;
					}
					FormSI.ShowDialog();
					if(FormSI.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormSI.SheetFieldDefCur==null) {
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					refreshBuffer=true;
					break;
				case SheetFieldType.PatImage:
					FormSheetFieldPatImage FormSPI=new FormSheetFieldPatImage();
					FormSPI.SheetDefCur=SheetDefCur;
					FormSPI.SheetFieldDefCur=field;
					if(this.IsInternal) {
						FormSPI.IsReadOnly=true;
					}
					FormSPI.ShowDialog();
					if(FormSPI.DialogResult!=DialogResult.OK) {
						return;
					}
					if(FormSPI.SheetFieldDefCur==null) {
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					refreshBuffer=true;
					break;
				case SheetFieldType.Line:
					FormSheetFieldLine FormSL=new FormSheetFieldLine();
					FormSL.SheetDefCur=SheetDefCur;
					FormSL.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormSL.IsReadOnly=true;
					}
					FormSL.ShowDialog();
					if(FormSL.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormSL.SheetFieldDefCur==null){
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.Rectangle:
					FormSheetFieldRect FormSR=new FormSheetFieldRect();
					FormSR.SheetDefCur=SheetDefCur;
					FormSR.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormSR.IsReadOnly=true;
					}
					FormSR.ShowDialog();
					if(FormSR.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormSR.SheetFieldDefCur==null){
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.CheckBox:
					FormSheetFieldCheckBox FormSB=new FormSheetFieldCheckBox();
					FormSB.SheetDefCur=SheetDefCur;
					FormSB.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormSB.IsReadOnly=true;
					}
					FormSB.ShowDialog();
					if(FormSB.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormSB.SheetFieldDefCur==null){
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.SigBox:
					FormSheetFieldSigBox FormSBx=new FormSheetFieldSigBox();
					FormSBx.SheetDefCur=SheetDefCur;
					FormSBx.SheetFieldDefCur=field;
					if(this.IsInternal){
						FormSBx.IsReadOnly=true;
					}
					FormSBx.ShowDialog();
					if(FormSBx.DialogResult!=DialogResult.OK){
						return;
					}
					if(FormSBx.SheetFieldDefCur==null){
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.Special:
					FormSheetFieldSpecial FormSFS=new FormSheetFieldSpecial();
					FormSFS.SheetDefCur=SheetDefCur;
					FormSFS.SheetFieldDefCur=field;
					if(this.IsInternal) {
						FormSFS.IsReadOnly=true;
					}
					FormSFS.ShowDialog();
					if(FormSFS.DialogResult!=DialogResult.OK) {
						return;
					}
					if(FormSFS.SheetFieldDefCur==null) {
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
					}
					break;
				case SheetFieldType.Grid:
					FormSheetFieldGrid FormSFG=new FormSheetFieldGrid();
					FormSFG.SheetDefCur=SheetDefCur;
					FormSFG.SheetFieldDefCur=field;
					if(this.IsInternal) {
						FormSFG.IsReadOnly=true;
					}
					FormSFG.ShowDialog();
					if(FormSFG.DialogResult!=DialogResult.OK) {
						return;
					}
					if(FormSFG.SheetFieldDefCur==null) {
						SheetDefCur.SheetFieldDefs.RemoveAt(idx);
						return;
					}
					break;
			}
			if(IsTabMode) {
				if(ListSheetFieldDefsTabOrder.Contains(field)) {
					ListSheetFieldDefsTabOrder.RemoveAt(ListSheetFieldDefsTabOrder.IndexOf(field));
				}
				if(field.TabOrder>0 && field.TabOrder<=(ListSheetFieldDefsTabOrder.Count+1)) {
					ListSheetFieldDefsTabOrder.Insert(field.TabOrder-1,field);
				}
				RenumberTabOrderHelper();
				return;
			}
			//listFields.ClearSelected();
			FillFieldList();
			if(refreshBuffer) {//Only when image was edited.
				RefreshDoubleBuffer();
			}
			//for(int i=0;i<SheetDefCur.SheetFieldDefs.Count;i++) {
			//	if(SheetDefCur.SheetFieldDefs[i].FieldType==field.FieldType
			//		&& SheetDefCur.SheetFieldDefs[i].FieldType==field.FieldType
			//		&& SheetDefCur.SheetFieldDefs[i].FieldType==field.FieldType
			//}
			//idx=SheetDefCur.SheetFieldDefs.IndexOf(field);
			//if(idx>0) {//only true if field was not deleted.
			//	listFields.SetSelected(idx,true);
			//}
			if(listFields.Items.Count-1>=idx){
				listFields.SelectedIndex=idx;//reselect the item.
			}
			panelMain.Refresh();
		}
Esempio n. 11
0
		///<summary>This is a comparator function used by List&lt;T&gt;.Sort() 
		///When compairing SheetFieldDef.TabOrder it returns a negative number if def1&lt;def2, 0 if def1==def2, and a positive number if def1&gt;def2.
		///Does not handle null values, but there should never be any instances of null being passed in. 
		///Must always return 0 when compairing item to itself.
		///This function should probably be moved to SheetFieldDefs.</summary>
		private static int CompareTabOrder(SheetFieldDef def1,SheetFieldDef def2) {
			if(def1.FieldType==def2.FieldType) {
				//do nothing
			}
			else if(def1.FieldType==SheetFieldType.Image) {//Always move images to the top of the list. This is because of the way the sheet is drawn.
				return -1;
			}
			else if(def2.FieldType==SheetFieldType.Image) {//Always move images to the top of the list. This is because of the way the sheet is drawn.
				return 1;
			}
			else if(def1.FieldType==SheetFieldType.PatImage) {//Move PatImage to the top of the list under images.
				return -1;
			}
			else if(def2.FieldType==SheetFieldType.PatImage) {//Move PatImage to the top of the list under images.
				return 1;
			}
			else if(def1.FieldType==SheetFieldType.Special) {//Move Special to the top of the list under PatImages.
				return -1;
			}
			else if(def2.FieldType==SheetFieldType.Special) {//Move Special to the top of the list under PatImages.
				return 1;
			}
			else if(def1.FieldType==SheetFieldType.OutputText) {//Move Output text to the top of the list under Special.
				return -1;
			}
			else if(def2.FieldType==SheetFieldType.OutputText) {//Move Output text to the top of the list under Special.
				return 1;
			}
			if(def1.TabOrder-def2.TabOrder==0) {
				int comp=(def1.FieldName+def1.RadioButtonValue).CompareTo(def2.FieldName+def2.RadioButtonValue);//RadioButtionValuecan be filled or ""
				if(comp!=0) {
					return comp;
				}
				comp=def1.YPos-def2.YPos;//arbitrarily order by YPos if both controls have the same tab orer and name. This will only happen if both fields are either identical or if they are both misc fields.
				if(comp!=0) {
					return comp;
				}
				return def1.XPos-def2.XPos;//If tabOrder, Name, and YPos are equal then compare based on X coordinate. 
			}
			return def1.TabOrder-def2.TabOrder;
		}
Esempio n. 12
0
        /// <summary></summary>
        public static string RunAll()
        {
            string retVal="";
            //GetString
            string strResult=WebServiceTests.GetString("Input");
            if(strResult!="Input-Processed"){
                throw new Exception("Should be Input-Processed");
            }
            retVal+="GetString: Passed.\r\n";
            strResult=WebServiceTests.GetStringNull("Input");
            if(strResult!=null){
                throw new Exception("Should be null");
            }
            retVal+="GetStringNull: Passed.\r\n";
            strResult=WebServiceTests.GetStringCarriageReturn("Carriage\r\nReturn");
            if(strResult!="Carriage\r\nReturn-Processed") {
                throw new Exception("Should be Carriage\r\nReturn-Processed");
            }
            retVal+="GetStringCarriageReturn: Passed.\r\n";
            //GetInt
            int intResult=WebServiceTests.GetInt(1);
            if(intResult!=2){
                throw new Exception("Should be 2");
            }
            retVal+="GetInt: Passed.\r\n";
            //GetLong
            long longResult=WebServiceTests.GetLong(1);
            if(longResult!=2){
                throw new Exception("Should be 2");
            }
            retVal+="GetLong: Passed.\r\n";
            //GetVoid
            WebServiceTests.GetVoid();
            retVal+="GetVoid: Passed.\r\n";
            //GetBool
            bool boolResult=WebServiceTests.GetBool();
            if(boolResult!=true){
                throw new Exception("Should be true");
            }
            retVal+="GetBool: Passed.\r\n";
            //GetObject
            Patient pat=WebServiceTests.GetObjectPat();
            if(pat.LName!="Smith"){
                throw new Exception("Should be Smith");
            }
            if(pat.FName!=null){
                throw new Exception("Should be null");
            }
            retVal+="GetObjectPat: Passed.\r\n";
            //GetTable
            DataTable table=WebServiceTests.GetTable();
            if(table.Rows[0][0].ToString()!="cell00"){
                throw new Exception("Should be cell00");
            }
            retVal+="GetTable: Passed.\r\n";
            //GetTable with carriage return
            table=WebServiceTests.GetTableCarriageReturn();
            if(table.Rows[0][0].ToString()!="cell\r\n00"){
                throw new Exception("Should be cell\r\n00");
            }
            retVal+="GetTableCarriageReturn: Passed.\r\n";
            //GetDataSet
            DataSet ds=WebServiceTests.GetDataSet();
            if(ds.Tables[0].TableName!="table0"){
                throw new Exception("Should be table0");
            }
            retVal+="GetDataSet: Passed.\r\n";
            //GetList
            List<int> listInt=WebServiceTests.GetListInt();
            if(listInt[0]!=2){
                throw new Exception("Should be 2");
            }
            retVal+="GetListInt: Passed.\r\n";
            //GetArrayPatient
            Patient[] arrayPat=WebServiceTests.GetArrayPatient();
            if(arrayPat[0].LName!="Jones"){
                throw new Exception("Should be Jones");
            }
            if(arrayPat[1]!=null){
                throw new Exception("Should be null");
            }
            retVal+="GetArrayPatient: Passed.\r\n";
            //SendNullParam
            strResult=WebServiceTests.SendNullParam(null);
            if(strResult!="nullOK"){
                throw new Exception("Should be nullOK");
            }
            retVal+="SendNullParam: Passed.\r\n";
            //GetObjectNull
            Patient pat2=WebServiceTests.GetObjectNull();
            if(pat2!=null){
                throw new Exception("Should be null");
            }
            retVal+="GetObjectNull: Passed.\r\n";
            //SendColorParam
            Color colorResult=WebServiceTests.SendColorParam(Color.Fuchsia);
            if(colorResult.ToArgb()!=Color.Green.ToArgb()) {
                throw new Exception("Should be green.");
            }
            retVal+="SendColorParam: Passed.\r\n";
            //SendProviderColor
            Provider prov=new Provider();
            prov.ProvColor=Color.Fuchsia;
            strResult=WebServiceTests.SendProviderColor(prov);
            if(strResult!="fuchsiaOK") {
                throw new Exception("Should be fuchsiaOK.");
            }
            retVal+="SendProviderColor: Passed.\r\n";
            //SendSheetParameter
            SheetParameter sheetParam=new SheetParameter(false,"ParamNameOK");
            strResult=WebServiceTests.SendSheetParameter(sheetParam);
            if(strResult!="paramNameOK") {
                throw new Exception("Should be paramNameOK.");
            }
            retVal+="SendSheetParameter: Passed.\r\n";
            //SendSheetWithFields
            Sheet sheet=new Sheet();
            sheet.SheetFields=new List<SheetField>();
            sheet.Parameters=new List<SheetParameter>();
            SheetField field=new SheetField();
            field.FieldName="FieldNameGreen";
            sheet.SheetFields.Add(field);
            strResult=WebServiceTests.SendSheetWithFields(sheet);
            if(strResult!="fieldOK") {
                throw new Exception("Should be fieldOK.");
            }
            retVal+="SendSheetWithFields: Passed.\r\n";
            //SendSheetDefWithFields
            SheetDef sheetdef=new SheetDef();
            sheetdef.SheetFieldDefs=new List<SheetFieldDef>();
            sheetdef.Parameters=new List<SheetParameter>();
            SheetFieldDef fielddef=new SheetFieldDef();
            fielddef.FieldName="FieldNameTeal";
            sheetdef.SheetFieldDefs.Add(fielddef);
            strResult=WebServiceTests.SendSheetDefWithFieldDefs(sheetdef);
            if(strResult!="fielddefOK") {
                throw new Exception("Should be fielddefOK.");
            }
            retVal+="SendSheetDefWithFieldDefs: Passed.\r\n";
            //TimeSpanNeg
            TimeSpan tspan=WebServiceTests.GetTimeSpan();
            if(tspan!=new TimeSpan(1,0,0)) {
                throw new Exception("Should be 1 hour.");
            }
            retVal+="GetTimeSpan: Passed.\r\n";
            //GetStringContainingCR
            //fails, but we have a strategy to fix some day by putting serialization code into the crud layer.
            /*
            strResult=WebServiceTests.GetStringContainingCR();
            strResult=strResult.Replace("\\r","\r");
            if(strResult!="Line1\r\nLine2") {
                throw new Exception("Should be Line1\r\nLine2");
            }
            retVal+="GetStringContainingCR: Passed.\r\n";
            //GetListTasksContainingCR
            Task task=WebServiceTests.GetListTasksContainingCR()[0];
            if(task.Descript!="Line1\r\nLine2") {
                throw new Exception("Should be Line1\r\nLine2");
            }
            retVal+="GetListTasksContainingCR: Passed.\r\n";*/

            return retVal;
        }
Esempio n. 13
0
		public static SheetFieldDef NewGrid(string fieldName,int xPos,int yPos,int width,int height,float fontSize=8.5f,string fontName="") {
			SheetFieldDef retVal=new SheetFieldDef(SheetFieldType.Grid,fieldName,"",fontSize,fontName,false,
				xPos,yPos,width,height,GrowthBehaviorEnum.DownGlobal,"");
			return retVal;
		}
Esempio n. 14
0
 ///<summary>This is a comparator function used by List&lt;T&gt;.Sort()
 ///When compairing SheetFieldDef.TabOrder it returns a negative number if def1&lt;def2, 0 if def1==def2, and a positive number if def1&gt;def2.
 ///Does not handle null values, but there should never be any instances of null being passed in.
 ///Must always return 0 when compairing item to itself.
 ///This function should probably be moved to SheetFieldDefs.</summary>
 public static int CompareTabOrder(SheetFieldDef def1, SheetFieldDef def2)
 {
     if (def1.FieldType == def2.FieldType)
     {
         //do nothing
     }
     else if (def1.FieldType == SheetFieldType.Image)            //Always move images to the top of the list. This is because of the way the sheet is drawn.
     {
         return(-1);
     }
     else if (def2.FieldType == SheetFieldType.Image)            //Always move images to the top of the list. This is because of the way the sheet is drawn.
     {
         return(1);
     }
     else if (def1.FieldType == SheetFieldType.PatImage)            //Move PatImage to the top of the list under images.
     {
         return(-1);
     }
     else if (def2.FieldType == SheetFieldType.PatImage)            //Move PatImage to the top of the list under images.
     {
         return(1);
     }
     else if (def1.FieldType == SheetFieldType.Special)            //Move Special to the top of the list under PatImages.
     {
         return(-1);
     }
     else if (def2.FieldType == SheetFieldType.Special)            //Move Special to the top of the list under PatImages.
     {
         return(1);
     }
     else if (def1.FieldType == SheetFieldType.OutputText)            //Move Output text to the top of the list under Special.
     {
         return(-1);
     }
     else if (def2.FieldType == SheetFieldType.OutputText)            //Move Output text to the top of the list under Special.
     {
         return(1);
     }
     else if (def1.FieldType == SheetFieldType.MobileHeader)            //Move MobileHeader to bottom
     {
         return(1);
     }
     else if (def2.FieldType == SheetFieldType.MobileHeader)            //Move MobileHeader to bottom
     {
         return(-1);
     }
     if (def1.TabOrder - def2.TabOrder == 0)
     {
         int comp = (def1.FieldName + def1.RadioButtonValue).CompareTo(def2.FieldName + def2.RadioButtonValue);           //RadioButtionValuecan be filled or ""
         if (comp != 0)
         {
             return(comp);
         }
         comp = def1.YPos - def2.YPos;             //arbitrarily order by YPos if both controls have the same tab orer and name. This will only happen if both fields are either identical or if they are both misc fields.
         if (comp != 0)
         {
             return(comp);
         }
         return(def1.XPos - def2.XPos);              //If tabOrder, Name, and YPos are equal then compare based on X coordinate.
     }
     return(def1.TabOrder - def2.TabOrder);
 }
Esempio n. 15
0
		private static bool fieldIsPaymentOptionHelper(SheetFieldDef sheetFieldDef) {
			if(sheetFieldDef.IsPaymentOption) {
				return true;
			}
			switch(sheetFieldDef.FieldName) {
				case "StatementEnclosed":
				case "StatementAging":
					return true;
			}
			return false;
		}
Esempio n. 16
0
		///<summary>Sorts fields in the order that they shoudl be drawn on top of eachother. First Images, then Drawings, Lines, Rectangles, Text, Check Boxes, and SigBoxes. In that order.</summary>
		public static int SortDrawingOrderLayers(SheetFieldDef f1,SheetFieldDef f2) {
			if(f1.FieldType!=f2.FieldType) {
				return SheetFields.FieldTypeSortOrder(f1.FieldType).CompareTo(SheetFields.FieldTypeSortOrder(f2.FieldType));
			}
			return f1.YPos.CompareTo(f2.YPos);
			//return f1.SheetFieldNum.CompareTo(f2.SheetFieldNum);
		}