示例#1
0
 public void DeleteSheetData(string RegistrationKey,List<long> SheetsForDeletion)
 {
     long DentalOfficeID=util.GetDentalOfficeID(RegistrationKey);
     try {
         if(DentalOfficeID==0) {
             return;
         }
         ODWebServiceEntities db=new ODWebServiceEntities();
         for(int i=0;i<SheetsForDeletion.Count();i++) {
             long SheetID=SheetsForDeletion.ElementAt(i);// LINQ throws an error if this is directly put into the select expression
             // first delete all sheet field then delete the sheet so that a foreign key error is not thrown
             var delSheetField=from wsf in db.webforms_sheetfield where wsf.webforms_sheet.SheetID==SheetID
                             select wsf;
             for(int j=0;j<delSheetField.Count();j++) {
                 // the ElementAt operator only works with lists. Hence ToList()
                 db.DeleteObject(delSheetField.ToList().ElementAt(j));
             }
             var delSheet=from ws in db.webforms_sheet where ws.SheetID==SheetID
                 select ws;
             db.DeleteObject(delSheet.First());
             Logger.Information("deleted SheetID="+SheetID+" DentalOfficeID="+DentalOfficeID);
         }
         db.SaveChanges();
         Logger.Information("In DeleteSheetData IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+DentalOfficeID);
     }
     catch(Exception ex) {
         Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+DentalOfficeID,ex);
     }
 }
示例#2
0
 public AccountModel(Patientm patm)
 {
     String formatstring="{0:0.00}";
     BalTotal="$"+String.Format(formatstring,Math.Abs(patm.BalTotal));
     InsEst="$"+String.Format(formatstring,Math.Abs(patm.InsEst));
     AfterIns="$"+String.Format(formatstring,Math.Abs(patm.BalTotal-patm.InsEst));
     if(patm.BalTotal<0) {
         BalTotal="-"+BalTotal;
     }
     else {
         BalTotal=" "+BalTotal;
     }
     if(patm.InsEst<0) {
         InsEst="-"+InsEst;
     }
     else {
         InsEst=" "+InsEst;
     }
     if((patm.BalTotal-patm.InsEst)<0) {
         AfterIns="-"+AfterIns;
     }
     else {
         AfterIns=" "+AfterIns;
     }
     statementmList=Statementms.GetStatementms(patm.CustomerNum,patm.PatNum);
 }
示例#3
0
 public FamilyModel(Patientm patm)
 {
     this.patm=patm;
     patList=Patientms.GetPatientmsOfFamily(patm.CustomerNum,patm.PatNum);
     foreach(Patientm pm in patList) {
         pm.Age=Patientms.DateToAge(pm.Birthdate);
     }
 }
示例#4
0
		public void DeleteObjects(String RegistrationKey,List<DeletedObject> dOList) {
			try {
				Logger.Information("In DeleteObjects");
				customerNum=util.GetDentalOfficeID(RegistrationKey);
				if(customerNum==0) {
					return;
				}
				DeletedObjects.DeleteForMobile(dOList,customerNum);
			}
			catch(Exception ex) {
				Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+customerNum,ex);
				throw new Exception("Exception in DeleteObjects");
			}
		}
示例#5
0
 public MedicalModel FillData()
 {
     mStatementmList=Statementms.GetStatementms(patm.CustomerNum,patm.PatNum);
         mLabPanelmList=LabPanelms.GetLabPanelms(patm.CustomerNum,patm.PatNum);
         if(mLabPanelmList.Count==0) {
             MessageLabPanel="Lab Panels: No Lab Panels found";
         }
         mMedicationmDataTable=MedicationPatms.GetMedicationmDetails(patm.CustomerNum,patm.PatNum);
         if(mMedicationmDataTable.Rows.Count==0) {
             MessageMedication="Medications: No Medications found";
         }
         mDiseasemDataTable=Diseasems.GetDiseasemDetails(patm.CustomerNum,patm.PatNum);
         if(mDiseasemDataTable.Rows.Count==0) {
             MessageProblem="Problems: No Problems found";
         }
         mAllergymDataTable=Allergyms.GetAllergymDetails(patm.CustomerNum,patm.PatNum);
         if(mAllergymDataTable.Rows.Count==0) {
             MessageAllergy="Allergies: No Allergies found";
         }
         return this;
 }
示例#6
0
		protected void Page_Load(object sender,EventArgs e) {
			try {
				CustomerNum=util.GetCustomerNum(Message);
				if(CustomerNum==0) {
					return;
				}
				if(Request["searchterm"]!=null) {
					searchterm=Request["searchterm"].Trim();
				}
				if(searchterm!="") {
					patientmList=Patientms.GetPatientms(CustomerNum,searchterm);
					if(patientmList.Count==0) {
						MessageNoPatients.Text="No patients found. Please search again.";
					}
				}
				Repeater1.DataSource=patientmList;
				Repeater1.DataBind();
			}
			catch(Exception ex) {
				LabelError.Text=Util.ErrorMessage;
				Logger.LogError(ex);
			}
		}
示例#7
0
 public SheetAndSheetField(webforms_sheet web_sheet,List<webforms_sheetfield> web_sheetfieldlist)
 {
     this.web_sheet=web_sheet;
     this.web_sheetfieldlist=web_sheetfieldlist;
 }
示例#8
0
 public List<SheetAndSheetField> GetSheets(string RegistrationKey)
 {
     List<SheetAndSheetField> sAndsfList=new List<SheetAndSheetField>();
     long DentalOfficeID=util.GetDentalOfficeID(RegistrationKey);
     try {
         if(DentalOfficeID==0) {
             return sAndsfList;
         }
         ODWebServiceEntities db=new ODWebServiceEntities();
         var wsRes=from wsf in db.webforms_sheet
                   where wsf.webforms_preference.DentalOfficeID==DentalOfficeID
                   select wsf;
         for(int i=0;i<wsRes.Count();i++) {
             var wsobj=wsRes.ToList()[i];
             wsobj.webforms_sheetfield.Load();
             var sheetfieldList=wsobj.webforms_sheetfield;
             SheetAndSheetField sAnds=new SheetAndSheetField(wsobj,sheetfieldList.ToList());
             sAndsfList.Add(sAnds);
         }
         Logger.Information("In GetSheetData IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+DentalOfficeID+" Sheets sent to Client="+wsRes.Count());
         return sAndsfList;
     }
     catch(Exception ex) {
         Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+DentalOfficeID,ex);
         return sAndsfList;
     }
 }
示例#9
0
        protected override void OnLoad(EventArgs e)
        {
            String setOptionFormat = "\t\t\t\tJuiceHelpers.GetMemberInfo(() => {0})";
            String paramdocFormat = "\t\t/// <param name=\"{0}\">{1}</param>";
            String optionsMapFormat = "\t\t\t\t{{ \"{0}\", \"{1}\" }}";
            String paramFormat = "{0} {1} = {2}";

            List<String> widgets = new List<string>(){
                "Anchor",
                "Button",
                "Checkbox",
                "Collapsible",
                "CollapsibleSet",
                "Content",
                "ControlGroup",
                "Dialog",
                "FieldContainer",
                "FlipToggle",
                "Footer",
                "Header",
                "Listview",
                "Navbar",
                "Page",
                "Popup",
                "PopupAnchor",
                "RadioButton",
                "Select",
                "Slider",
                "Textbox"
            };

            foreach(var widgetName in widgets) {

                List<String> setOptionList = new List<string>();
                List<String> paramdocList = new List<string>();
                List<String> optionMapList = new List<string>();
                List<String> paramShortList = new List<string>();
                List<String> paramList = new List<String>();

                //String widgetName = "Button";
                String typeFormat = "Juice.Mobile.{0}, JuiceUI";
                Type widgetType = Type.GetType(String.Format(typeFormat, widgetName), false, true);
                String classTemplate = "";
                TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;

                List<Option> widgetOptions =
                    (from property in TypeDescriptor.GetProperties(widgetType).OfType<PropertyDescriptor>()
                     let attribute = property.Attributes.OfType<WidgetOptionAttribute>().SingleOrDefault()
                     let docAttribute = property.Attributes.OfType<WidgetDocumentAttribute>().SingleOrDefault()
                     let hideAttribute = property.Attributes.OfType<EditorBrowsableAttribute>().SingleOrDefault()
                     where (attribute != null || docAttribute != null) && (hideAttribute == null || hideAttribute.State != EditorBrowsableState.Never)
                     select new Option() {
                         Property = property,
                         WidgetOption = attribute
                     }).ToList();

                foreach(var o in widgetOptions) {

                    var descAttr = o.Property.Attributes.OfType<DescriptionAttribute>().SingleOrDefault();
                    String optionName = o.WidgetOption.Name;
                    String[] parts = optionName.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
                    String paramName = parts[0];

                    for(var i = 1; i < parts.Length; i++) {
                        paramName += textInfo.ToTitleCase(parts[i]);
                    }

                    if(descAttr != null) {
                        paramdocList.Add(String.Format(paramdocFormat, paramName, descAttr.Description));
                    }
                    optionMapList.Add(String.Format(optionsMapFormat, paramName, optionName));
                    setOptionList.Add(String.Format(setOptionFormat, paramName));
                    paramShortList.Add(paramName);

                    Type type = o.Property.PropertyType;
                    object def = o.WidgetOption.DefaultValue;
                    String defaultValue = def == null ? "null" : def.ToString();
                    String typeName = type.Name;

                    if((type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))) {
                        Type[] args = type.GetGenericArguments();
                        if(args.Length > 0) {
                            typeName = args[0].Name + "?";
                        }
                    }

                    if(type == typeof(bool) || type == typeof(Boolean)) {
                        defaultValue = defaultValue.ToLower();
                    }

                    if(type == typeof(string) || type == typeof(String)) {
                        defaultValue = "\"" + defaultValue + "\"";
                    }

                    paramList.Add(String.Format(paramFormat, typeName, paramName, String.IsNullOrEmpty(defaultValue) ? "\"\"" : defaultValue));
                }

                using(var sr = new StreamReader(Server.MapPath("MobileMvcTemplate.txt"))) {
                    classTemplate = sr.ReadToEnd();
                }

                String setOptions = String.Join(",\n", setOptionList.ToArray());
                String paramdocs = String.Join(",\n", paramdocList.ToArray());
                String optionMap = String.Join(",\n", optionMapList.ToArray());
                String paramsShort = String.Join(", ", paramShortList.ToArray());
                String @params = String.Join(", ", paramList.ToArray());

                DirectoryInfo dir = new DirectoryInfo(Server.MapPath("~/") + "/../output");

                String result = classTemplate
                    .Replace("{typeName}", widgetName)
                    .Replace("{setOptions}", setOptions)
                    .Replace("{paramdocs}", paramdocs)
                    .Replace("{optionMap}", optionMap)
                    .Replace("{paramsShort}", paramsShort)
                    .Replace("{parameters}", @params);

                using(var sw = new StreamWriter(Path.Combine(dir.FullName, widgetName + ".cs"))) {
                    sw.Write(result);
                }

            }
        }
示例#10
0
			public void SynchStatements(String RegistrationKey,List<Statementm> statementList) {
				try {
					Logger.Information("In SynchStatements");
					customerNum=util.GetDentalOfficeID(RegistrationKey);
					if(customerNum==0) {
						return;
					}
					Statementms.UpdateFromChangeList(statementList,customerNum);
					//now delete some statements to restrict the number of statements per patient.
					int limitPerPatient=5;
					List<long> patList=statementList.Select(sl=>sl.PatNum).Distinct().ToList();//select distint patients from the list.
					Statementms.LimitStatementmsPerPatient(patList,customerNum,limitPerPatient);
				}
				catch(Exception ex) {
					Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+customerNum,ex);
					throw new Exception("Exception in SynchStatements");
				}
			}
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack == false)
            {
                this.txtCountry.DataSource = CustomerModel.GetCountries();
                this.txtCountry.DataBind();
            }

            loadData();
            this.textboxs = new List<Control>();
            this.textboxs.Add(txtName);
            this.textboxs.Add(txtContName);
            this.textboxs.Add(txtCity);
            this.textboxs.Add(txtRegion);
            this.textboxs.Add(txtCountry);
            this.textboxs.Add(txtPhone);
        }
示例#12
0
 public AppointmentModel(Patientm patm)
 {
     appointmentmList=Appointmentms.GetAppointmentms(patm.CustomerNum,patm.PatNum);
 }
示例#13
0
			public void DeletePatientsRecords(String RegistrationKey,List<long> patNumList) {
				try {
					Logger.Information("In DeletePatientsRecords");
					customerNum=util.GetDentalOfficeID(RegistrationKey);
					if(customerNum==0) {
						return;
					}	
					for(int i=0;i<patNumList.Count;i++) {//Dennis: an inefficient loop but will work fine for the small number of records and will use existing default methods of the ms class
						/* On OD if a labpanel is deleted the corresponding labresults are also deleted. This will ensure that on the webserver labresults are deleted via 	the DeleteObjects function
						 * a similar situation would be true for  medications, allergydefs and disease defs.
						 * If however the patient password is set to blank then the corresponding deletes of labresults, medications, allergydefs and disease defs will not occur causing some unnecessary records to be present on the webserver. 
						 * Given the current level of coding it's important to leave these unnecessary records on the webserver because the moment a patient password is not blank they will be needed again.
						*/
							LabPanelms.Delete(customerNum,patNumList[i]);
							MedicationPatms.Delete(customerNum,patNumList[i]);
							Allergyms.Delete(customerNum,patNumList[i]);
							Diseasems.Delete(customerNum,patNumList[i]);
							Statementms.Delete(customerNum,patNumList[i]);
							Documentms.Delete(customerNum,patNumList[i]);
					}
				}
				catch(Exception ex) {
					Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+customerNum,ex);
					throw new Exception("Exception in DeletePatientsRecords");
				}
		}
示例#14
0
			public void SynchRecalls(String RegistrationKey,List<Recallm> recallList) {
				try {
					Logger.Information("In SynchRecalls");
					customerNum=util.GetDentalOfficeID(RegistrationKey);
					if(customerNum==0) {
						return;
					}
					Recallms.UpdateFromChangeList(recallList,customerNum);

				}
				catch(Exception ex) {
					Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+customerNum,ex);
					throw new Exception("Exception in SynchRecalls");
				}
			}	
示例#15
0
			public void SynchDocuments(String RegistrationKey,List<Documentm> documentList) {
				try {
					Logger.Information("In SynchDocuments");
					customerNum=util.GetDentalOfficeID(RegistrationKey);
					if(customerNum==0) {
						return;
					}
					Documentms.UpdateFromChangeList(documentList,customerNum);
					//now delete documents whoes DocNums are not found in the statements table
					Documentms.LimitDocumentmsPerPatient(customerNum);

				}
				catch(Exception ex) {
					Logger.LogError("IpAddress="+HttpContext.Current.Request.UserHostAddress+" DentalOfficeID="+customerNum,ex);
					throw new Exception("Exception in SynchDocuments");
				}
			}
示例#16
0
        protected void loadData()
        {
            ProductParser newParser = new ProductParser();
            this.dataModel = new ProductModel(@".\SQL2008",
                 1433, "TSQLFundamentals2008", "sa", "123456", "Production.Products", newParser);
            newParser.DataModel = this.dataModel;

            try
            {
                this.dataModel.resetModel("");
            }
            catch (Exception ex)
            {
                Session["current_error"] = ex.Message;
                Response.Redirect("serverError.aspx");
            }

            /*if (this.IsPostBack == false)
                this.loadEmpIDS();*/
            catList = new List<object>();
            suppList = new List<object>();
            catList.Add("");
            suppList.Add("");
            catList.AddRange(dataModel.getIDItemList("Production.Categories", 0, 1, " deactive=0").ToArray());
            suppList.AddRange(dataModel.getIDItemList("Production.Suppliers", 0, 1, " deactive=0").ToArray());
            if (IsPostBack == false)
            {
                this.cbCatID.DataSource = catList;
                this.cbCatID.DataBind();
                this.cbSupplierID.DataSource = suppList;
                this.cbSupplierID.DataBind();

            }

            if ((Request.Params.Get("proid") != null))
            {
                this.proID = int.Parse(Request.Params.Get("proid").Trim());
                this.newEmpMode = false;
                if (this.IsPostBack == true)
                    return;

                this.loadSuppData();

            }
        }
示例#17
0
        protected void loadData()
        {
            string currentFilter ;
            if (IsPostBack == false)
            {
                Session["ord_filter"] = "";
                currentFilter = "";
            }
            else
                currentFilter = (string)Session["ord_filter"];
            //this.scriptLb.Text = currentFilter;
            OrderParser newParser = new OrderParser();
            this._dataModel = new OrderModel (this.gvOrders, @".\SQL2008",
                 1433, "TSQLFundamentals2008","sa", "123456", "Sales.Orders", "Sales.OrderDetails", newParser);
            newParser.DataModel = this._dataModel;
            try
            {
                this._dataModel.resetControl(currentFilter);
                //if (this.IsPostBack == false)
                  //  this.loadEmpIDS();
            }
            catch(Exception ex)
            {
                Session["current_error"] = ex.Message;
                Response.Redirect("serverError.aspx");
            }
            custList = new List<object>();
            empList = new List<object>();
            shipperList = new List<object>();
            custList.Add("");
            empList.Add("");
            shipperList.Add("");
            custList.AddRange(_dataModel.getIDItemList("Sales.Customers", 0, 1, "").ToArray());
            empList.AddRange(_dataModel.getIDItemList("HR.Employees", 0, 1, " jobStatus=1").ToArray());
            shipperList.AddRange(_dataModel.getIDItemList("Sales.Shippers", 0, 1, " deactive=0").ToArray());
            if (IsPostBack == false)
            {
                this.cbCustID.DataSource = custList;
                this.cbEmpID.DataSource = empList;
                this.cbShipper.DataSource = shipperList;

                cbCustID.DataBind();
                cbEmpID.DataBind();
                cbShipper.DataBind();

            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     loadData();
     this.textboxs = new List<Control>();
     this.textboxs.Add(txtName);
     this.textboxs.Add(txtDescription);
 }
		public string GetAppCoordinates(long AptNum) {
			//List<String> appointmentmList = new List<String> { "133,46,183,94","272,84,369,172","375,557,482,622" };
			
			List<String> appointmentmList=new List<String> { "39, 289, 348, 453","6, 22, 345, 234","348, 521, 692, 689" };
			if(AptNum==6){
			return appointmentmList[0];
			}
			if(AptNum==9){
			return appointmentmList[1];
			}
			if(AptNum==20){
			return appointmentmList[2];
			}
			if(AptNum==22){
			return appointmentmList[0];
			}
			if(AptNum==24){
			return appointmentmList[0];
			}
			return appointmentmList[0];
		}
示例#20
0
        protected void loadData()
        {
            string currentFilter ;
            if (IsPostBack == false)
            {
                Session["pro_filter"] = "";
                currentFilter = "";

            }
            else
                currentFilter = (string)Session["pro_filter"];
            //this.scriptLb.Text = currentFilter;
            ProductParser newParser = new ProductParser();
            this._dataModel = new ProductModel(this.gvProducts, @".\SQL2008",
                 1433, "TSQLFundamentals2008","sa", "123456", "Production.Products", newParser);
            newParser.DataModel = this._dataModel;
            try
            {
                this._dataModel.resetControl(currentFilter);
                //if (this.IsPostBack == false)
                  //  this.loadEmpIDS();
            }
            catch(Exception ex)
            {
                Session["current_error"] = ex.Message;
                Response.Redirect("serverError.aspx");
            }

            catList = new List<object>();
            suppList = new List<object>();
            catList.Add("");
            suppList.Add("");
            catList.AddRange(_dataModel.getIDItemList("Production.Categories", 0, 1, " deactive=0").ToArray());
            suppList.AddRange(_dataModel.getIDItemList("Production.Suppliers", 0, 1, " deactive=0").ToArray());
            if (IsPostBack == false)
            {
                this.cbCatID.DataSource = catList;
                this.cbCatID.DataBind();
                this.cbSupplierID.DataSource = suppList;
                this.cbSupplierID.DataBind();

            }
        }