Example #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO = new DTO.SecureMedicalRecordDTO();
            Random rnd = new Random();

            objSecureMedicalRecordDTO.HospitalId      = int.Parse(Session["UserId"].ToString());
            objSecureMedicalRecordDTO.DoctorId        = DoctorId;
            objSecureMedicalRecordDTO.DurationTimings = txtDoctorTimings.Text;
            int res = objSecureMedicalRecordBLL.DoctorTimings(objSecureMedicalRecordDTO);

            if (res == 1)
            {
                txtDoctorTimings.Text = "";
                lblMsg.Text           = "Doctor Created Successfully & Doctor Id:" + DoctorId + " & Password:"******"Password"].ToString();
                lblMsg.ForeColor      = System.Drawing.Color.Green;
            }
            else if (res == 2)
            {
                txtDoctorTimings.Text = "";
                lblMsg.Text           = "Doctor Timings Created Already";
                lblMsg.ForeColor      = System.Drawing.Color.Red;
            }
            else
            {
                txtDoctorTimings.Text = "";
                lblMsg.Text           = "Doctor Timings Creation Error";
                lblMsg.ForeColor      = System.Drawing.Color.Red;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL            = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO            = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.RecordName = txtRecordName.Text;
            objSecureMedicalRecordDTO.DeptId     = int.Parse(ddlDept.SelectedItem.Value);
            objSecureMedicalRecordDTO.RecordData = txtRecordData.Text;
            objSecureMedicalRecordDTO.AccessType = ddlAccessType.SelectedItem.Text;
            int res = objSecureMedicalRecordBLL.UploadMedicalRecord(objSecureMedicalRecordDTO);

            if (res == 1)
            {
                ddlDept.SelectedIndex       = 0;
                ddlAccessType.SelectedIndex = 0;
                txtRecordName.Text          = txtRecordData.Text = "";
                lblMsg.Text      = "Medical Upload Created Successfully";
                lblMsg.ForeColor = System.Drawing.Color.Green;
            }
            else if (res == 2)
            {
                ddlDept.SelectedIndex       = 0;
                ddlAccessType.SelectedIndex = 0;
                txtRecordName.Text          = txtRecordData.Text = "";
                lblMsg.Text      = "Medical Record Name Created Already";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                ddlDept.SelectedIndex       = 0;
                ddlAccessType.SelectedIndex = 0;
                txtRecordName.Text          = txtRecordData.Text = "";
                lblMsg.Text      = "Medical Upload Creation Error";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL           = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO           = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.PatientId = int.Parse(txtPatientId.Text);
            DataTable tab = new DataTable();

            tab = objSecureMedicalRecordBLL.GetPatient_MD(objSecureMedicalRecordDTO);
            if (tab.Rows.Count > 0)
            {
                txtPatientFirstName.Text = tab.Rows[0]["Name"].ToString();
                txtGender.Text           = tab.Rows[0]["Gender"].ToString();
                txtAge.Text      = tab.Rows[0]["Age"].ToString();
                txtReason.Text   = tab.Rows[0]["Reason"].ToString();
                txtAddress.Text  = tab.Rows[0]["Address"].ToString();
                txtMobileNo.Text = tab.Rows[0]["MobileNo"].ToString();
            }
            DataTable tab_PH = new DataTable();

            tab_PH = objSecureMedicalRecordBLL.GetPatient_PHD(objSecureMedicalRecordDTO);
            if (tab_PH.Rows.Count > 0)
            {
                string         dk     = tab_PH.Rows[0]["DataKey"].ToString();
                GetDecryptData obj    = new GetDecryptData();
                string         result = obj.GetData(dk);
                string         data   = AESCryptoClass.Decrypt(tab_PH.Rows[0]["PastData"].ToString(), result.ToString());
                txtMedicalHistory.Text   = data.Split('-')[0];
                txtPatientAllergies.Text = data.Split('-')[1];
                txtSocialHistory.Text    = data.Split('-')[2];

                LoadData();
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL              = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO              = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.PatientId    = int.Parse(txtPatientId.Text);
            objSecureMedicalRecordDTO.DoctorId     = int.Parse(Session["UserId"].ToString());
            objSecureMedicalRecordDTO.ProblemTitle = txtProblem.Text;
            Shamir obj           = new Shamir();
            Random rnd           = new Random();
            int    key           = rnd.Next(1000, 9999);
            string attributedata = obj.AttributeValue(key);

            attributedata = attributedata.Remove(0, 1);
            objSecureMedicalRecordDTO.PastData = AESCryptoClass.EncryptData(txtDesp.Text, key.ToString());

            objSecureMedicalRecordDTO.DataKey = attributedata;
            string res = objSecureMedicalRecordBLL.PatientTreatment(objSecureMedicalRecordDTO);

            if (res == "1")
            {
                txtPatientId.Text = txtDesp.Text = txtProblem.Text = "";
                lblMsg.ForeColor  = System.Drawing.Color.Green;
                lblMsg.Text       = "Patient Treatment Uploaded Successfully";
            }
            else
            {
                lblMsg.ForeColor = System.Drawing.Color.Red;
                lblMsg.Text      = "Patient Treatment Upload Error";
            }
        }
Example #5
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtOldPassword.Text == Session["UPassword"].ToString())
     {
         objSecureMedicalRecordBLL          = new BLL.SecureMedicalRecordBLL();
         objSecureMedicalRecordDTO          = new DTO.SecureMedicalRecordDTO();
         objSecureMedicalRecordDTO.UserId   = int.Parse(Session["UserId"].ToString());
         objSecureMedicalRecordDTO.Password = txtNewPassword.Text;
         objSecureMedicalRecordDTO.UserType = Session["UserType"].ToString();
         string Result = objSecureMedicalRecordBLL.ChangePassword(objSecureMedicalRecordDTO);
         if (Result != "0")
         {
             Session["UPassword"] = txtNewPassword.Text;
             txtNewPassword.Text  = txtConfirmPassword.Text = txtOldPassword.Text = "";
             lblMsg.ForeColor     = System.Drawing.Color.Green;
             lblMsg.Text          = "Password Reset Successfully";
         }
         else
         {
             lblMsg.ForeColor = System.Drawing.Color.Red;
             lblMsg.Text      = "Password Reset Error";
         }
     }
     else
     {
         lblMsg.ForeColor = System.Drawing.Color.Red;
         lblMsg.Text      = "Invalid Old Password";
     }
 }
Example #6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO = new DTO.SecureMedicalRecordDTO();
            Random rnd = new Random();

            objSecureMedicalRecordDTO.DoctorId   = rnd.Next(100000, 999999);
            objSecureMedicalRecordDTO.DeptId     = int.Parse(ddlDept.SelectedItem.Value);
            objSecureMedicalRecordDTO.Password   = rnd.Next(1000, 9999).ToString();
            objSecureMedicalRecordDTO.DoctorName = txtDoctorName.Text;
            objSecureMedicalRecordDTO.EmailId    = txtEmailId.Text;
            objSecureMedicalRecordDTO.MobileNo   = txtMobileNo.Text;
            objSecureMedicalRecordDTO.Address    = txtAddress.Text;
            int res = objSecureMedicalRecordBLL.AddDoctor(objSecureMedicalRecordDTO);

            Session["Password"] = objSecureMedicalRecordDTO.Password;
            if (res == 1)
            {
                ddlDept.SelectedIndex = 0;
                txtDoctorName.Text    = txtEmailId.Text = txtMobileNo.Text = txtAddress.Text = "";
                Response.Redirect("DoctorTimings.aspx?DoctorId=" + objSecureMedicalRecordDTO.DoctorId);
                //lblMsg.Text = "Doctor Created Successfully & Doctor Id:" + objSecureMedicalRecordDTO.DoctorId + " & Password:"******"";
                lblMsg.Text           = "Doctor Creation Error";
                lblMsg.ForeColor      = System.Drawing.Color.Red;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL             = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO             = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.DeptName    = txtDepartmentName.Text;
            objSecureMedicalRecordDTO.Description = txtDescp.Text;
            int res = objSecureMedicalRecordBLL.CreateDept(objSecureMedicalRecordDTO);

            if (res == 1)
            {
                txtDepartmentName.Text = txtDescp.Text = "";
                lblMsg.Text            = "Department Created Successfully";
                lblMsg.ForeColor       = System.Drawing.Color.Green;
            }
            else if (res == 2)
            {
                txtDepartmentName.Text = txtDescp.Text = "";
                lblMsg.Text            = "Department Created Already";
                lblMsg.ForeColor       = System.Drawing.Color.Red;
            }
            else
            {
                txtDepartmentName.Text = txtDescp.Text = "";
                lblMsg.Text            = "Department Creation Error";
                lblMsg.ForeColor       = System.Drawing.Color.Red;
            }
        }
Example #8
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO = new DTO.SecureMedicalRecordDTO();
            Random rnd = new Random();

            objSecureMedicalRecordDTO.HospitalId    = rnd.Next(100000, 999999);
            objSecureMedicalRecordDTO.Password      = rnd.Next(1000, 9999).ToString();
            objSecureMedicalRecordDTO.HospitalName  = txtHospitalName.Text;
            objSecureMedicalRecordDTO.ContactPerson = txtContactPerson.Text;
            objSecureMedicalRecordDTO.ContactNo     = txtMobileNo.Text;
            objSecureMedicalRecordDTO.Address       = txtAddress.Text;
            int res = objSecureMedicalRecordBLL.AddHospital(objSecureMedicalRecordDTO);

            if (res == 1)
            {
                txtHospitalName.Text = txtContactPerson.Text = txtMobileNo.Text = txtAddress.Text = "";
                lblMsg.Text          = "Hospital Created Successfully & Hopsital Id:" + objSecureMedicalRecordDTO.HospitalId + " & Password:"******"";
                lblMsg.Text          = "Hospital Created Already";
                lblMsg.ForeColor     = System.Drawing.Color.Red;
            }
            else
            {
                txtHospitalName.Text = txtContactPerson.Text = txtMobileNo.Text = txtAddress.Text = "";
                lblMsg.Text          = "Hospital Creation Error";
                lblMsg.ForeColor     = System.Drawing.Color.Red;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO = new DTO.SecureMedicalRecordDTO();
            Random rnd = new Random();

            objSecureMedicalRecordDTO.PatientId   = rnd.Next(10000, 99999);
            objSecureMedicalRecordDTO.PatientName = txtPatientName.Text;
            objSecureMedicalRecordDTO.Password    = rnd.Next(1000, 9999).ToString();
            objSecureMedicalRecordDTO.Gender      = ddlGender.SelectedItem.Text;
            objSecureMedicalRecordDTO.Age         = txtAge.Text;
            objSecureMedicalRecordDTO.Reason      = txtReason.Text;
            objSecureMedicalRecordDTO.MobileNo    = txtMobileNo.Text;
            objSecureMedicalRecordDTO.Address     = txtAddress.Text;
            string res = objSecureMedicalRecordBLL.CreatePatient(objSecureMedicalRecordDTO);

            if (res == "1")
            {
                ddlGender.SelectedIndex = 0;
                txtPatientName.Text     = txtMobileNo.Text = txtAge.Text = txtAddress.Text = txtMobileNo.Text = txtReason.Text = "";
                Session["Password"]     = objSecureMedicalRecordDTO.Password;
                Response.Redirect("AddPatientClinical.aspx?PatientId=" + objSecureMedicalRecordDTO.PatientId);
            }
            else
            {
                lblMsg.ForeColor = System.Drawing.Color.Red;
                lblMsg.Text      = "Patient Creation Error";
            }
        }
Example #10
0
 private void LoadRatings()
 {
     try
     {
         objSecureMedicalRecordBLL        = new BLL.SecureMedicalRecordBLL();
         objSecureMedicalRecordDTO        = new DTO.SecureMedicalRecordDTO();
         objSecureMedicalRecordDTO.DeptId = int.Parse(ddlDept.SelectedItem.Value);
         DataTable tab = new DataTable();
         tab = objSecureMedicalRecordBLL.GetDoctorRating_DId(objSecureMedicalRecordDTO);
         if (tab.Rows.Count > 0)
         {
             lblMsg.Text          = "";
             GridView1.DataSource = tab;
             GridView1.DataBind();
         }
         else
         {
             GridView1.Controls.Clear();
             lblMsg.Text = "no records found...";
         }
     }
     catch
     {
     }
 }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL           = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO           = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.PatientId = int.Parse(Session["UserId"].ToString());
            objSecureMedicalRecordDTO.Comments  = txtComments.Text;
            comment = NLPmethod(txtComments.Text.ToLower());
            NLP.PosNeg objposneg = new NLP.PosNeg();

            hneg = objposneg.Negativemethod();
            hpos = objposneg.Positiveemethod();
            foreach (DictionaryEntry d in hneg)
            {
                string key = d.Key.ToString();
                if (comment.ToLower().Contains(key))
                {
                    wordcount += 1;
                    count     += int.Parse(d.Value.ToString());
                }
            }

            foreach (DictionaryEntry d in hpos)
            {
                string key = d.Key.ToString();
                if (comment.ToLower().Contains(key))
                {
                    wordcount += 1;
                    count     += int.Parse(d.Value.ToString());
                }
            }
            float rating = 0;

            if (wordcount == 0)
            {
                rating = 0.5F;
            }
            else
            {
                rating = (count / wordcount);
            }
            int Rt = Convert.ToInt32(Math.Ceiling(rating));

            objSecureMedicalRecordDTO.PRate    = Rt.ToString();
            objSecureMedicalRecordDTO.DoctorId = int.Parse(ddlDoctor.SelectedItem.Value);
            int res = objSecureMedicalRecordBLL.PatientPostComments(objSecureMedicalRecordDTO);

            if (res == 1)
            {
                txtComments.Text = "";
                lblMsg.Text      = "Comments Post Successfully";
                lblMsg.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                txtComments.Text = "";
                lblMsg.Text      = "Comments Post Error";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
Example #12
0
        private void LoadData()
        {
            try
            {
                objSecureMedicalRecordBLL            = new BLL.SecureMedicalRecordBLL();
                objSecureMedicalRecordDTO            = new DTO.SecureMedicalRecordDTO();
                objSecureMedicalRecordDTO.DoctorId   = int.Parse(Session["UserId"].ToString());
                objSecureMedicalRecordDTO.AccessType = "General";
                DataTable tab = new DataTable();
                tab = objSecureMedicalRecordBLL.GetGeneralMedicalRecord_DoctorId(objSecureMedicalRecordDTO);
                if (tab.Rows.Count > 0)
                {
                    Table1.Controls.Clear();
                    TableRow hr = new TableRow();

                    TableHeaderCell hc1 = new TableHeaderCell();
                    hc1.Text = "Record Name";

                    TableHeaderCell hc2 = new TableHeaderCell();
                    hc2.Text = "";


                    hr.Cells.Add(hc1);
                    hr.Cells.Add(hc2);

                    Table1.Rows.Add(hr);
                    for (int i = 0; i < tab.Rows.Count; i++)
                    {
                        TableRow row = new TableRow();

                        Label lblRecordName = new Label();
                        lblRecordName.Text = tab.Rows[i]["RecordName"].ToString();

                        TableCell RecordName = new TableCell();
                        RecordName.Controls.Add(lblRecordName);

                        LinkButton lnk = new LinkButton();
                        lnk.ID              = "lnk" + i.ToString();
                        lnk.Text            = "View";
                        lnk.CommandArgument = tab.Rows[i]["RecordData"] + "-" + tab.Rows[i]["DataKey"];
                        lnk.Click          += new EventHandler(lnk_Click);

                        TableCell lnkview = new TableCell();
                        lnkview.Controls.Add(lnk);

                        row.Controls.Add(RecordName);
                        row.Controls.Add(lnkview);

                        Table1.Controls.Add(row);
                    }
                }
            }
            catch
            { }
        }
Example #13
0
        void lnk_Click(object sender, EventArgs e)
        {
            LinkButton lnk = (LinkButton)sender;

            objSecureMedicalRecordBLL          = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO          = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.RecordId = int.Parse(lnk.CommandArgument);
            objSecureMedicalRecordDTO.DoctorId = int.Parse(Session["UserId"].ToString());
            int res = objSecureMedicalRecordBLL.DoctorReq_RDA(objSecureMedicalRecordDTO);

            if (res == 1)
            {
            }
        }
Example #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         objSecureMedicalRecordBLL = new BLL.SecureMedicalRecordBLL();
         DataTable tab = new DataTable();
         tab = objSecureMedicalRecordBLL.GetDeptDetails();
         ddlDept.DataSource     = tab;
         ddlDept.DataTextField  = "DeptName";
         ddlDept.DataValueField = "DeptId";
         ddlDept.DataBind();
         ddlDept.Items.Insert(0, "--Select--");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         objSecureMedicalRecordBLL           = new BLL.SecureMedicalRecordBLL();
         objSecureMedicalRecordDTO           = new DTO.SecureMedicalRecordDTO();
         objSecureMedicalRecordDTO.PatientId = int.Parse(Session["UserId"].ToString());
         DataTable tab = new DataTable();
         tab = objSecureMedicalRecordBLL.GetDoctorId_PId(objSecureMedicalRecordDTO);
         ddlDoctor.DataSource     = tab;
         ddlDoctor.DataTextField  = "DoctorName";
         ddlDoctor.DataValueField = "DoctorId";
         ddlDoctor.DataBind();
         ddlDoctor.Items.Insert(0, "--Select--");
     }
 }
        private void Lnk_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            LinkButton lnk = (LinkButton)sender;

            objSecureMedicalRecordBLL           = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO           = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.DRecordId = int.Parse(lnk.CommandArgument);
            objSecureMedicalRecordDTO.DoctorId  = int.Parse(Session["UserId"].ToString());
            int res = objSecureMedicalRecordBLL.DoctorReq_DoctorMData(objSecureMedicalRecordDTO);

            if (res == 1)
            {
                lblMsg.Text      = "Record Request Successfully";
                lblMsg.ForeColor = System.Drawing.Color.Green;
            }
        }
Example #17
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL          = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO          = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.UserId   = int.Parse(txtUserId.Text);
            objSecureMedicalRecordDTO.Password = txtPassword.Text;
            objSecureMedicalRecordDTO.UserType = ddlUserType.SelectedItem.Text;
            Session["UserId"]    = txtUserId.Text;
            Session["UPassword"] = txtPassword.Text;
            Session["UserType"]  = ddlUserType.SelectedItem.Text;
            string res = objSecureMedicalRecordBLL.LoginVerification(objSecureMedicalRecordDTO);

            if (res == "1")
            {
                switch (ddlUserType.SelectedItem.Text)
                {
                case "Admin":
                    Response.Redirect("AdminHome.aspx");
                    break;

                case "Receptionist":
                    Response.Redirect("HospitalHome.aspx");
                    break;

                case "Lab Staff":
                    Response.Redirect("LabStaffHome.aspx");
                    break;

                case "Doctor":
                    Response.Redirect("DoctorHome.aspx");
                    break;

                case "Patient":
                    Response.Redirect("PatientHome.aspx");
                    break;
                }
            }
            else
            {
                lblMsg.Text      = "Invalid User Id/Password";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL            = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO            = new DTO.SecureMedicalRecordDTO();
            objSecureMedicalRecordDTO.RecordName = txtRecordName.Text;
            objSecureMedicalRecordDTO.DoctorId   = int.Parse(Session["UserId"].ToString());
            objSecureMedicalRecordDTO.RecordData = txtDescp.Text;

            Shamir obj           = new Shamir();
            Random rnd           = new Random();
            int    key           = rnd.Next(1000, 9999);
            string attributedata = obj.AttributeValue(key);

            attributedata = attributedata.Remove(0, 1);
            string Encryptdata = AESCryptoClass.EncryptData(objSecureMedicalRecordDTO.RecordData, key.ToString());

            objSecureMedicalRecordDTO.PastData = Encryptdata;
            objSecureMedicalRecordDTO.DataKey  = attributedata;
            int res = objSecureMedicalRecordBLL.UploadDoctorMedicalRecord(objSecureMedicalRecordDTO);

            if (res == 1)
            {
                txtRecordName.Text = txtDescp.Text = "";
                lblMsg.Text        = "Medical Upload Created Successfully";
                lblMsg.ForeColor   = System.Drawing.Color.Green;
            }
            else if (res == 2)
            {
                txtRecordName.Text = txtDescp.Text = "";
                lblMsg.Text        = "Medical Record Name Created Already";
                lblMsg.ForeColor   = System.Drawing.Color.Red;
            }
            else
            {
                txtRecordName.Text = txtDescp.Text = "";
                lblMsg.Text        = "Medical Upload Creation Error";
                lblMsg.ForeColor   = System.Drawing.Color.Red;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objSecureMedicalRecordBLL = new BLL.SecureMedicalRecordBLL();
            objSecureMedicalRecordDTO = new DTO.SecureMedicalRecordDTO();
            Shamir obj           = new Shamir();
            Random rnd           = new Random();
            int    key           = rnd.Next(1000, 9999);
            string attributedata = obj.AttributeValue(key);

            attributedata = attributedata.Remove(0, 1);
            objSecureMedicalRecordDTO.PatientId = PatientId;
            string PastData = txtMedicalHistory.Text + "-" + txtPatientAllergies.Text + "-" + txtSocialHistory.Text;

            objSecureMedicalRecordDTO.PastData = AESCryptoClass.EncryptData(PastData, key.ToString());
            objSecureMedicalRecordDTO.DataKey  = attributedata;
            string res = objSecureMedicalRecordBLL.CreatePatientClinical(objSecureMedicalRecordDTO);

            if (res == "1")
            {
                txtMedicalHistory.Text = txtPatientAllergies.Text = txtSocialHistory.Text = "";
                lblMsg.Text            = "Patient Past Medical History Uploaded Successfully & Patient Id:" + PatientId + " & Password:"******"Password"].ToString();
                lblMsg.ForeColor       = System.Drawing.Color.Green;
            }
            else if (res == "2")
            {
                txtMedicalHistory.Text = txtPatientAllergies.Text = txtSocialHistory.Text = "";
                lblMsg.Text            = "Patient Past Medical History Uploaded Already";
                lblMsg.ForeColor       = System.Drawing.Color.Red;
            }
            else
            {
                txtMedicalHistory.Text = txtPatientAllergies.Text = txtSocialHistory.Text = "";
                lblMsg.Text            = "Patient Past Medical History Upload Error";
                lblMsg.ForeColor       = System.Drawing.Color.Red;
            }
        }
 private void Lnk_Click(object sender, EventArgs e)
 {
     try
     {
         LinkButton lnk = (LinkButton)sender;
         objSecureMedicalRecordBLL       = new BLL.SecureMedicalRecordBLL();
         objSecureMedicalRecordDTO       = new DTO.SecureMedicalRecordDTO();
         objSecureMedicalRecordDTO.RDDId = int.Parse(lnk.CommandArgument.ToString().Split(',')[0]);
         Random rnd = new Random();
         objSecureMedicalRecordDTO.AccessKey = rnd.Next(10000, 99999).ToString();
         int res = objSecureMedicalRecordBLL.UpdateApprove_DoctorData(objSecureMedicalRecordDTO);
         if (res == 1)
         {
             string message = "RecordName:" + lnk.CommandArgument.ToString().Split(',')[2] + " & AccessKey:" + objSecureMedicalRecordDTO.AccessKey;
             string Sub     = "Access Key Credentials";
             SendEmail.Send(lnk.CommandArgument.ToString().Split(',')[1], message, Sub);
         }
     }
     catch
     {
         lblMsg.Text      = "Failure sending mail";
         lblMsg.ForeColor = System.Drawing.Color.Red;
     }
 }
 private void LnkR_Click(object sender, EventArgs e)
 {
     try
     {
         LinkButton lnk = (LinkButton)sender;
         objSecureMedicalRecordBLL       = new BLL.SecureMedicalRecordBLL();
         objSecureMedicalRecordDTO       = new DTO.SecureMedicalRecordDTO();
         objSecureMedicalRecordDTO.RDDId = int.Parse(lnk.CommandArgument.ToString().Split(',')[0]);
         Random rnd = new Random();
         objSecureMedicalRecordDTO.AccessKey = "0";
         int res = objSecureMedicalRecordBLL.Reject_DoctorData(objSecureMedicalRecordDTO);
         if (res == 1)
         {
             string message = "RecordName:" + lnk.CommandArgument.ToString().Split(',')[2] + " & Medical Record Request Rejected,Contact Doctor.";
             string Sub     = "Medical Record Request Reject";
             SendEmail.Send(lnk.CommandArgument.ToString().Split(',')[1], message, Sub);
         }
     }
     catch
     {
         lblMsg.Text      = "Failure sending mail";
         lblMsg.ForeColor = System.Drawing.Color.Red;
     }
 }
        private void LoadData()
        {
            try
            {
                objSecureMedicalRecordBLL          = new BLL.SecureMedicalRecordBLL();
                objSecureMedicalRecordDTO          = new DTO.SecureMedicalRecordDTO();
                objSecureMedicalRecordDTO.DoctorId = int.Parse(Session["UserId"].ToString());
                DataTable tab = new DataTable();
                tab = objSecureMedicalRecordBLL.Approve_DoctorData(objSecureMedicalRecordDTO);
                if (tab.Rows.Count > 0)
                {
                    Table1.Controls.Clear();
                    TableRow hr = new TableRow();

                    TableHeaderCell hc1 = new TableHeaderCell();
                    hc1.Text = "Record Name";

                    TableHeaderCell hc2 = new TableHeaderCell();
                    hc2.Text = "Doctor Name";

                    TableHeaderCell hc3 = new TableHeaderCell();
                    hc3.Text = "";

                    TableHeaderCell hc4 = new TableHeaderCell();
                    hc4.Text = "";


                    hr.Cells.Add(hc1);
                    hr.Cells.Add(hc2);
                    hr.Cells.Add(hc3);
                    hr.Cells.Add(hc4);

                    Table1.Rows.Add(hr);
                    for (int i = 0; i < tab.Rows.Count; i++)
                    {
                        TableRow row = new TableRow();

                        Label lblRecordName = new Label();
                        lblRecordName.Text = tab.Rows[i]["DRecordName"].ToString();

                        TableCell RecordName = new TableCell();
                        RecordName.Controls.Add(lblRecordName);

                        Label lblDoctorName = new Label();
                        lblDoctorName.Text = tab.Rows[i]["DoctorName"].ToString();

                        TableCell DoctorName = new TableCell();
                        DoctorName.Controls.Add(lblDoctorName);

                        LinkButton lnk = new LinkButton();
                        lnk.ID              = "lnk" + i.ToString();
                        lnk.Text            = "Approve";
                        lnk.CommandArgument = tab.Rows[i]["RDDId"] + "," + tab.Rows[i]["EmailId"] + "," + tab.Rows[i]["DRecordName"];
                        lnk.Click          += Lnk_Click;

                        TableCell lnkview = new TableCell();
                        lnkview.Controls.Add(lnk);

                        LinkButton lnkR = new LinkButton();
                        lnkR.ID              = "lnkR" + i.ToString();
                        lnkR.Text            = "Reject";
                        lnkR.CommandArgument = tab.Rows[i]["RDDId"] + "," + tab.Rows[i]["EmailId"] + "," + tab.Rows[i]["DRecordName"];
                        lnkR.Click          += LnkR_Click;

                        TableCell lnkRview = new TableCell();
                        lnkRview.Controls.Add(lnkR);

                        row.Controls.Add(RecordName);
                        row.Controls.Add(DoctorName);
                        row.Controls.Add(lnkview);
                        row.Controls.Add(lnkRview);

                        Table1.Controls.Add(row);
                    }
                }
                else
                {
                    lblMsg.Text      = "No Record Found";
                    lblMsg.ForeColor = System.Drawing.Color.Red;
                }
            }
            catch
            { }
        }
        private void LoadData()
        {
            try
            {
                objSecureMedicalRecordBLL           = new BLL.SecureMedicalRecordBLL();
                objSecureMedicalRecordDTO           = new DTO.SecureMedicalRecordDTO();
                objSecureMedicalRecordDTO.PatientId = int.Parse(txtPatientId.Text);
                DataTable tab = new DataTable();
                tab = objSecureMedicalRecordBLL.GetPatientDetails_Consult(objSecureMedicalRecordDTO);
                if (tab.Rows.Count > 0)
                {
                    Table1.Controls.Clear();
                    TableRow hr = new TableRow();

                    TableHeaderCell hc1 = new TableHeaderCell();
                    hc1.Text = "Doctor Name";

                    TableHeaderCell hc2 = new TableHeaderCell();
                    hc2.Text = "Problem Title";

                    TableHeaderCell hc3 = new TableHeaderCell();
                    hc3.Text = "Treatment Date";

                    TableHeaderCell hc4 = new TableHeaderCell();
                    hc4.Text = "Treatment Details";


                    hr.Cells.Add(hc1);
                    hr.Cells.Add(hc2);
                    hr.Cells.Add(hc3);
                    hr.Cells.Add(hc4);

                    Table1.Rows.Add(hr);
                    for (int i = 0; i < tab.Rows.Count; i++)
                    {
                        TableRow row = new TableRow();

                        Label lblDoctorName = new Label();
                        lblDoctorName.Text = tab.Rows[i]["DoctorName"].ToString();

                        TableCell DoctorName = new TableCell();
                        DoctorName.Controls.Add(lblDoctorName);

                        Label lblProblemTitle = new Label();
                        lblProblemTitle.Text = tab.Rows[i]["ProblemTitle"].ToString();

                        TableCell ProblemTitle = new TableCell();
                        ProblemTitle.Controls.Add(lblProblemTitle);

                        Label lblTDate = new Label();
                        lblTDate.Text = tab.Rows[i]["TDate"].ToString();

                        TableCell TDate = new TableCell();
                        TDate.Controls.Add(lblTDate);

                        string         dk     = tab.Rows[i]["DataKey"].ToString();
                        GetDecryptData obj    = new GetDecryptData();
                        string         result = obj.GetData(dk);

                        string data = AESCryptoClass.Decrypt(tab.Rows[i]["TData"].ToString(), result.ToString());

                        Label lblTDetails = new Label();
                        lblTDetails.Text = data;

                        TableCell TDetails = new TableCell();
                        TDetails.Controls.Add(lblTDetails);

                        row.Controls.Add(DoctorName);
                        row.Controls.Add(ProblemTitle);
                        row.Controls.Add(TDate);
                        row.Controls.Add(TDetails);

                        Table1.Controls.Add(row);
                    }
                }
            }
            catch
            { }
        }