//TODO: complete the method private void PopulateFields() { var client = new EyeWebServiceClient(); var usrLoad = client.GetUserProfile(int.Parse(HttpContext.Current.Session["userId"].ToString())); txtFName.Text = usrLoad.firstName; txtLName.Text = usrLoad.lastName; txtDOB.Text = usrLoad.dob; ddlGender.SelectedValue = usrLoad.gender; ddlUserType.SelectedValue = usrLoad.userTypeId.ToString(); List <Address> addressList = usrLoad.addressList; foreach (Address add in addressList) { if (add.addressType == "Home") { txtHomeStreetName.Text = add.streetName; txtHomeCity.Text = add.city; txtHomeState.Text = add.stateName; txtHomeCountry.Text = add.country; txtHomeZip.Text = add.zipcode; txtHomePhoneNumber.Text = add.phoneNo; } else if (add.addressType == "Office") { txtOFCStreetName.Text = add.streetName; txtOFCCity.Text = add.city; txtOFCState.Text = add.stateName; txtOFCCountry.Text = add.country; txtOFCZip.Text = add.zipcode; txtOFCPhoneNumber.Text = add.phoneNo; } } }
protected void gvChildern_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) return; var strGender = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "gender")); e.Row.Cells[2].Text = strGender == "M" ? "Male" : "Female"; var client = new EyeWebServiceClient(); var lblproviderId = (Label)e.Row.Cells[0].FindControl("lblproviderId"); var usr = client.GetUserProfile(int.Parse(lblproviderId.Text)); e.Row.Cells[3].Text = usr.lastName + ", " + usr.firstName; }
private void PopulatePatientDetails(string patientId) { var client = new EyeWebServiceClient(); var child = client.GetPatientProfile(int.Parse(patientId)); txtFName.Text = child.firstName; txtLName.Text = child.lastName; txtDob.Text = DateTime.Parse(child.dob).ToShortDateString(); hdnPatientId.Value = child.patientId.ToString(); hdnParentId.Value = child.parentId.ToString(); hdnProviderId.Value = child.providerId.ToString(); txtGender.Text = child.gender == "M" ? "Male" : "Female"; var usr = client.GetUserProfile(child.providerId); txtProviderName.Text = usr.lastName + ", " + usr.firstName; }
protected void gvPatients_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) { return; } var strGender = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "gender")); e.Row.Cells[2].Text = strGender == "M" ? "Male" : "Female"; var client = new EyeWebServiceClient(); var lblproviderId = (Label)e.Row.Cells[0].FindControl("lblparentId"); var usr = client.GetUserProfile(int.Parse(lblproviderId.Text)); e.Row.Cells[3].Text = usr.lastName + ", " + usr.firstName; }
public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; string[] qryStr = request.QueryString[0].ToLower().Split('|'); HttpResponse response = context.Response; string numberOfRows = request["rows"]; string pageIndex = request["page"]; string sortColumnName = request["sidx"]; string sortOrderBy = request["sord"]; int totalRecords; string output = ""; var client = new EyeWebServiceClient(); switch (qryStr[0].ToLower()) { case "getpatients": var patients = client.ListPatientsProfile(int.Parse(HttpContext.Current.Session["userId"].ToString())); List <Dictionary <String, Object> > tableRowsPatients = new List <Dictionary <String, Object> >(); foreach (var dr in patients) { var rowPatients = new Dictionary <String, Object>(); rowPatients["patientId"] = dr.patientId; rowPatients["parentId"] = dr.parentId; rowPatients["providerId"] = dr.providerId; rowPatients["firstName"] = dr.firstName; rowPatients["lastName"] = dr.lastName; rowPatients["dob"] = dr.dob; rowPatients["gender"] = dr.gender; var parentProfile = client.GetUserProfile(dr.parentId); rowPatients["parentName"] = parentProfile.firstName + " " + parentProfile.lastName; tableRowsPatients.Add(rowPatients); } output = new JavaScriptSerializer().Serialize(tableRowsPatients); break; } response.Write(output); }
public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; string[] qryStr = request.QueryString[0].ToLower().Split('|'); HttpResponse response = context.Response; string numberOfRows = request["rows"]; string pageIndex = request["page"]; string sortColumnName = request["sidx"]; string sortOrderBy = request["sord"]; int totalRecords; string output = ""; var client = new EyeWebServiceClient(); switch (qryStr[0].ToLower()) { case "getpatients": var patients = client.ListPatientsProfile(int.Parse(HttpContext.Current.Session["userId"].ToString())); List<Dictionary<String, Object>> tableRowsPatients = new List<Dictionary<String, Object>>(); foreach (var dr in patients) { var rowPatients = new Dictionary<String, Object>(); rowPatients["patientId"] = dr.patientId; rowPatients["parentId"] = dr.parentId; rowPatients["providerId"] = dr.providerId; rowPatients["firstName"] = dr.firstName; rowPatients["lastName"] = dr.lastName; rowPatients["dob"] = dr.dob; rowPatients["gender"] = dr.gender; var parentProfile = client.GetUserProfile(dr.parentId); rowPatients["parentName"] = parentProfile.firstName + " " + parentProfile.lastName; tableRowsPatients.Add(rowPatients); } output = new JavaScriptSerializer().Serialize(tableRowsPatients); break; } response.Write(output); }
//TODO: complete the method private void PopulateFields() { var client = new EyeWebServiceClient(); var usrLoad = client.GetUserProfile(int.Parse(HttpContext.Current.Session["userId"].ToString())); txtFName.Text = usrLoad.firstName; txtLName.Text = usrLoad.lastName; txtDOB.Text = usrLoad.dob; ddlGender.SelectedValue = usrLoad.gender; ddlUserType.SelectedValue = usrLoad.userTypeId.ToString(); List<Address> addressList = usrLoad.addressList; foreach(Address add in addressList) { if (add.addressType == "Home") { txtHomeStreetName.Text = add.streetName; txtHomeCity.Text = add.city; txtHomeState.Text = add.stateName; txtHomeCountry.Text = add.country; txtHomeZip.Text = add.zipcode; txtHomePhoneNumber.Text = add.phoneNo; } else if (add.addressType == "Office") { txtOFCStreetName.Text = add.streetName; txtOFCCity.Text = add.city; txtOFCState.Text = add.stateName; txtOFCCountry.Text = add.country; txtOFCZip.Text = add.zipcode; txtOFCPhoneNumber.Text = add.phoneNo; } } }
public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; string errMsg = ""; string[] qryStr = request.QueryString[0].ToLower().Split('|'); HttpResponse response = context.Response; string _search = request["_search"]; string numberOfRows = request["rows"]; string pageIndex = request["page"]; string sortColumnName = request["sidx"]; string sortOrderBy = request["sord"]; int totalRecords; string output = ""; var client = new EyeWebServiceClient(); switch (qryStr[0].ToLower()) { case "getchildren": var patients = client.ListChildrenProfile(int.Parse(HttpContext.Current.Session["userId"].ToString())); List <Dictionary <String, Object> > tableRowsChildren = new List <Dictionary <String, Object> >(); Dictionary <String, Object> rowChildren; foreach (var dr in patients) { rowChildren = new Dictionary <String, Object>(); rowChildren["patientId"] = dr.patientId; rowChildren["parentId"] = dr.parentId; rowChildren["providerId"] = dr.providerId; rowChildren["firstName"] = dr.firstName; rowChildren["lastName"] = dr.lastName; rowChildren["dob"] = dr.dob; rowChildren["gender"] = dr.gender; var providerProfile = client.GetUserProfile(dr.providerId); rowChildren["providerName"] = providerProfile.firstName + " " + providerProfile.lastName; tableRowsChildren.Add(rowChildren); } output = new JavaScriptSerializer().Serialize(tableRowsChildren); /* * output =JsonConvert.SerializeObject(new GridProperties<Patient> * { * rows = patients, * records = Convert.ToInt32(numberOfRows), * total = (patients.Count + Convert.ToInt32(numberOfRows) - 1)/Convert.ToInt32(numberOfRows), * page = Convert.ToInt32(pageIndex) * * });*/ break; case "editchildren": XElement patientEntity = new XElement("patientEntity"); if (context.Request.RequestType.ToString().ToLower() == "post") { string[] keys = context.Request.Form.AllKeys; for (int i = 0; i < keys.Length; i++) { patientEntity.Add(new XElement(keys[i], context.Request.Form[(keys[i])].ToString())); } } if ((string)patientEntity.Element("oper") == "edit") { Patient editPatient = new Patient { patientId = (int)patientEntity.Element("patientId"), parentId = (int)patientEntity.Element("parentId"), providerId = (int)patientEntity.Element("providerNameDdl"), firstName = (string)patientEntity.Element("firstName"), lastName = (string)patientEntity.Element("lastName"), gender = (string)patientEntity.Element("genderDdl"), dob = (string)patientEntity.Element("dob") }; client.SetChildProfile(editPatient); } else { Patient newPatient = new Patient { parentId = int.Parse(HttpContext.Current.Session["userId"].ToString()), providerId = (int)patientEntity.Element("providerNameDdl"), firstName = (string)patientEntity.Element("firstName"), lastName = (string)patientEntity.Element("lastName"), gender = (string)patientEntity.Element("genderDdl"), dob = (string)patientEntity.Element("dob") }; client.SetChildProfile(newPatient); } break; case "getproviders": var provList = client.ListAllProviderProfile(); output = new JavaScriptSerializer().Serialize(provList); break; case "getgenders": var dt = new DataTable(); dt.Columns.Add(new DataColumn { ColumnName = "genderId" }); dt.Columns.Add(new DataColumn { ColumnName = "gender" }); DataRow drM = dt.NewRow(); drM["genderId"] = "M"; drM["gender"] = "Male"; dt.Rows.Add(drM); DataRow drF = dt.NewRow(); drF["genderId"] = "F"; drF["gender"] = "Female"; dt.Rows.Add(drF); DataRow drN = dt.NewRow(); drN["genderId"] = "N"; drN["gender"] = "Not specified"; dt.Rows.Add(drN); List <Dictionary <String, Object> > tableRows = new List <Dictionary <String, Object> >(); Dictionary <String, Object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary <String, Object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } tableRows.Add(row); } output = new JavaScriptSerializer().Serialize(tableRows); break; } response.Write(output); }