private void LoadData()
        {
            Invitee inv = invRepos.GetDetail(physicianID);

            if (inv != null)
            {
                this.txtFirstName.Text  = inv.FirstName;
                this.txtLastName.Text   = inv.LastName;
                this.txtClinic.Text     = inv.PrimaryWorkplace;
                this.txtAddress.Text    = inv.Address;
                this.txtCity.Text       = inv.City;
                this.txtPostalCode.Text = inv.PostalCode;
                this.txtPhone.Text      = inv.Phone;
                this.txtFax.Text        = inv.Fax;
                this.txtEmail.Text      = inv.OptInEmail;
                this.txtComments.Text   = inv.Comments;
                this.txtUnique.Text     = inv.RegistrationCode;

                //squaredThree.Checked = inv.OptInEmail;

                if (inv.Province.ID.HasValue)
                {
                    ddProvince.SelectedValue = inv.Province.ID.Value.ToString();
                }
                else
                {
                    ddProvince.SelectedValue = Constants.NOID.ToString();
                }
            }
        }
Exemple #2
0
        private void LoadData()
        {
            SponserUser user = VistaDM.Admin.Code.UserHelper.GetLoggedInUser(HttpContext.Current.Session);

            Invitee inv = invRepos.GetDetail(physicianID);

            if (inv != null)
            {
                this.txtFirstName.Text  = inv.FirstName;
                this.txtLastName.Text   = inv.LastName;
                this.txtClinic.Text     = inv.PrimaryWorkplace;
                this.txtAddress.Text    = inv.Address;
                this.txtCity.Text       = inv.City;
                this.txtPostalCode.Text = inv.PostalCode;
                this.txtPhone.Text      = inv.Phone;
                this.txtFax.Text        = inv.Fax;
                this.txtEmail.Text      = inv.OptInEmail;
                this.txtComments.Text   = inv.Comments;
                this.txtUnique.Text     = inv.RegistrationCode;

                lblFN.Text         = inv.YourFirstName;
                lblLN.Text         = inv.YourLastName;
                lblAdderEmail.Text = inv.YourEmail;

                if (inv.BITerritoryID.HasValue)
                {
                    this.txtBI.Text = inv.BITerritoryID.Value.ToString();
                }

                this.txtLilly.Text    = inv.LillyID;
                lblType.Text          = inv.PhysicianType == Enums.PhysicianType.PCP ? "PCP" : "CS";
                this.lblUserName.Text = inv.UserName;

                //squaredThree.Checked = inv.OptInEmail;

                if (inv.Province.ID.HasValue)
                {
                    ddProvince.SelectedValue = inv.Province.ID.Value.ToString();
                }
                else
                {
                    ddProvince.SelectedValue = Constants.NOID.ToString();
                }

                if (!user.IsAdmin)
                {
                    if (inv.PhysicianType == Enums.PhysicianType.PCP)
                    {
                        pnlEmail.Visible = inv.Invited;
                    }
                    else
                    {
                        pnlEmail.Visible = false;
                    }
                }
            }
        }
        //[WebMethod(EnableSession = false)]
        //public static  string ToggleInvitedCHRC(int physicianID, bool isChecked)
        //{

        //    bool errored = false;
        //    try
        //    {
        //        InviteeRepository invRepos = new InviteeRepository();
        //        invRepos.UpdateInvitedValue(physicianID, isChecked);
        //    }
        //    catch (Exception exc)
        //    {

        //        errored = true;
        //    }

        //    return errored ? "0" : "1";
        //}

        //OnCheckedChanged="chkCHRC_OnCheckedChanged"
        protected void chkCHRC_OnCheckedChanged(object sender, EventArgs e)
        {
            try
            {
                if (Request.Params["__EVENTTARGET"].ToString().ToLower() != (sender as ASPxCheckBox).UniqueID.ToLower())
                {
                    return;
                }


                // int physicianID = Int32.Parse((sender as ASPxCheckBox).Attributes["PhysicianID"].ToString());

                int physicianID = Int32.Parse(((sender as ASPxCheckBox).Parent.FindControl("dummyInv2") as Button).CommandName);

                string fn    = ((sender as ASPxCheckBox).Parent.FindControl("dummyFN") as Button).CommandName;
                string ln    = ((sender as ASPxCheckBox).Parent.FindControl("dummyLN") as Button).CommandName;
                string email = ((sender as ASPxCheckBox).Parent.FindControl("dummyEmail") as Button).CommandName;

                invRepos.Approve(physicianID);

                try
                {
                    Invitee inv = invRepos.GetDetail(physicianID);

                    string phy_fn = inv.FirstName;
                    string phy_ln = inv.LastName;

                    var mailMessage = new System.Net.Mail.MailMessage()
                    {
                        From    = new MailAddress(Constants.EMAILGENERAL),
                        Subject = "VISTA DM – New Physician Request Approved",
                        Body    = GetBody(fn, string.Empty, phy_fn, phy_ln)
                    };

                    mailMessage.To.Add(new MailAddress(email));

                    mailMessage.IsBodyHtml = true;

                    Utility.SendMail(mailMessage);
                }
                catch (Exception)
                {
                }



                if (provinceID == -1)
                {
                    LoadData(isPCP);
                }
                else
                {
                    LoadData(provinceID, isPCP);
                }
            }
            catch (Exception exc)
            {
                lblResult.Text = exc.Message;

                throw;
            }
        }