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";
            }
        }
        void lnk_Click(object sender, EventArgs e)
        {
            xList        = new ArrayList();
            yList        = new ArrayList();
            lagrangeList = new ArrayList();
            Shamir     objShamir = new Shamir();
            LinkButton lnk       = (LinkButton)sender;

            if (txtKey.Text == lnk.CommandArgument.ToString().Split('-')[0])
            {
                lblMsg.Text = "";
                string[] attval = lnk.CommandArgument.ToString().Split('-')[2].Split(',');
                Random   rnd    = new Random();
                for (int i = 0; i <= 2;)
                {
                    int v = rnd.Next(1, 6);
                    int p = valrnd.IndexOf(v);
                    if (p < 0)
                    {
                        valrnd.Add(v);
                        i++;
                    }
                }
                for (int i = 0; i <= 2; i++)
                {
                    xList.Add(valrnd[i]);
                    yList.Add(attval[int.Parse(valrnd[i].ToString()) - 1].ToString());
                }
                K = "3";
                for (int i = 0; i < int.Parse(K); i++)
                {
                    lagrangeList.Add(Lagarange(i));
                }
                double result = 0.0;
                for (int i = 0; i < int.Parse(K); i++)
                {
                    result = result + (double.Parse(yList[i].ToString()) * double.Parse(lagrangeList[i].ToString()));
                }
                if (result < 0)
                {
                    result = result * -1.0;
                }
                result = Math.Round(result, MidpointRounding.AwayFromZero);

                txtMedicalData.Text = AESCryptoClass.Decrypt(lnk.CommandArgument.ToString().Split('-')[1], result.ToString());
            }
            else
            {
                lblMsg.Text      = "Invalid Access Key";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
Beispiel #4
0
        private void Lnk_Click(object sender, EventArgs e)
        {
            LinkButton lnk = (LinkButton)sender;

            if (txtKey.Text == lnk.CommandArgument.ToString().Split('-')[0])
            {
                lblMsg.Text = "";
                string         dk     = lnk.CommandArgument.ToString().Split('-')[2];
                GetDecryptData obj    = new GetDecryptData();
                string         result = obj.GetData(dk);
                txtMedicalData.Text = AESCryptoClass.Decrypt(lnk.CommandArgument.ToString().Split('-')[1], result.ToString());
            }
            else
            {
                lblMsg.Text      = "Invalid Access Key";
                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 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
            { }
        }