Exemple #1
0
		public FormSheetDefEdit(SheetDef sheetDef) {
			InitializeComponent();
			Lan.F(this);
			SheetDefCur=sheetDef;
			/*if(SheetDefCur.IsLandscape){
				Width=SheetDefCur.Height+185;
				Height=SheetDefCur.Width+60;
			}
			else{
				Width=SheetDefCur.Width+185;
				Height=SheetDefCur.Height+60;
			}*/
			if(sheetDef.IsLandscape){
				Width=sheetDef.Height+190;
				Height=sheetDef.Width+65;
			}
			else{
				Width=sheetDef.Width+190;
				Height=sheetDef.Height+65;
			}
			if(Width<600){
				Width=600;
			}
			if(Height<600){
				Height=600;
			}
			if(Width>SystemInformation.WorkingArea.Width){
				Width=SystemInformation.WorkingArea.Width;
			}
			if(Height>SystemInformation.WorkingArea.Height){
				Height=SystemInformation.WorkingArea.Height;
			}
		}
Exemple #2
0
 public static SheetDef ExamSheet()
 {
     SheetDef sheet=new SheetDef(SheetTypeEnum.ExamSheet);
     sheet.Description="Exam";
     sheet.FontName="Microsoft Sans Serif";
     sheet.FontSize=11f;
     sheet.Width=850;
     sheet.Height=1100;
     int rowH=25;
     int y=100;
     //Title----------------------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Exam for [nameFL]",12f,sheet.FontName,true,275,y,325,20));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("sheet.DateTimeSheet",12f,sheet.FontName,false,350,y,100,20));
     y+=rowH;
     int x=100;
     y+=30;
     string[] fieldText=new string[] {"TMJ","Neck","Tongue","Palate","Floor of Mouth"};
     for(int i=0;i<fieldText.Length;i++){
         sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText(fieldText[i],sheet.FontSize,sheet.FontName,false,x,y,100,20));
         sheet.SheetFieldDefs.Add(SheetFieldDef.NewRect(x+120,y+2,15,15));
         sheet.SheetFieldDefs.Add(SheetFieldDef.NewCheckBox("misc",x+121,y+4,13,13));
         sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("WNL",sheet.FontSize,sheet.FontName,false,x+140,y,40,20));
         //sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(x+200,y+22,450,0));
         sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("misc",sheet.FontSize,sheet.FontName,false,x+200,y,450,40));
         y+=45;//rowH;
     }
     y+=25;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Additional Notes",sheet.FontSize,sheet.FontName,false,x,y,140,20));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("misc",sheet.FontSize,sheet.FontName,false,x,y,600,100));
     return sheet;
 }
Exemple #3
0
 ///<summary>Sheetdefs and sheetfielddefs are archived separately.  So when we need to use a sheetdef, we must run this method to pull all the associated fields from the archive.  Then it will be ready for printing, copying, etc.</summary>
 public static void GetFieldsAndParameters(SheetDef sheetdef)
 {
     //No need to check RemotingRole; no call to db.
     sheetdef.SheetFieldDefs=new List<SheetFieldDef>();
     sheetdef.Parameters=SheetParameter.GetForType(sheetdef.SheetType);
     //images first
     for(int i=0;i<SheetFieldDefC.Listt.Count;i++){
         if(SheetFieldDefC.Listt[i].SheetDefNum!=sheetdef.SheetDefNum){
             continue;
         }
         if(SheetFieldDefC.Listt[i].FieldType!=SheetFieldType.Image){
             continue;
         }
         sheetdef.SheetFieldDefs.Add(SheetFieldDefC.Listt[i].Copy());
     }
     //then all other fields
     for(int i=0;i<SheetFieldDefC.Listt.Count;i++){
         if(SheetFieldDefC.Listt[i].SheetDefNum!=sheetdef.SheetDefNum){
             continue;
         }
         if(SheetFieldDefC.Listt[i].FieldType==SheetFieldType.Image){
             continue;
         }
         if(SheetFieldDefC.Listt[i].FieldType==SheetFieldType.Parameter){
             continue;
             //sheetfielddefs never store parameters.
             //sheetfields do store filled parameters, but that's different.
         }
         //else{
         sheetdef.SheetFieldDefs.Add(SheetFieldDefC.Listt[i].Copy());
         //}
     }
 }
Exemple #4
0
 public static SheetDef DepositSlip()
 {
     SheetDef sheet=new SheetDef(SheetTypeEnum.DepositSlip);
     sheet.Description="Deposit Slip";
     sheet.FontName=FontFamily.GenericMonospace.Name;
     sheet.FontSize=9f;
     sheet.Width=850;
     sheet.Height=1100;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("deposit.DateDeposit",11f,sheet.FontName,false,89,156,120,17));
     //col 1, 6 boxes
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem01",8f,sheet.FontName,false,338,62,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem02",8f,sheet.FontName,false,338,90,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem03",8f,sheet.FontName,false,338,118,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem04",8f,sheet.FontName,false,338,146,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem05",8f,sheet.FontName,false,338,173,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem06",8f,sheet.FontName,false,338,201,100,20));
     //col 2, 7 boxes
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem07",8f,sheet.FontName,false,530,34,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem08",8f,sheet.FontName,false,530,62,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem09",8f,sheet.FontName,false,530,90,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem10",8f,sheet.FontName,false,530,118,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem11",8f,sheet.FontName,false,530,146,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem12",8f,sheet.FontName,false,530,173,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem13",8f,sheet.FontName,false,530,201,100,20));
     //col 3, 5 boxes
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem14",8f,sheet.FontName,false,720,34,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem15",8f,sheet.FontName,false,720,62,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem16",8f,sheet.FontName,false,720,90,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem17",8f,sheet.FontName,false,720,118,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItem18",8f,sheet.FontName,false,720,146,100,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositTotal",8f,sheet.FontName,false,720,173,100,20));
     //
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositItemCount",8f,sheet.FontName,false,556,275,50,20));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositTotal",8f,sheet.FontName,false,720,275,130,20));
     int rowH=20;
     int y=399;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Deposit Slip",16f,sheet.FontName,true,323,y,300,30));
     y+=30;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("[practiceTitle]",10f,sheet.FontName,true,323,y,300,20));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("deposit.DateDeposit",10f,sheet.FontName,false,352,y,200,20));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Date: [dateToday]",8f,sheet.FontName,false,50,y,160,20));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(50,y,750,0));
     y+=4;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositList",8f,sheet.FontName,false,75,y,700,20,GrowthBehaviorEnum.DownGlobal));
     y+=26;//The actual y-value of the proceeding elements will be changed depending on the size of the depositList, since we are using DownGlobal growth.
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(50,y,750,0));
     y+=4;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("depositTotal",8f,sheet.FontName,true,562,y,200,20));
     y+=rowH+4;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(50,y,750,0));
     y+=4;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("deposit.BankAccountInfo",8f,sheet.FontName,true,50,y,700,0,GrowthBehaviorEnum.DownGlobal));
     y+=1;//The actual y-value of the proceeding elements will be changed depending on the size of the deposit.BankAccountInfo, since we are using DownGlobal growth.
     return sheet;
 }
Exemple #5
0
		public static void PrintCustomPatient(long patNum,SheetDef sheetDef) {
			SheetDefs.GetFieldsAndParameters(sheetDef);
			Sheet sheet=SheetUtil.CreateSheet(sheetDef);
			SheetParameter.SetParameter(sheet,"PatNum",patNum);
			SheetFiller.FillFields(sheet);
			try {
				SheetPrinting.Print(sheet);
			}
			catch(Exception ex) {
				MessageBox.Show(ex.Message);
			}
		}
Exemple #6
0
		private void FormScreenPatEdit_Load(object sender,EventArgs e) {
			if(IsNew) {
				ScreenPatCur.SheetNum=PrefC.GetLong(PrefName.PublicHealthScreeningSheet);
			}
			PatCur=Patients.GetPat(ScreenPatCur.PatNum);
			if(PatCur!=null) {
				textPatient.Text=PatCur.GetNameLF();
			}
			if(ScreenGroupCur!=null) {
				textScreenGroup.Text=ScreenGroupCur.Description;
			}
			ExamSheetDefCur=SheetDefs.GetSheetDef(ScreenPatCur.SheetNum);
			if(ExamSheetDefCur!=null) {
				textSheet.Text=ExamSheetDefCur.Description;
			}
		}
Exemple #7
0
 ///<summary>Creates a Sheet object from a sheetDef, complete with fields and parameters.  Sets date to today.</summary>
 public static Sheet CreateSheet(SheetDef sheetDef,long patNum)
 {
     Sheet sheet=new Sheet();
     sheet.IsNew=true;
     sheet.DateTimeSheet=DateTime.Now;
     sheet.FontName=sheetDef.FontName;
     sheet.FontSize=sheetDef.FontSize;
     sheet.Height=sheetDef.Height;
     sheet.SheetType=sheetDef.SheetType;
     sheet.Width=sheetDef.Width;
     sheet.PatNum=patNum;
     sheet.Description=sheetDef.Description;
     sheet.IsLandscape=sheetDef.IsLandscape;
     sheet.SheetFields=CreateFieldList(sheetDef.SheetFieldDefs);
     sheet.Parameters=sheetDef.Parameters;
     return sheet;
 }
		private static SheetDef LabelPatientMail(){
			SheetDef sheet=new SheetDef(SheetTypeEnum.LabelPatient);
			sheet.Description="Label Patient Mail";
			sheet.FontName="Microsoft Sans Serif";
			sheet.FontSize=12f;
			sheet.Width=108;
			sheet.Height=346;
			sheet.IsLandscape=true;
			int rowH=19;
			int yPos=10;
			sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("nameFL",sheet.FontSize,sheet.FontName,false,25,yPos,300,rowH));
			yPos+=rowH;
			sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("address",sheet.FontSize,sheet.FontName,false,25,yPos,300,rowH,GrowthBehaviorEnum.DownLocal));
			yPos+=rowH;
			sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("cityStateZip",sheet.FontSize,sheet.FontName,false,25,yPos,300,rowH));
			return sheet;
		}
Exemple #9
0
        public static Dictionary <SheetTypeEnum, SheetDef> GetDefaultSheetDefsForClinic(long clinicNum)
        {
            //No need to check RemotingRole; no call to db.
            Dictionary <SheetTypeEnum, SheetDef> retVal = new Dictionary <SheetTypeEnum, SheetDef>();
            ClinicPref clinicPrefCur = ClinicPrefs.GetPref(Prefs.GetSheetDefPref(SheetTypeEnum.Rx), clinicNum);
            SheetDef   defaultRxDef  = SheetsInternal.GetSheetDef(SheetTypeEnum.Rx);

            if (clinicPrefCur != null && PIn.Long(clinicPrefCur.ValueString) != 0)         //If ValueString is 0 then we want to keep it as the internal sheet def.
            {
                defaultRxDef = GetSheetDef(PIn.Long(clinicPrefCur.ValueString), false);
            }
            if (clinicPrefCur != null)           //If there was a row in the clinicpref table, add whatever the sheetdef was to the retval dictionary.
            {
                retVal.Add(SheetTypeEnum.Rx, defaultRxDef);
            }
            return(retVal);
        }
Exemple #10
0
        ///<Summary>Gets one SheetDef from the cache.  Also includes the fields and parameters for the sheetdef.</Summary>
        public static SheetDef GetSheetDef(long sheetDefNum)
        {
            //No need to check RemotingRole; no call to db.
            SheetDef sheetdef = null;

            for (int i = 0; i < SheetDefC.Listt.Count; i++)
            {
                if (SheetDefC.Listt[i].SheetDefNum == sheetDefNum)
                {
                    sheetdef = SheetDefC.Listt[i].Copy();
                    break;
                }
            }
            //if sheetdef is null, it will crash, just as it should.
            GetFieldsAndParameters(sheetdef);
            return(sheetdef);
        }
Exemple #11
0
		///<summary>Includes all attached fields.  Intelligently inserts, updates, or deletes old fields.</summary>
		public static long InsertOrUpdate(SheetDef sheetDef){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				sheetDef.SheetDefNum=Meth.GetLong(MethodBase.GetCurrentMethod(),sheetDef);
				return sheetDef.SheetDefNum;
			}
			string command;
			if(sheetDef.IsNew){
				sheetDef.SheetDefNum=Crud.SheetDefCrud.Insert(sheetDef);
			}
			else{
				Crud.SheetDefCrud.Update(sheetDef);
			}
			foreach(SheetFieldDef field in sheetDef.SheetFieldDefs){
				field.SheetDefNum=sheetDef.SheetDefNum;
			}
			SheetFieldDefs.Sync(sheetDef.SheetFieldDefs,sheetDef.SheetDefNum);
			return sheetDef.SheetDefNum;
		}
Exemple #12
0
 ///<summary>Sheetdefs and sheetfielddefs are archived separately.  So when we need to use a sheetdef, we must run this method to pull all the associated fields from the archive.  Then it will be ready for printing, copying, etc.</summary>
 public static void GetFieldsAndParameters(SheetDef sheetdef)
 {
     //No need to check RemotingRole; no call to db.
     sheetdef.SheetFieldDefs = new List <SheetFieldDef>();
     sheetdef.Parameters     = SheetParameter.GetForType(sheetdef.SheetType);
     //images first
     for (int i = 0; i < SheetFieldDefC.Listt.Count; i++)
     {
         if (SheetFieldDefC.Listt[i].SheetDefNum != sheetdef.SheetDefNum)
         {
             continue;
         }
         if (SheetFieldDefC.Listt[i].FieldType != SheetFieldType.Image)
         {
             continue;
         }
         sheetdef.SheetFieldDefs.Add(SheetFieldDefC.Listt[i].Copy());
     }
     //then all other fields
     for (int i = 0; i < SheetFieldDefC.Listt.Count; i++)
     {
         if (SheetFieldDefC.Listt[i].SheetDefNum != sheetdef.SheetDefNum)
         {
             continue;
         }
         if (SheetFieldDefC.Listt[i].FieldType == SheetFieldType.Image)
         {
             continue;
         }
         if (SheetFieldDefC.Listt[i].FieldType == SheetFieldType.Parameter)
         {
             continue;
             //sheetfielddefs never store parameters.
             //sheetfields do store filled parameters, but that's different.
         }
         //else{
         sheetdef.SheetFieldDefs.Add(SheetFieldDefC.Listt[i].Copy());
         //}
     }
 }
Exemple #13
0
 ///<summary>Includes all attached fields.  Intelligently inserts, updates, or deletes old fields.</summary>
 public static long InsertOrUpdate(SheetDef sheetDef)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         sheetDef.SheetDefNum = Meth.GetLong(MethodBase.GetCurrentMethod(), sheetDef);
         return(sheetDef.SheetDefNum);
     }
     if (sheetDef.IsNew)
     {
         sheetDef.SheetDefNum = Crud.SheetDefCrud.Insert(sheetDef);
     }
     else
     {
         Crud.SheetDefCrud.Update(sheetDef);
     }
     foreach (SheetFieldDef field in sheetDef.SheetFieldDefs)
     {
         field.SheetDefNum = sheetDef.SheetDefNum;
     }
     SheetFieldDefs.Sync(sheetDef.SheetFieldDefs, sheetDef.SheetDefNum);
     return(sheetDef.SheetDefNum);
 }
Exemple #14
0
		///<summary>Supply a template sheet as well as a list of primary keys.  This method creates a new collection of sheets which each have a parameter of int.  It also fills the sheets with data from the database, so no need to run that separately.</summary>
		public static List<Sheet> CreateBatch(SheetDef sheetDef,List<long> priKeys) {
			//we'll assume for now that a batch sheet has only one parameter, so no need to check for values.
			//foreach(SheetParameter param in sheet.Parameters){
			//	if(param.IsRequired && param.ParamValue==null){
			//		throw new ApplicationException(Lan.g("Sheet","Parameter not specified for sheet: ")+param.ParamName);
			//	}
			//}
			List<Sheet> retVal=new List<Sheet>();
			//List<int> paramVals=(List<int>)sheet.Parameters[0].ParamValue;
			Sheet newSheet;
			SheetParameter paramNew;
			for(int i=0;i<priKeys.Count;i++){
				newSheet=CreateSheet(sheetDef);
				newSheet.Parameters=new List<SheetParameter>();
				paramNew=new SheetParameter(sheetDef.Parameters[0].IsRequired,sheetDef.Parameters[0].ParamName);
				paramNew.ParamValue=priKeys[i];
				newSheet.Parameters.Add(paramNew);
				SheetFiller.FillFields(newSheet);
				retVal.Add(newSheet);
			}
			return retVal;
		}
Exemple #15
0
		///<summary>Includes all attached fields.  It simply deletes all the old fields and inserts new ones.</summary>
		public static long InsertOrUpdate(SheetDef sheetDef){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				sheetDef.SheetDefNum=Meth.GetLong(MethodBase.GetCurrentMethod(),sheetDef);
				return sheetDef.SheetDefNum;
			}
			string command;
			if(!sheetDef.IsNew){
				command="DELETE FROM sheetfielddef WHERE SheetDefNum="+POut.Long(sheetDef.SheetDefNum);
				Db.NonQ(command);
			}
			if(sheetDef.IsNew){
				sheetDef.SheetDefNum=Crud.SheetDefCrud.Insert(sheetDef);
			}
			else{
				Crud.SheetDefCrud.Update(sheetDef);
			}
			foreach(SheetFieldDef field in sheetDef.SheetFieldDefs){
				field.IsNew=true;
				field.SheetDefNum=sheetDef.SheetDefNum;
				SheetFieldDefs.Insert(field);
			}
			return sheetDef.SheetDefNum;
		}
Exemple #16
0
 private void butNew_Click(object sender, System.EventArgs e)
 {
     //This button is not enabled unless user has appropriate permission for setup.
     //Not allowed to change sheettype once a sheet is created, so we need to let user pick.
     FormSheetDef FormS=new FormSheetDef();
     FormS.IsInitial=true;
     FormS.IsReadOnly=false;
     SheetDef sheetdef=new SheetDef();
     sheetdef.FontName="Microsoft Sans Serif";
     sheetdef.FontSize=9;
     sheetdef.Height=1100;
     sheetdef.Width=850;
     FormS.SheetDefCur=sheetdef;
     FormS.ShowDialog();
     if(FormS.DialogResult!=DialogResult.OK){
         return;
     }
     //what about parameters?
     sheetdef.SheetFieldDefs=new List<SheetFieldDef>();
     sheetdef.IsNew=true;
     FormSheetDefEdit FormSD=new FormSheetDefEdit(sheetdef);
     FormSD.ShowDialog();//It will be saved to db inside this form.
     FillGrid2();
     for(int i=0;i<SheetDefC.Listt.Count;i++){
         if(SheetDefC.Listt[i].SheetDefNum==sheetdef.SheetDefNum){
             grid2.SetSelected(i,true);
         }
     }
     changed=true;
 }
Exemple #17
0
 private void butImport_Click(object sender,EventArgs e)
 {
     Cursor=Cursors.WaitCursor;
     OpenFileDialog openDlg=new OpenFileDialog();
     string initDir=PrefC.GetString(PrefName.ExportPath);
     if(Directory.Exists(initDir)) {
         openDlg.InitialDirectory=initDir;
     }
     if(openDlg.ShowDialog()!=DialogResult.OK) {
         Cursor=Cursors.Default;
         return;
     }
     try {
         //ImportCustomSheetDef(openDlg.FileName);
         SheetDef sheetdef=new SheetDef();
         XmlSerializer serializer=new XmlSerializer(typeof(SheetDef));
         if(openDlg.FileName!="") {
             if(!File.Exists(openDlg.FileName)) {
                 throw new ApplicationException(Lan.g("FormSheetDefs","File does not exist."));
             }
             try {
                 using(TextReader reader=new StreamReader(openDlg.FileName)) {
                     sheetdef=(SheetDef)serializer.Deserialize(reader);
                 }
             }
             catch {
                 throw new ApplicationException(Lan.g("FormSheetDefs","Invalid file format"));
             }
         }
         sheetdef.IsNew=true;
         SheetDefs.InsertOrUpdate(sheetdef);
         FillGrid2();
         for(int i=0;i<SheetDefC.Listt.Count;i++) {
             if(SheetDefC.Listt[i].SheetDefNum==sheetdef.SheetDefNum) {
                 grid2.SetSelected(i,true);
             }
         }
     }
     catch(ApplicationException ex) {
         Cursor=Cursors.Default;
         MessageBox.Show(ex.Message);
         FillGrid2();
         return;
     }
     Cursor=Cursors.Default;
     MsgBox.Show(this,"Imported.");
 }
Exemple #18
0
 private static SheetDef PatientLetterTxFinder()
 {
     SheetDef sheet=new SheetDef(SheetTypeEnum.PatientLetter);
     sheet.Description="Patient Letter Tx Finder";
     sheet.FontName="Microsoft Sans Serif";
     sheet.FontSize=11f;
     sheet.Width=850;
     sheet.Height=1100;
     int rowH=19;
     int x=100;
     int y=100;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("PracticeTitle",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("PracticeAddress",sheet.FontSize,sheet.FontName,false,x,y,200,rowH,
         GrowthBehaviorEnum.DownLocal));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("practiceCityStateZip",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.nameFL",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.address",sheet.FontSize,sheet.FontName,false,x,y,200,rowH,
         GrowthBehaviorEnum.DownLocal));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.cityStateZip",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     y+=rowH;
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("today.DayDate",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     y+=rowH;
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText(@"Your insurance benefits will renew soon.  You have [insRemaining] remaining that can be applied towards important dental treatment."
         +@"  Our records show that the following treatment has not yet been completed."
         +"\r\n\r\n[treatmentPlanProcs]\r\n\r\n"
         +"Please call our office at your earliest convenience to schedule an appointment.",sheet.FontSize,sheet.FontName,false,x,y,650,200,
         GrowthBehaviorEnum.DownGlobal));
     y+=200;
     y+=rowH;
     y+=rowH;
     y+=rowH;
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.priProvNameFL",sheet.FontSize,sheet.FontName,false,x,y,240,rowH));
     return sheet;
 }
Exemple #19
0
		public static string SendSheetDefWithFieldDefs(SheetDef sheetdef) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				return Meth.GetString(MethodBase.GetCurrentMethod(),sheetdef);
			}
			if(sheetdef.SheetFieldDefs[0].FieldName=="FieldNameTeal") {
				return "fielddefOK";
			}
			return "error";
		}
Exemple #20
0
 private static SheetDef PatientRegistration()
 {
     SheetDef sheet=new SheetDef(SheetTypeEnum.PatientForm);
     sheet.Description="Registration Form";
     sheet.FontName="Microsoft Sans Serif";
     sheet.FontSize=10f;
     sheet.Width=850;
     sheet.Height=1100;
     int rowH=16;
     int y=31;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewImage("Patient Info.gif",39,y,761,988));
     y=204;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("LName",sheet.FontSize,sheet.FontName,false,126,y,150,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("FName",sheet.FontSize,sheet.FontName,false,293,y,145,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("MiddleI",sheet.FontSize,sheet.FontName,false,447,y,50,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("Preferred",sheet.FontSize,sheet.FontName,false,507,y,150,rowH));
     y=236;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("Birthdate",sheet.FontSize,sheet.FontName,false,133,y,105,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("SSN",sheet.FontSize,sheet.FontName,false,292,y,140,rowH));
     y=241;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("Gender","Male",499,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("Gender","Female",536,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("Position","Married",649,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("Position","Single",683,y,10,10));
     y=255;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("WkPhone",sheet.FontSize,sheet.FontName,false,152,y,120,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("WirelessPhone",sheet.FontSize,sheet.FontName,false,381,y,120,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("wirelessCarrier",sheet.FontSize,sheet.FontName,false,631,y,130,rowH));
     y=274;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("Email",sheet.FontSize,sheet.FontName,false,114,y,575,rowH));
     y=299;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferContactMethod","HmPhone",345,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferContactMethod","WkPhone",429,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferContactMethod","WirelessPh",513,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferContactMethod","Email",607,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewCheckBox("PreferContactMethodIsTextMessage",666,y,10,10));
     y=318;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferConfirmMethod","HmPhone",343,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferConfirmMethod","WkPhone",428,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferConfirmMethod","WirelessPh",511,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferConfirmMethod","Email",605,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewCheckBox("PreferConfirmMethodIsTextMessage",664,y,10,10));
     y=337;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferRecallMethod","HmPhone",343,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferRecallMethod","WkPhone",428,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferRecallMethod","WirelessPh",512,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("PreferRecallMethod","Email",605,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewCheckBox("PreferRecallMethodIsTextMessage",665,y,10,10));
     //cover up the options for text messages since we don't support that yet
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText(".",sheet.FontSize,sheet.FontName,false,660,293,100,70));
     y=356;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("StudentStatus","Nonstudent",346,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("StudentStatus","Fulltime",443,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("StudentStatus","Parttime",520,y,10,10));
     y+=33;//375;
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewCheckBox("guarantorIsSelf",270,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewCheckBox("guarantorIsOther",320,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("guarantorNameF",sheet.FontSize,sheet.FontName,false,378,370,150,rowH));
     //y=409;-34
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("referredFrom",sheet.FontSize,sheet.FontName,false,76,y,600,rowH));
     y+=64;//439;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewCheckBox("addressAndHmPhoneIsSameEntireFamily",283,y,10,10));
     y+=15;//453;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("Address",sheet.FontSize,sheet.FontName,false,128,y,425,rowH));
     y+=19;//472;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("Address2",sheet.FontSize,sheet.FontName,false,141,y,425,rowH));
     y+=19;//491;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("City",sheet.FontSize,sheet.FontName,false,103,y,200,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("State",sheet.FontSize,sheet.FontName,false,359,y,45,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("Zip",sheet.FontSize,sheet.FontName,false,439,y,100,rowH));
     y+=19;//510;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("HmPhone",sheet.FontSize,sheet.FontName,false,156,y,120,rowH));
     //Ins 1--------------------------------------------------------------------------------------------------------------
     y+=58;//569;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins1Relat","Self",267,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins1Relat","Spouse",320,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins1Relat","Child",394,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins1RelatIsNotSelfSpouseChild",457,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1RelatDescript",sheet.FontSize,sheet.FontName,false,515,598,200,rowH));
     y+=16;//585;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1SubscriberNameF",sheet.FontSize,sheet.FontName,false,184,y,250,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1SubscriberID",sheet.FontSize,sheet.FontName,false,565,y,140,rowH));
     y+=20;//604;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1CarrierName",sheet.FontSize,sheet.FontName,false,201,y,290,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1CarrierPhone",sheet.FontSize,sheet.FontName,false,552,y,170,rowH));
     y+=19;//623;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1EmployerName",sheet.FontSize,sheet.FontName,false,136,y,190,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1GroupName",sheet.FontSize,sheet.FontName,false,419,y,160,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins1GroupNum",sheet.FontSize,sheet.FontName,false,638,y,120,rowH));
     //Ins 2-------------------------------------------------------------------------------------------------------------
     y+=72;//695;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins2Relat","Self",267,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins2Relat","Spouse",320,y,10,10));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins2Relat","Child",394,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewRadioButton("ins2RelatIsNotSelfSpouseChild",457,y,10,10));
     //sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2RelatDescript",sheet.FontSize,sheet.FontName,false,515,598+126,200,rowH));
     y+=16;//585+126;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2SubscriberNameF",sheet.FontSize,sheet.FontName,false,184,y,250,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2SubscriberID",sheet.FontSize,sheet.FontName,false,565,y,140,rowH));
     y+=19;//604+126;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2CarrierName",sheet.FontSize,sheet.FontName,false,201,y,290,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2CarrierPhone",sheet.FontSize,sheet.FontName,false,552,y,170,rowH));
     y+=19;//623+126;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2EmployerName",sheet.FontSize,sheet.FontName,false,136,y,190,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2GroupName",sheet.FontSize,sheet.FontName,false,419,y,160,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("ins2GroupNum",sheet.FontSize,sheet.FontName,false,638,y,120,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("misc",sheet.FontSize,sheet.FontName,false,136,821,600,200));
     return sheet;
 }
Exemple #21
0
 public void UpLoadSheetDef(string RegistrationKey, SheetDef sheetDef) {
     this.Invoke("UpLoadSheetDef", new object[] {
                 RegistrationKey,
                 sheetDef});
 }
Exemple #22
0
 /// <remarks/>
 public void UpLoadSheetDefAsync(string RegistrationKey, SheetDef sheetDef, object userState) {
     if ((this.UpLoadSheetDefOperationCompleted == null)) {
         this.UpLoadSheetDefOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpLoadSheetDefOperationCompleted);
     }
     this.InvokeAsync("UpLoadSheetDef", new object[] {
                 RegistrationKey,
                 sheetDef}, this.UpLoadSheetDefOperationCompleted, userState);
 }
Exemple #23
0
        ///<summary>Called by eClipboard check-in once an appointment has been moved to the waiting room and the patient is ready to fill out forms.
        ///Returns number of new sheets created and inserted into Sheet table.</summary>
        public static int CreateSheetsForCheckIn(Appointment appt)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetInt(MethodBase.GetCurrentMethod(), appt));
            }
            if (!MobileAppDevices.IsClinicSignedUpForEClipboard(PrefC.HasClinicsEnabled?appt.ClinicNum:0))              //this clinic isn't signed up for this feature
            {
                return(0);
            }
            if (!ClinicPrefs.GetBool(PrefName.EClipboardCreateMissingFormsOnCheckIn, appt.ClinicNum))             //This feature is turned off
            {
                return(0);
            }
            bool useDefault = ClinicPrefs.GetBool(PrefName.EClipboardUseDefaults, appt.ClinicNum);
            List <EClipboardSheetDef> listSheetsToCreate = EClipboardSheetDefs.GetForClinic(useDefault ? 0 : appt.ClinicNum);

            if (listSheetsToCreate.Count == 0)            //There aren't any sheets to create here
            {
                return(0);
            }
            List <Sheet> listAlreadyCompleted  = Sheets.GetForPatient(appt.PatNum);
            List <Sheet> listAlreadyInTerminal = Sheets.GetForTerminal(appt.PatNum);

            //if we already have sheets queued for the patient don't add duplicates
            if (listAlreadyInTerminal.Count > 0)
            {
                listAlreadyCompleted.RemoveAll(x => listAlreadyInTerminal.Select(y => y.SheetNum).Contains(x.SheetNum));
                listSheetsToCreate.RemoveAll(x => listAlreadyInTerminal.Select(y => y.SheetDefNum).Contains(x.SheetDefNum));
            }
            byte         showInTerminal = GetBiggestShowInTerminal(appt.PatNum);
            List <Sheet> listNewSheets  = new List <Sheet>();

            foreach (EClipboardSheetDef sheetInsert in listSheetsToCreate.OrderBy(x => x.ItemOrder))
            {
                //First check if we've already completed this form against our resubmission interval rules
                DateTime lastCompleted = listAlreadyCompleted
                                         .Where(x => x.SheetDefNum == sheetInsert.SheetDefNum)
                                         .OrderBy(x => x.DateTimeSheet)
                                         .LastOrDefault()?.DateTimeSheet ?? DateTime.MinValue;
                if (lastCompleted > DateTime.MinValue)
                {
                    if (sheetInsert.ResubmitInterval.Days == 0)
                    {
                        continue;                         //If this interval is set to 0 and they've already completed this form once, we never want to create it automatically again
                    }
                    int elapsed = (DateTime.Today - lastCompleted.Date).Days;
                    if (elapsed < sheetInsert.ResubmitInterval.Days)
                    {
                        continue;                         //The interval hasn't elapsed yet so we don't want to create this sheet
                    }
                }
                SheetDef def      = SheetDefs.GetSheetDef(sheetInsert.SheetDefNum);
                Sheet    newSheet = CreateSheetFromSheetDef(def, appt.PatNum);
                SheetParameter.SetParameter(newSheet, "PatNum", appt.PatNum);
                SheetFiller.FillFields(newSheet);
                //Counting starts at 1 in this case and we don't want to ovewrite the previous number so increment first
                newSheet.ShowInTerminal = ++showInTerminal;
                listNewSheets.Add(newSheet);
            }
            SaveNewSheetList(listNewSheets);
            return(listNewSheets.Count);
        }
Exemple #24
0
 private static SheetDef ReferralLetter()
 {
     SheetDef sheet=new SheetDef(SheetTypeEnum.ReferralLetter);
     sheet.Description="Referral Letter";
     sheet.FontName="Microsoft Sans Serif";
     sheet.FontSize=11f;
     sheet.Width=850;
     sheet.Height=1100;
     int rowH=19;
     int x=100;
     int y=100;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("PracticeTitle",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("PracticeAddress",sheet.FontSize,sheet.FontName,false,x,y,200,rowH,
         GrowthBehaviorEnum.DownLocal));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("practiceCityStateZip",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.nameFL",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.address",sheet.FontSize,sheet.FontName,false,x,y,200,rowH,
         GrowthBehaviorEnum.DownLocal));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.cityStateZip",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     y+=rowH;
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("today.DayDate",sheet.FontSize,sheet.FontName,false,x,y,200,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("RE patient:",sheet.FontSize,sheet.FontName,false,x,y,90,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.nameFL",sheet.FontSize,sheet.FontName,false,x+90,y,200,rowH));
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.salutation",sheet.FontSize,sheet.FontName,false,x,y,280,rowH));
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("letter text",sheet.FontSize,sheet.FontName,false,x,y,650,rowH,
         GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Sincerely,",sheet.FontSize,sheet.FontName,false,x,y,100,rowH));
     y+=rowH;
     y+=rowH;
     y+=rowH;
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.priProvNameFL",sheet.FontSize,sheet.FontName,false,x,y,250,rowH));
     return sheet;
 }
Exemple #25
0
 private void FillSheetDef(SheetDef sheetDef,webforms_sheetdef SheetDefObj)
 {
     SheetDefObj.Description=sheetDef.Description;
     SheetDefObj.FontName=sheetDef.FontName;
     SheetDefObj.SheetType=(int)sheetDef.SheetType;
     SheetDefObj.FontSize=sheetDef.FontSize;
     SheetDefObj.Width=sheetDef.Width;
     SheetDefObj.Height=sheetDef.Height;
     if(sheetDef.IsLandscape==true) {
         SheetDefObj.IsLandscape=(sbyte)1;
     }
     else {
         SheetDefObj.IsLandscape=(sbyte)0;
     }
 }
Exemple #26
0
 private static SheetDef ReferralSlip()
 {
     SheetDef sheet=new SheetDef(SheetTypeEnum.ReferralSlip);
     sheet.Description="Referral Slip";
     sheet.FontName="Microsoft Sans Serif";
     sheet.FontSize=9f;
     sheet.Width=450;
     sheet.Height=650;
     int rowH=17;
     int yPos=50;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Referral to",10,sheet.FontName,true,170,yPos,200,19));
     yPos+=rowH+5;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.nameFL",sheet.FontSize,sheet.FontName,false,150,yPos,200,rowH));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.address",sheet.FontSize,sheet.FontName,false,150,yPos,200,rowH,GrowthBehaviorEnum.DownLocal));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.cityStateZip",sheet.FontSize,sheet.FontName,false,150,yPos,200,rowH));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("referral.phone",sheet.FontSize,sheet.FontName,false,150,yPos,200,rowH));
     yPos+=rowH+30;
     //Patient--------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Patient",9,sheet.FontName,true,25,yPos,100,rowH));
     yPos+=rowH+5;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.nameFL",sheet.FontSize,sheet.FontName,false,25,yPos,200,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("dateTime.Today",sheet.FontSize,sheet.FontName,false,300, yPos,100,rowH));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Work:",sheet.FontSize,sheet.FontName,false,25,yPos,38,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.WkPhone",sheet.FontSize,sheet.FontName,false,63,yPos,300,rowH));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Home:",sheet.FontSize,sheet.FontName,false,25,yPos,42,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.HmPhone",sheet.FontSize,sheet.FontName,false,67,yPos,300,rowH));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Wireless:",sheet.FontSize,sheet.FontName,false,25,yPos,58,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.WirelessPhone",sheet.FontSize,sheet.FontName,false,83,yPos,300,rowH));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.address",sheet.FontSize,sheet.FontName,false,25,yPos,300,rowH,GrowthBehaviorEnum.DownLocal));
     yPos+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.cityStateZip",sheet.FontSize,sheet.FontName,false,25,yPos,300,rowH));
     yPos+=rowH+30;
     //Provider--------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Referred by",9,sheet.FontName,true,25,yPos,300,rowH));
     yPos+=rowH+5;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("patient.provider",sheet.FontSize,sheet.FontName,false,25,yPos,300,rowH));
     yPos+=rowH+20;
     //Notes--------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Notes",9,sheet.FontName,true,25,yPos,300,rowH));
     yPos+=rowH+5;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewInput("notes",sheet.FontSize,sheet.FontName,false,25,yPos,400,240));
     return sheet;
 }
Exemple #27
0
		private void butImport_Click(object sender,EventArgs e) {
			Cursor=Cursors.WaitCursor;
			OpenFileDialog openDlg=new OpenFileDialog();
			string initDir=PrefC.GetString(PrefName.ExportPath);
			if(Directory.Exists(initDir)) {
				openDlg.InitialDirectory=initDir;
			}
			if(openDlg.ShowDialog()!=DialogResult.OK) {
				Cursor=Cursors.Default;
				return;
			}
			try {
				//ImportCustomSheetDef(openDlg.FileName);
				SheetDef sheetdef=new SheetDef();
				XmlSerializer serializer=new XmlSerializer(typeof(SheetDef));
				if(openDlg.FileName!="") {
					if(!File.Exists(openDlg.FileName)) {
						throw new ApplicationException(Lan.g("FormSheetDefs","File does not exist."));
					}
					try {
						using(TextReader reader=new StreamReader(openDlg.FileName)) {
							sheetdef=(SheetDef)serializer.Deserialize(reader);
						}
					}
					catch {
						throw new ApplicationException(Lan.g("FormSheetDefs","Invalid file format"));
					}
				}
				sheetdef.IsNew=true;
				//Users might be importing a sheet that was developed in an older version that does not support ItemColor.  Default them to black if necessary.
				for(int i=0;i<sheetdef.SheetFieldDefs.Count;i++) {
					//Static text, lines, and rectangles are the only field types that support ItemColor.
					if(sheetdef.SheetFieldDefs[i].FieldType!=SheetFieldType.StaticText
						&& sheetdef.SheetFieldDefs[i].FieldType!=SheetFieldType.Line
						&& sheetdef.SheetFieldDefs[i].FieldType!=SheetFieldType.Rectangle) 
					{
						continue;
					}
					//ItemColor will be set to "Empty" if this is a sheet that was exported from a previous version that didn't support ItemColor.
					//Color.Empty will actually draw but will be 'invisible' to the user.  For this reason, we considered this a bug and defaulted the color to black.
					if(sheetdef.SheetFieldDefs[i].ItemColor==Color.Empty) {
						sheetdef.SheetFieldDefs[i].ItemColor=Color.Black;//Old sheet behavior was to always draw these field types in black.
					}
				}
				SheetDefs.InsertOrUpdate(sheetdef);
				FillGrid2();
				for(int i=0;i<SheetDefC.Listt.Count;i++) {
					if(SheetDefC.Listt[i].SheetDefNum==sheetdef.SheetDefNum) {
						grid2.SetSelected(i,true);
					}
				}
			}
			catch(ApplicationException ex) {
				Cursor=Cursors.Default;
				MessageBox.Show(ex.Message);
				FillGrid2();
				return;
			}
			Cursor=Cursors.Default;
			MsgBox.Show(this,"Imported.");
		}
Exemple #28
0
 ///<summary>Determines if a sheetDef is of a SheetTypeEnum that describes a Dashboard.</summary>
 public static bool IsDashboardType(SheetDef sheetDef)
 {
     return(IsDashboardType(sheetDef.SheetType));
 }
Exemple #29
0
 /// <summary>
 /// </summary>
 private Sheet CreateSheet(long PatNum,WebSheets.SheetAndSheetField sAnds)
 {
     Sheet newSheet=null;
     try{
         SheetDef sheetDef=new SheetDef((SheetTypeEnum)sAnds.web_sheet.SheetType);
             newSheet=SheetUtil.CreateSheet(sheetDef,PatNum);
             SheetParameter.SetParameter(newSheet,"PatNum",PatNum);
             newSheet.DateTimeSheet=sAnds.web_sheet.DateTimeSheet;
             newSheet.Description=sAnds.web_sheet.Description;
             newSheet.Height=sAnds.web_sheet.Height;
             newSheet.Width=sAnds.web_sheet.Width;
             newSheet.FontName=sAnds.web_sheet.FontName;
             newSheet.FontSize=sAnds.web_sheet.FontSize;
             newSheet.SheetType=(SheetTypeEnum)sAnds.web_sheet.SheetType;
             newSheet.IsLandscape=sAnds.web_sheet.IsLandscape==(sbyte)1?true:false;
             newSheet.InternalNote="";
             newSheet.IsWebForm=true;
             //loop through each variable in a single sheetfield
             for(int i=0;i<sAnds.web_sheetfieldlist.Count();i++) {
                 SheetField sheetfield=new SheetField();
                 sheetfield.FieldName=sAnds.web_sheetfieldlist[i].FieldName;
                 sheetfield.FieldType=(SheetFieldType)sAnds.web_sheetfieldlist[i].FieldType;
                 //sheetfield.FontIsBold=sAnds.web_sheetfieldlist[i].FontIsBold==(sbyte)1?true:false;
                 if(sAnds.web_sheetfieldlist[i].FontIsBold==(sbyte)1) {
                     sheetfield.FontIsBold=true;
                 }else{
                     sheetfield.FontIsBold=false;
                 }
                 sheetfield.FontIsBold=sAnds.web_sheetfieldlist[i].FontIsBold==(sbyte)1?true:false;
                 sheetfield.FontName=sAnds.web_sheetfieldlist[i].FontName;
                 sheetfield.FontSize=sAnds.web_sheetfieldlist[i].FontSize;
                 sheetfield.Height=sAnds.web_sheetfieldlist[i].Height;
                 sheetfield.Width=sAnds.web_sheetfieldlist[i].Width;
                 sheetfield.XPos=sAnds.web_sheetfieldlist[i].XPos;
                 sheetfield.YPos=sAnds.web_sheetfieldlist[i].YPos;
                 //sheetfield.IsRequired=sAnds.web_sheetfieldlist[i].IsRequired==(sbyte)1?true:false;
                 if(sAnds.web_sheetfieldlist[i].IsRequired==(sbyte)1) {
                     sheetfield.IsRequired=true;
                 }
                 else {
                     sheetfield.IsRequired=false;
                 }
                 sheetfield.TabOrder=sAnds.web_sheetfieldlist[i].TabOrder;
                 sheetfield.RadioButtonGroup=sAnds.web_sheetfieldlist[i].RadioButtonGroup;
                 sheetfield.RadioButtonValue=sAnds.web_sheetfieldlist[i].RadioButtonValue;
                 sheetfield.GrowthBehavior=(GrowthBehaviorEnum)sAnds.web_sheetfieldlist[i].GrowthBehavior;
                 sheetfield.FieldValue=sAnds.web_sheetfieldlist[i].FieldValue;
                 newSheet.SheetFields.Add(sheetfield);
             }// end of j loop
             Sheets.SaveNewSheet(newSheet);
             return newSheet;
     }
     catch(Exception e) {
         gridMain.EndUpdate();
         MessageBox.Show(e.Message);
     }
     return newSheet;
 }
Exemple #30
0
		private void LoadImagesToSheetDef(SheetDef sheetDefCur){
			for(int j=0;j<sheetDefCur.SheetFieldDefs.Count;j++) {
				try {
					if(sheetDefCur.SheetFieldDefs[j].FieldType==SheetFieldType.Image) {
						string filePathAndName=ODFileUtils.CombinePaths(SheetUtil.GetImagePath(),sheetDefCur.SheetFieldDefs[j].FieldName);
						Image img=null;
						if(sheetDefCur.SheetFieldDefs[j].FieldName=="Patient Info.gif") {
							img=OpenDentBusiness.Properties.Resources.Patient_Info;
						}
						else if(File.Exists(filePathAndName)) {
							img=Image.FromFile(filePathAndName);
						}
						//sheetDefCur.SheetFieldDefs[j].ImageData=POut.Bitmap(new Bitmap(img),ImageFormat.Png);//Because that's what we did before. Review this later. 
						long fileByteSize=0;
						using(MemoryStream ms = new MemoryStream()) {
							img.Save(ms,img.RawFormat); // done solely to compute the file size of the image
							fileByteSize = ms.Length;
						}
						if(fileByteSize>2000000) {
							//for large images greater that ~2MB use jpeg format for compression. Large images in the 4MB + range have difficulty being displayed. It could be an issue with MYSQL or ASP.NET
							sheetDefCur.SheetFieldDefs[j].ImageData=POut.Bitmap(new Bitmap(img),ImageFormat.Jpeg);
						}
						else {
							sheetDefCur.SheetFieldDefs[j].ImageData=POut.Bitmap(new Bitmap(img),img.RawFormat);
						}
					}
					else {
						sheetDefCur.SheetFieldDefs[j].ImageData="";// because null is not allowed
					}
				}
				catch(Exception ex) {
					sheetDefCur.SheetFieldDefs[j].ImageData="";
					MessageBox.Show(ex.Message);
				}
			}
		}
Exemple #31
0
 /// <remarks/>
 public void UpLoadSheetDefAsync(string RegistrationKey, SheetDef sheetDef) {
     this.UpLoadSheetDefAsync(RegistrationKey, sheetDef, null);
 }
Exemple #32
0
        public static Sheet CreateSheetFromSheetDef(SheetDef sheetDef, long patNum = 0, bool hidePaymentOptions = false)
        {
            bool FieldIsPaymentOptionHelper(SheetFieldDef sheetFieldDef)
            {
                if (sheetFieldDef.IsPaymentOption)
                {
                    return(true);
                }
                switch (sheetFieldDef.FieldName)
                {
                case "StatementEnclosed":
                case "StatementAging":
                    return(true);
                }
                return(false);
            }

            List <SheetField> CreateFieldList(List <SheetFieldDef> sheetFieldDefList)
            {
                List <SheetField> retVal = new List <SheetField>();
                SheetField        field;

                foreach (SheetFieldDef sheetFieldDef in sheetFieldDefList)
                {
                    if (hidePaymentOptions && FieldIsPaymentOptionHelper(sheetFieldDef))
                    {
                        continue;
                    }
                    field = new SheetField {
                        IsNew            = true,
                        FieldName        = sheetFieldDef.FieldName,
                        FieldType        = sheetFieldDef.FieldType,
                        FieldValue       = sheetFieldDef.FieldValue,
                        FontIsBold       = sheetFieldDef.FontIsBold,
                        FontName         = sheetFieldDef.FontName,
                        FontSize         = sheetFieldDef.FontSize,
                        GrowthBehavior   = sheetFieldDef.GrowthBehavior,
                        Height           = sheetFieldDef.Height,
                        RadioButtonValue = sheetFieldDef.RadioButtonValue,
                        //field.SheetNum=sheetFieldDef.SheetNum;//set later
                        Width                    = sheetFieldDef.Width,
                        XPos                     = sheetFieldDef.XPos,
                        YPos                     = sheetFieldDef.YPos,
                        RadioButtonGroup         = sheetFieldDef.RadioButtonGroup,
                        IsRequired               = sheetFieldDef.IsRequired,
                        TabOrder                 = sheetFieldDef.TabOrder,
                        ReportableName           = sheetFieldDef.ReportableName,
                        TextAlign                = sheetFieldDef.TextAlign,
                        ItemColor                = sheetFieldDef.ItemColor,
                        IsLocked                 = sheetFieldDef.IsLocked,
                        TabOrderMobile           = sheetFieldDef.TabOrderMobile,
                        UiLabelMobile            = sheetFieldDef.UiLabelMobile,
                        UiLabelMobileRadioButton = sheetFieldDef.UiLabelMobileRadioButton,
                    };
                    retVal.Add(field);
                }
                return(retVal);
            }

            Sheet sheet = new Sheet {
                IsNew           = true,
                DateTimeSheet   = DateTime.Now,
                FontName        = sheetDef.FontName,
                FontSize        = sheetDef.FontSize,
                Height          = sheetDef.Height,
                SheetType       = sheetDef.SheetType,
                Width           = sheetDef.Width,
                PatNum          = patNum,
                Description     = sheetDef.Description,
                IsLandscape     = sheetDef.IsLandscape,
                IsMultiPage     = sheetDef.IsMultiPage,
                SheetFields     = CreateFieldList(sheetDef.SheetFieldDefs),          //Blank fields with no values. Values filled later from SheetFiller.FillFields()
                Parameters      = sheetDef.Parameters,
                SheetDefNum     = sheetDef.SheetDefNum,
                HasMobileLayout = sheetDef.HasMobileLayout,
            };

            return(sheet);
        }
Exemple #33
0
		///<summary>Creates a Sheet object from a sheetDef, complete with fields and parameters.  This overload is only to be used when the sheet will not be saved to the database, such as for labels</summary>
		public static Sheet CreateSheet(SheetDef sheetDef) {
			return CreateSheet(sheetDef,0);
		}
Exemple #34
0
 public void UpLoadSheetDef(string RegistrationKey,SheetDef sheetDef)
 {
     ODWebServiceEntities db=new ODWebServiceEntities();
     long DentalOfficeID=util.GetDentalOfficeID(RegistrationKey);
     try{
         if(DentalOfficeID==0) {
             return;
         }
         var PreferenceResult=db.webforms_preference.Where(pref=>pref.DentalOfficeID==DentalOfficeID);
         webforms_sheetdef SheetDefObj=null;
         SheetDefObj=new webforms_sheetdef();
         PreferenceResult.First().webforms_sheetdef.Add(SheetDefObj);
         FillSheetDef(sheetDef,SheetDefObj);
         FillFieldSheetDef(sheetDef,SheetDefObj);
         db.SaveChanges();
     }
     catch(Exception ex) {
         Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+DentalOfficeID,ex);
         return ;
     }
 }
Exemple #35
0
 private static SheetDef RoutingSlip()
 {
     SheetDef sheet=new SheetDef(SheetTypeEnum.RoutingSlip);
     sheet.Description="Routing Slip";
     sheet.FontName="Microsoft Sans Serif";
     sheet.FontSize=10f;
     sheet.Width=850;
     sheet.Height=1100;
     int rowH=18;
     int x=75;
     int y=50;
     //Title----------------------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Routing Slip",12f,sheet.FontName,true,373,y,200,22));
     y+=35;
     //Today's appointment, including procedures-----------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("[nameFL]",sheet.FontSize,sheet.FontName,true,x,y,500,19));
     y+=19;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("appt.timeDate",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("appt.length",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("appt.providers",sheet.FontSize,sheet.FontName,false,x,y,500,rowH,GrowthBehaviorEnum.DownGlobal));
     y+=rowH-2;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Procedures:",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("appt.procedures",sheet.FontSize,sheet.FontName,false,x+10,y,490,rowH,GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Note:",sheet.FontSize,sheet.FontName,false,x,y,40,rowH));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("appt.Note",sheet.FontSize,sheet.FontName,false,x+40,y,460,rowH,GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     y+=3;
     //Patient/Family Info---------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(x,y,725,0));
     y+=3;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Patient Info",sheet.FontSize,sheet.FontName,true,x,y,500,19));
     y+=19;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("PatNum: [PatNum]",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Age: [age]",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Date of First Visit: [DateFirstVisit]",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Billing Type: [BillingType]",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Recall Due Date: [dateRecallDue]",sheet.FontSize,sheet.FontName,false,x,y,500,rowH));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Medical notes: [MedUrgNote]",sheet.FontSize,sheet.FontName,false,x,y,725,rowH,GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Other Family Members",sheet.FontSize,sheet.FontName,true,x,y,500,19));
     y+=19;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewOutput("otherFamilyMembers",sheet.FontSize,sheet.FontName,false,x,y,500,rowH,GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     y+=3;
     //Insurance Info---------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(x,y,725,0));
     y+=3;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Primary Insurance",sheet.FontSize,sheet.FontName,true,x,y,360,19));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Secondary Insurance",sheet.FontSize,sheet.FontName,true,x+365,y,360,19));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(x+362,y,0,124));
     y+=19;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText(
     @"[carrierName]
     Subscriber: [subscriberNameFL]
     Annual Max: [insAnnualMax], Pending: [insPending], Used: [insUsed]
     Deductible: [insDeductible], Ded Used: [insDeductibleUsed]
     [insPercentages]"
         ,sheet.FontSize,sheet.FontName,false,x,y,360,105,GrowthBehaviorEnum.DownGlobal));
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText(
     @"[carrier2Name]
     Subscriber: [subscriber2NameFL]
     Annual Max: [ins2AnnualMax], Pending: [ins2Pending], Used: [ins2Used]
     Deductible: [ins2Deductible], Ded Used: [ins2DeductibleUsed]
     [ins2Percentages]"
         ,sheet.FontSize,sheet.FontName,false,x+365,y,360,105,GrowthBehaviorEnum.DownGlobal));
     y+=105;
     //Account Info---------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(x,y,725,0));
     y+=3;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Account Info",sheet.FontSize,sheet.FontName,true,x,y,500,19));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText(
         @"Guarantor: [guarantorNameFL]
     Balance: [balTotal]
     -Ins Est: [balInsEst]
     =Total: [balTotalMinusInsEst]
     Aging: 0-30:[bal_0_30]  31-60:[bal_31_60]  61-90:[bal_61_90]  90+:[balOver90]
     Fam Urgent Fin Note: [famFinUrgNote]"
         ,sheet.FontSize,sheet.FontName,false,x,y,725,rowH,GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     y+=3;
     //Insurance Info---------------------------------------------------------------------------------------------
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewLine(x,y,725,0));
     y+=3;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("Treatment Plan",sheet.FontSize,sheet.FontName,true,x,y,500,19,GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     sheet.SheetFieldDefs.Add(SheetFieldDef.NewStaticText("[treatmentPlanProcs]",sheet.FontSize,sheet.FontName,false,x,y,500,19,GrowthBehaviorEnum.DownGlobal));
     y+=rowH;
     return sheet;
 }
Exemple #36
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;
		}
Exemple #37
0
 private void FillFieldSheetDef(SheetDef sheetDef,webforms_sheetdef SheetDefObj)
 {
     for(int i=0;i<sheetDef.SheetFieldDefs.Count();i++) {//assign several webforms_sheetfielddef
         webforms_sheetfielddef SheetFieldDefObj=new webforms_sheetfielddef();
         SheetDefObj.webforms_sheetfielddef.Add(SheetFieldDefObj);
         // assign each property of a single webforms_sheetfielddef with corresponding values.
         foreach(FieldInfo fieldinfo in sheetDef.SheetFieldDefs[i].GetType().GetFields()) {
             foreach(PropertyInfo propertyinfo in SheetFieldDefObj.GetType().GetProperties()) {
                 if(fieldinfo.Name==propertyinfo.Name) {
                     if(propertyinfo.PropertyType==typeof(SByte)) {
                         if((bool)fieldinfo.GetValue(sheetDef.SheetFieldDefs[i])==true) {
                             propertyinfo.SetValue(SheetFieldDefObj,(sbyte)1,null);
                         }
                         else {
                             propertyinfo.SetValue(SheetFieldDefObj,(sbyte)0,null);
                         }
                     }
                     else {
                         if(fieldinfo.GetValue(sheetDef.SheetFieldDefs[i])==null) {
                             propertyinfo.SetValue(SheetFieldDefObj,"",null);
                         }
                         else {
                             propertyinfo.SetValue(SheetFieldDefObj,fieldinfo.GetValue(sheetDef.SheetFieldDefs[i]),null);
                         }
                     }
                 }
             }//foreach propertyinfo
         }//foreach fieldinfo
     }
 }