Пример #1
0
 private void LoadChildrenGrid()
 {
     var client = new EyeWebServiceClient();
     gvChildern.DataSource =
         client.ListChildrenProfile(int.Parse(HttpContext.Current.Session["userId"].ToString()));
     gvChildern.DataBind();
 }
Пример #2
0
        //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;
                }
            }
        }
Пример #3
0
 private void LoadPatientsGrid()
 {
     var client = new EyeWebServiceClient();
     gvPatients.DataSource =
         client.ListPatientsProfile(int.Parse(HttpContext.Current.Session["userId"].ToString()));
     gvPatients.DataBind();
 }
Пример #4
0
        protected void AddPatientProfile(object sender, EventArgs e)
        {
            SetReadOnlyMode(false);
            dvMaster.Visible              = false;
            dvDetails.Visible             = true;
            txtFName.Text                 = "";
            txtLName.Text                 = "";
            txtDob.Text                   = "";
            ddlProviderName.SelectedValue = 0.ToString();
            ddlGender.SelectedValue       = 0.ToString();
            //btnDelete.Visible = false;
            var client   = new EyeWebServiceClient();
            var provList = client.ListAllProviderProfile();

            btnUpdate.Text = "Create Profile";
            ddlProviderName.Items.Clear();
            ddlProviderName.Items.Add(new ListItem
            {
                Value = 0.ToString(),
                Text  = "Select"
            });
            foreach (var prov in provList)
            {
                ddlProviderName.Items.Add(new ListItem
                {
                    Value = prov.userId.ToString(),
                    Text  = prov.lastName + ", " + prov.firstName
                });
            }
        }
Пример #5
0
        protected void ProfileSubmitButtonClick(object sender, EventArgs e)
        {
            var client  = new EyeWebServiceClient();
            var addList = new List <Address>();

            var newUser = new user();

            if (txtHomeStreetName.Text != "")
            {
                var add = new Address
                {
                    addressType = "Home",
                    streetName  = txtHomeStreetName.Text,
                    city        = txtHomeCity.Text,
                    stateName   = txtHomeState.Text,
                    country     = txtHomeCountry.Text,
                    zipcode     = txtHomeZip.Text,
                    phoneNo     = txtHomePhoneNumber.Text
                };
                addList.Add(add);
            }

            if (txtOFCStreetName.Text != "")
            {
                var add1 = new Address
                {
                    addressType = "Office",
                    streetName  = txtOFCStreetName.Text,
                    city        = txtOFCCity.Text,
                    stateName   = txtOFCState.Text,
                    country     = txtOFCCountry.Text,
                    zipcode     = txtOFCZip.Text,
                    phoneNo     = txtOFCPhoneNumber.Text
                };
                addList.Add(add1);
            }

            if (HttpContext.Current.Session["userId"] != null)
            {
                newUser.userId = int.Parse(HttpContext.Current.Session["userId"].ToString());
            }
            newUser.firstName   = txtFName.Text;
            newUser.lastName    = txtLName.Text;
            newUser.dob         = txtDOB.Text;
            newUser.gender      = ddlGender.SelectedValue;
            newUser.userTypeId  = int.Parse(ddlUserType.SelectedValue);
            newUser.loginId     = HttpContext.Current.Session["loginId"].ToString();
            newUser.addressList = addList;

            var success = client.SetProfile(newUser);

            if (success)
            {
                HttpContext.Current.Session["userId"]     = client.GetUserId(newUser.loginId);
                HttpContext.Current.Session["userTypeId"] = newUser.userTypeId;
                IdentityHelper.RedirectToReturnUrl(
                    newUser.userTypeId == 1 ? "~/ProviderHomePage.aspx" : "~/ParentHomePage.aspx", Response);
            }
        }
Пример #6
0
        private void LoadPatientsGrid()
        {
            var client = new EyeWebServiceClient();

            gvPatients.DataSource =
                client.ListPatientsProfile(int.Parse(HttpContext.Current.Session["userId"].ToString()));
            gvPatients.DataBind();
        }
Пример #7
0
        private void LoadChildrenGrid()
        {
            var client = new EyeWebServiceClient();

            gvChildern.DataSource =
                client.ListChildrenProfile(int.Parse(HttpContext.Current.Session["userId"].ToString()));
            gvChildern.DataBind();
        }
Пример #8
0
        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;

        }
Пример #9
0
 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;
 }
Пример #10
0
        protected void LogIn(object sender, EventArgs e)
        {
            if (IsValid)
            {
                // Validate the user password
                var manager       = Context.GetOwinContext().GetUserManager <ApplicationUserManager>();
                var signinManager = Context.GetOwinContext().GetUserManager <ApplicationSignInManager>();

                // This doen't count login failures towards account lockout
                // To enable password failures to trigger lockout, change to shouldLockout: true
                var result = signinManager.PasswordSignIn(Email.Text, Password.Text, RememberMe.Checked, false);

                switch (result)
                {
                case SignInStatus.Success:
                    var client = new EyeWebServiceClient();
                    HttpContext.Current.Session["loginId"]    = signinManager.UserManager.FindByEmail(Email.Text).Id;
                    HttpContext.Current.Session["userId"]     = client.GetUserId(HttpContext.Current.Session["loginId"].ToString());
                    HttpContext.Current.Session["userTypeId"] = client.GetUserTypeId(int.Parse(HttpContext.Current.Session["userId"].ToString()));

                    if (int.Parse(HttpContext.Current.Session["userTypeId"].ToString()) == 1)
                    {
                        IdentityHelper.RedirectToReturnUrl("~/ProviderHomePage.aspx", Response);
                    }
                    else
                    {
                        IdentityHelper.RedirectToReturnUrl("~/ParentHomePage.aspx", Response);
                    }

                    break;

                case SignInStatus.LockedOut:
                    Response.Redirect("/Account/Lockout");
                    break;

                case SignInStatus.RequiresVerification:
                    Response.Redirect(String.Format("/Account/TwoFactorAuthenticationSignIn?ReturnUrl={0}&RememberMe={1}",
                                                    Request.QueryString["ReturnUrl"],
                                                    RememberMe.Checked),
                                      true);
                    break;

                case SignInStatus.Failure:
                default:
                    FailureText.Text     = "Invalid login attempt";
                    ErrorMessage.Visible = true;
                    break;
                }
            }
        }
Пример #11
0
        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;
        }
Пример #12
0
        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;
        }
Пример #13
0
 protected void UpdateChildProfile(object sender, EventArgs e)
 {
     if (btnUpdate.Text.Contains("Edit"))
     {
         btnUpdate.Text = "Update Profile";
         SetReadOnlyMode(false);
         var client = new EyeWebServiceClient();
         var provList = client.ListAllProviderProfile();
         ddlProviderName.Items.Clear();
         ddlProviderName.Items.Add(new ListItem
         {
             Value = 0.ToString(),
             Text = "Select"
         });
         foreach (var prov in provList)
         {
             ddlProviderName.Items.Add(new ListItem
             {
                 Value = prov.userId.ToString(),
                 Text = prov.lastName + ", " + prov.firstName
             });
         }
     }
     else if (btnUpdate.Text.Contains("Update"))
     {
         SetReadOnlyMode(true);
         btnUpdate.Text = "Edit Profile";
         var patient = new Patient
         {
             firstName = txtFName.Text,
             lastName = txtLName.Text,
             patientId = int.Parse(hdnPatientId.Value),
             parentId = int.Parse(hdnParentId.Value),
             dob = txtDob.Text,
             gender = ddlGender.SelectedValue,
             providerId = int.Parse(ddlProviderName.SelectedValue)
         };
         var client = new EyeWebServiceClient();
         var ss = client.SetChildProfile(patient);
         PopulatePatientDetails(patient.patientId.ToString());
     }
     else
     {
         CreateChildProfile();
     }
 }
Пример #14
0
 protected void UpdateChildProfile(object sender, EventArgs e)
 {
     if (btnUpdate.Text.Contains("Edit"))
     {
         btnUpdate.Text = "Update Profile";
         SetReadOnlyMode(false);
         var client   = new EyeWebServiceClient();
         var provList = client.ListAllProviderProfile();
         ddlProviderName.Items.Clear();
         ddlProviderName.Items.Add(new ListItem
         {
             Value = 0.ToString(),
             Text  = "Select"
         });
         foreach (var prov in provList)
         {
             ddlProviderName.Items.Add(new ListItem
             {
                 Value = prov.userId.ToString(),
                 Text  = prov.lastName + ", " + prov.firstName
             });
         }
     }
     else if (btnUpdate.Text.Contains("Update"))
     {
         SetReadOnlyMode(true);
         btnUpdate.Text = "Edit Profile";
         var patient = new Patient
         {
             firstName  = txtFName.Text,
             lastName   = txtLName.Text,
             patientId  = int.Parse(hdnPatientId.Value),
             parentId   = int.Parse(hdnParentId.Value),
             dob        = txtDob.Text,
             gender     = ddlGender.SelectedValue,
             providerId = int.Parse(ddlProviderName.SelectedValue)
         };
         var client = new EyeWebServiceClient();
         var ss     = client.SetChildProfile(patient);
         PopulatePatientDetails(patient.patientId.ToString());
     }
     else
     {
         CreateChildProfile();
     }
 }
Пример #15
0
        protected void LogIn(object sender, EventArgs e)
        {
            if (IsValid)
            {
                // Validate the user password
                var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
                var signinManager = Context.GetOwinContext().GetUserManager<ApplicationSignInManager>();

                // This doen't count login failures towards account lockout
                // To enable password failures to trigger lockout, change to shouldLockout: true
                var result = signinManager.PasswordSignIn(Email.Text, Password.Text, RememberMe.Checked, false);

                switch (result)
                {
                        
                    case SignInStatus.Success:
                        var client = new EyeWebServiceClient();
                        HttpContext.Current.Session["loginId"] = signinManager.UserManager.FindByEmail(Email.Text).Id;
                        HttpContext.Current.Session["userId"] = client.GetUserId(HttpContext.Current.Session["loginId"].ToString());
                        HttpContext.Current.Session["userTypeId"] = client.GetUserTypeId(int.Parse(HttpContext.Current.Session["userId"].ToString()));

                        if (int.Parse(HttpContext.Current.Session["userTypeId"].ToString()) == 1)
                            IdentityHelper.RedirectToReturnUrl("~/ProviderHomePage.aspx", Response);
                        else
                            IdentityHelper.RedirectToReturnUrl("~/ParentHomePage.aspx", Response);

                        break;
                    case SignInStatus.LockedOut:
                        Response.Redirect("/Account/Lockout");
                        break;
                    case SignInStatus.RequiresVerification:
                        Response.Redirect(String.Format("/Account/TwoFactorAuthenticationSignIn?ReturnUrl={0}&RememberMe={1}", 
                                                        Request.QueryString["ReturnUrl"],
                                                        RememberMe.Checked),
                                          true);
                        break;
                    case SignInStatus.Failure:
                    default:
                        FailureText.Text = "Invalid login attempt";
                        ErrorMessage.Visible = true;
                        break;
                }
            }
        }
Пример #16
0
        protected void CreateChildProfile()
        {
            var patient = new Patient
            {
                firstName  = txtFName.Text,
                lastName   = txtLName.Text,
                patientId  = 0,
                parentId   = int.Parse(HttpContext.Current.Session["userId"].ToString()),
                dob        = txtDob.Text,
                gender     = ddlGender.SelectedValue,
                providerId = int.Parse(ddlProviderName.SelectedValue)
            };
            var client       = new EyeWebServiceClient();
            var childProfile = client.SetChildProfile(patient);

            //PopulatePatientDetails(childProfile.patientId.ToString());
            LoadChildrenGrid();
            dvDetails.Visible = false;
            dvMaster.Visible  = true;
        }
Пример #17
0
        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);
        }
Пример #18
0
        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);
        }
Пример #19
0
        //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;

                }
            }

        }
Пример #20
0
        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);
        }
Пример #21
0
        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 "gettherapy":

                PatientGames patientGame =
                    client.ListGameAssignment(int.Parse(qryStr[1]));
                List <Dictionary <String, Object> > tableRowsPatientGames = new List <Dictionary <String, Object> >();
                foreach (var dr in patientGame.gameAssignments)
                {
                    var rowPatientGames = new Dictionary <String, Object>();

                    rowPatientGames["patientId"]          = patientGame.patientId;
                    rowPatientGames["gameId"]             = dr.game.gameId;
                    rowPatientGames["gameName"]           = dr.game.gameName;
                    rowPatientGames["gameDescription"]    = dr.game.gameDescription;
                    rowPatientGames["therapyId"]          = dr.game.therapy.therapyId;
                    rowPatientGames["therapyName"]        = dr.game.therapy.therapyName;
                    rowPatientGames["therapyDescription"] = dr.game.therapy.therapyDescription;
                    rowPatientGames["level"]     = dr.level;
                    rowPatientGames["endDate"]   = dr.endDate;
                    rowPatientGames["startDate"] = dr.startDate;
                    tableRowsPatientGames.Add(rowPatientGames);
                }
                output = new JavaScriptSerializer().Serialize(tableRowsPatientGames);

                break;

            case "listtherapies":
                List <Therapy> therapies = client.ListAllTherapy();
                List <Dictionary <String, Object> > tableRowsTherapiesList = new List <Dictionary <String, Object> >();
                var defaultTherapy = new Dictionary <String, Object>();
                defaultTherapy["therapyId"]   = "0";
                defaultTherapy["therapyName"] = "Select";
                tableRowsTherapiesList.Add(defaultTherapy);
                foreach (var dr in therapies)
                {
                    var rowTherapy = new Dictionary <String, Object>();
                    rowTherapy["therapyId"]   = dr.therapyId;
                    rowTherapy["therapyName"] = dr.therapyName;
                    tableRowsTherapiesList.Add(rowTherapy);
                }
                output = new JavaScriptSerializer().Serialize(tableRowsTherapiesList);

                break;

            case "listgamesfortherapy":
                List <Dictionary <String, Object> > tableRowsGamesList = new List <Dictionary <String, Object> >();
                if (int.Parse(qryStr[1]) == 0)
                {
                    var rowGame = new Dictionary <String, Object>();
                    rowGame["gameId"]   = "0";
                    rowGame["gameName"] = "Select";
                    tableRowsGamesList.Add(rowGame);
                }
                else
                {
                    List <Game> games = client.ListAllGamesForTherapy(int.Parse(qryStr[1]));
                    foreach (var dr in games)
                    {
                        var rowGame = new Dictionary <String, Object>();
                        rowGame["gameId"]   = dr.gameId;
                        rowGame["gameName"] = dr.gameName;
                        tableRowsGamesList.Add(rowGame);
                    }
                }
                output = new JavaScriptSerializer().Serialize(tableRowsGamesList);
                break;

            case "assigngame":
                XElement gameAssignmentEntity = new XElement("gameAssignmentEntity");
                if (context.Request.RequestType.ToString().ToLower() == "post")
                {
                    string[] keys = context.Request.Form.AllKeys;
                    for (int i = 0; i < keys.Length; i++)
                    {
                        gameAssignmentEntity.Add(new XElement(keys[i], context.Request.Form[(keys[i])].ToString()));
                    }
                }
                PatientGames patientGames = new PatientGames
                {
                    patientId       = (int)gameAssignmentEntity.Element("patientId"),
                    gameAssignments = new List <GameAssignment>()
                };
                if ((string)gameAssignmentEntity.Element("oper") == "del")
                {
                    GameAssignment gameAssignment = new GameAssignment
                    {
                        level     = (int)gameAssignmentEntity.Element("level"),
                        startDate = (string)gameAssignmentEntity.Element("startDate"),
                        endDate   = (string)gameAssignmentEntity.Element("endDate"),
                        game      = new Game
                        {
                            gameId = (int)gameAssignmentEntity.Element("gameId")
                        }
                    };
                    patientGames.gameAssignments.Add(gameAssignment);
                    output = client.DeleteGameAssignment(patientGames).ToString();
                }
                else
                {
                    GameAssignment gameAssignment = new GameAssignment
                    {
                        level     = (int)gameAssignmentEntity.Element("level"),
                        startDate = (string)gameAssignmentEntity.Element("startDate"),
                        endDate   = (string)gameAssignmentEntity.Element("endDate"),
                        game      = new Game
                        {
                            gameId = (int)gameAssignmentEntity.Element("gamesDdl")
                        }
                    };
                    patientGames.gameAssignments.Add(gameAssignment);
                    output = client.SetGameAssignment(patientGames).ToString();
                }
                break;

            case "getgamescore":
                PatientGameScore patientGameScore = new PatientGameScore
                {
                    patientId = int.Parse(qryStr[1]),
                    level     = int.Parse(qryStr[3]),
                    game      = new Game
                    {
                        gameId = int.Parse(qryStr[2])
                    }
                };
                PatientGameScore resPatGameScore = client.ListGameScoresForPatient(patientGameScore);
                List <Dictionary <String, Object> > tableRowGameScores = new List <Dictionary <String, Object> >();
                foreach (var dr in resPatGameScore.gameScoreList)
                {
                    var rowGameScore = new Dictionary <String, Object>();
                    rowGameScore["gameName"]      = resPatGameScore.game.gameName;
                    rowGameScore["level"]         = resPatGameScore.level;
                    rowGameScore["datePlayed"]    = dr.datePlayed;
                    rowGameScore["durationInMin"] = dr.durationInMin.TotalMinutes.ToString();
                    rowGameScore["score"]         = dr.score;
                    tableRowGameScores.Add(rowGameScore);
                }
                output = new JavaScriptSerializer().Serialize(tableRowGameScores);
                break;
            }
            response.Write(output);
        }
Пример #22
0
        protected void ProfileSubmitButtonClick(object sender, EventArgs e)
        {
            var client = new EyeWebServiceClient();
            var addList = new List<Address>();
          
            var newUser = new user();

            if (txtHomeStreetName.Text!="")
            {
                var add = new Address
                {
                    addressType = "Home",
                    streetName = txtHomeStreetName.Text,
                    city = txtHomeCity.Text,
                    stateName = txtHomeState.Text,
                    country = txtHomeCountry.Text,
                    zipcode = txtHomeZip.Text,
                    phoneNo = txtHomePhoneNumber.Text
                };
                addList.Add(add);
            }

            if (txtOFCStreetName.Text != "")
            {
                var add1 = new Address
                {
                    addressType ="Office",
                    streetName = txtOFCStreetName.Text,
                    city = txtOFCCity.Text,
                    stateName = txtOFCState.Text,
                    country = txtOFCCountry.Text,
                    zipcode = txtOFCZip.Text,
                    phoneNo = txtOFCPhoneNumber.Text
                };
                addList.Add(add1);
            }
            if (HttpContext.Current.Session["userId"] != null)
                newUser.userId = int.Parse(HttpContext.Current.Session["userId"].ToString());

            newUser.firstName = txtFName.Text;
            newUser.lastName = txtLName.Text;
            newUser.dob = txtDOB.Text;
            newUser.gender = ddlGender.SelectedValue;
            newUser.userTypeId = int.Parse(ddlUserType.SelectedValue);
            newUser.loginId = HttpContext.Current.Session["loginId"].ToString();
            newUser.addressList = addList;

            var success = client.SetProfile(newUser);

            if (success)
            {
                HttpContext.Current.Session["userId"] = client.GetUserId(newUser.loginId);
                HttpContext.Current.Session["userTypeId"] = newUser.userTypeId;

               // IdentityHelper.RedirectToReturnUrl(
                  //  newUser.userTypeId == 1 ? "~/ProviderHomePage.aspx" : "~/ParentHomePage.aspx", Response);
                PopulateFields();
                SetVisibility(false);
            }
        }
Пример #23
0
 protected void CreateChildProfile()
 {
     var patient = new Patient
     {
         firstName = txtFName.Text,
         lastName = txtLName.Text,
         patientId = 0,
         parentId = int.Parse(HttpContext.Current.Session["userId"].ToString()),
         dob = txtDob.Text,
         gender = ddlGender.SelectedValue,
         providerId = int.Parse(ddlProviderName.SelectedValue)
     };
     var client = new EyeWebServiceClient();
     var childProfile = client.SetChildProfile(patient);
     //PopulatePatientDetails(childProfile.patientId.ToString());
     LoadChildrenGrid();
     dvDetails.Visible = false;
     dvMaster.Visible = true;
 }
Пример #24
0
 protected void AddPatientProfile(object sender, EventArgs e)
 {
     SetReadOnlyMode(false);
     dvMaster.Visible = false;
     dvDetails.Visible = true;
     txtFName.Text = "";
     txtLName.Text = "";
     txtDob.Text = "";
     ddlProviderName.SelectedValue = 0.ToString();
     ddlGender.SelectedValue = 0.ToString();
     //btnDelete.Visible = false;
     var client = new EyeWebServiceClient();
     var provList = client.ListAllProviderProfile();
     btnUpdate.Text = "Create Profile";
     ddlProviderName.Items.Clear();
     ddlProviderName.Items.Add(new ListItem
     {
         Value = 0.ToString(),
         Text = "Select"
     });
     foreach (var prov in provList)
     {
         ddlProviderName.Items.Add(new ListItem
         {
             Value = prov.userId.ToString(),
             Text = prov.lastName + ", " + prov.firstName
         });
     }
 }
Пример #25
0
        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 "gettherapy":

                     PatientGames patientGame=
                client.ListGameAssignment(int.Parse(qryStr[1]));
            List<Dictionary<String, Object>> tableRowsPatientGames = new List<Dictionary<String, Object>>();
                    foreach (var dr in patientGame.gameAssignments)
                    {
                        var rowPatientGames = new Dictionary<String, Object>();

                        rowPatientGames["patientId"] = patientGame.patientId;
                        rowPatientGames["gameId"] = dr.game.gameId;
                        rowPatientGames["gameName"] = dr.game.gameName;
                        rowPatientGames["gameDescription"] = dr.game.gameDescription;
                        rowPatientGames["therapyId"] = dr.game.therapy.therapyId;
                        rowPatientGames["therapyName"] = dr.game.therapy.therapyName;
                        rowPatientGames["therapyDescription"] = dr.game.therapy.therapyDescription;
                        rowPatientGames["level"] = dr.level;
                        rowPatientGames["endDate"] = dr.endDate;
                        rowPatientGames["startDate"] = dr.startDate;
                        tableRowsPatientGames.Add(rowPatientGames);
                    }
                    output = new JavaScriptSerializer().Serialize(tableRowsPatientGames);

                    break;

                case "listtherapies":
                    List<Therapy> therapies = client.ListAllTherapy();
                    List<Dictionary<String, Object>> tableRowsTherapiesList = new List<Dictionary<String, Object>>();
                    var defaultTherapy = new Dictionary<String, Object>();
                    defaultTherapy["therapyId"] = "0";
                    defaultTherapy["therapyName"] = "Select";
                        tableRowsTherapiesList.Add(defaultTherapy);
                    foreach (var dr in therapies)
                    {
                        var rowTherapy = new Dictionary<String, Object>();
                        rowTherapy["therapyId"] = dr.therapyId;
                        rowTherapy["therapyName"] = dr.therapyName;
                        tableRowsTherapiesList.Add(rowTherapy);
                    }
                    output = new JavaScriptSerializer().Serialize(tableRowsTherapiesList);

                    break;
                case "listgamesfortherapy":
                    List<Dictionary<String, Object>> tableRowsGamesList = new List<Dictionary<String, Object>>();
                    if (int.Parse(qryStr[1]) == 0)
                    {
                        var rowGame = new Dictionary<String, Object>();
                        rowGame["gameId"] = "0";
                        rowGame["gameName"] = "Select";
                        tableRowsGamesList.Add(rowGame);
                    }
                    else
                    {
                        List<Game> games = client.ListAllGamesForTherapy(int.Parse(qryStr[1]));
                        foreach (var dr in games)
                        {
                            var rowGame = new Dictionary<String, Object>();
                            rowGame["gameId"] = dr.gameId;
                            rowGame["gameName"] = dr.gameName;
                            tableRowsGamesList.Add(rowGame);
                        }
                    }
                    output = new JavaScriptSerializer().Serialize(tableRowsGamesList);
                    break;

                case "assigngame":
                    XElement gameAssignmentEntity = new XElement("gameAssignmentEntity");
                            if (context.Request.RequestType.ToString().ToLower() == "post")
                            {
                                string[] keys = context.Request.Form.AllKeys;
                                for (int i = 0; i < keys.Length; i++)
                                {
                                    gameAssignmentEntity.Add(new XElement(keys[i],context.Request.Form[(keys[i])].ToString()));
                                }
                            }
                    PatientGames patientGames = new PatientGames
                    {
                        patientId = (int)gameAssignmentEntity.Element("patientId"),
                        gameAssignments = new List<GameAssignment>()
                    };
                    if ((string) gameAssignmentEntity.Element("oper") == "del")
                    {
                        GameAssignment gameAssignment = new GameAssignment
                        {

                            level = (int)gameAssignmentEntity.Element("level"),
                            startDate = (string)gameAssignmentEntity.Element("startDate"),
                            endDate = (string)gameAssignmentEntity.Element("endDate"),
                            game = new Game
                            {
                                gameId = (int)gameAssignmentEntity.Element("gameId")
                            }
                        };
                        patientGames.gameAssignments.Add(gameAssignment);
                        output = client.DeleteGameAssignment(patientGames).ToString();
                    }
                    else
                    {
                        GameAssignment gameAssignment = new GameAssignment
                        {

                            level = (int) gameAssignmentEntity.Element("level"),
                            startDate = (string) gameAssignmentEntity.Element("startDate"),
                            endDate = (string) gameAssignmentEntity.Element("endDate"),
                            game = new Game
                            {
                                gameId = (int) gameAssignmentEntity.Element("gamesDdl")
                            }
                        };
                        patientGames.gameAssignments.Add(gameAssignment);
                        output = client.SetGameAssignment(patientGames).ToString();
                    }
                    break;
                case "getgamescore":
                    PatientGameScore patientGameScore = new PatientGameScore
                    {
                        patientId = int.Parse(qryStr[1]),
                        level = int.Parse(qryStr[3]),
                        game = new Game
                        {
                            gameId = int.Parse(qryStr[2])
                        }
                    };
                    PatientGameScore resPatGameScore = client.ListGameScoresForPatient(patientGameScore);
                    List<Dictionary<String, Object>> tableRowGameScores = new List<Dictionary<String, Object>>();
                     foreach (var dr in resPatGameScore.gameScoreList)
                    {
                        var rowGameScore = new Dictionary<String, Object>();
                        rowGameScore["gameName"] = resPatGameScore.game.gameName;
                        rowGameScore["level"] = resPatGameScore.level;
                        rowGameScore["datePlayed"] = dr.datePlayed;
                        rowGameScore["durationInMin"] = dr.durationInMin.TotalMinutes.ToString();
                        rowGameScore["score"] = dr.score;
                        tableRowGameScores.Add(rowGameScore);
                    }
                    output = new JavaScriptSerializer().Serialize(tableRowGameScores);
                    break;

            }
            response.Write(output);
        }