Esempio n. 1
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();
            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";
            }
        }
Esempio n. 3
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;
            }
        }
Esempio n. 4
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;
            }
        }
Esempio n. 6
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
     {
     }
 }
        public int UploadDoctorMedicalRecord(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sqlchk = string.Format("Select count(*) from drecordmaster where DRecordName='{0}'", objDTO.RecordName);

            cmd.CommandText = sqlchk;
            int cnt = int.Parse(cmd.ExecuteScalar().ToString());
            int res = 0;

            if (cnt == 0)
            {
                string sql = string.Format("insert into drecordmaster(DoctorId,DRecordName,DataRecord,DataKey)values({0},'{1}','{2}','{3}')", objDTO.DoctorId, objDTO.RecordName, objDTO.PastData, objDTO.DataKey);
                cmd.CommandText = sql;
                res             = cmd.ExecuteNonQuery();
                string DRsql = string.Format("Select max(DRecordId) from drecordmaster");
                cmd.CommandText = DRsql;
                int    DRId = int.Parse(cmd.ExecuteScalar().ToString());
                string sqlD = string.Format("select doctormaster.DeptId,mapdoctorhospital.HospitalId from doctormaster inner join mapdoctorhospital on doctormaster.DoctorId=mapdoctorhospital.DoctorId where doctormaster.DoctorId={0}", objDTO.DoctorId);

                cmd.CommandText = sqlD;
                adp             = new MySqlDataAdapter(cmd);
                DataTable buffer = new DataTable();
                adp.Fill(buffer);
                string DDRMsql = string.Format("insert into dmrdatahospital(DRecordId,HospitalId,DeptId)values({0},{1},{2})", DRId, buffer.Rows[0]["HospitalId"].ToString(), buffer.Rows[0]["DeptId"].ToString());
                cmd.CommandText = DDRMsql;
                res             = cmd.ExecuteNonQuery();
            }
            else
            {
                res = 2;
            }
            con.Close();
            return(res);
        }
        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();
            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";
            }
        }
Esempio n. 10
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";
     }
 }
        public string LoginVerify(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sql = "";

            if (objDTO.UserType == "Admin")
            {
                sql = string.Format("Select count(*) from adminmaster where AdminId={0} and Password='******'", objDTO.UserId, objDTO.Password);
            }
            else if (objDTO.UserType == "Receptionist")
            {
                sql = string.Format("Select count(*) from hospitalmaster where HospitalId={0} and Password='******'", objDTO.UserId, objDTO.Password);
            }
            else if (objDTO.UserType == "Doctor")
            {
                sql = string.Format("Select count(*) from doctormaster where DoctorId={0} and Password='******'", objDTO.UserId, objDTO.Password);
            }
            else if (objDTO.UserType == "Patient")
            {
                sql = string.Format("Select count(*) from patientmaster where PatientId={0} and Password='******'", objDTO.UserId, objDTO.Password);
            }
            cmd.CommandText = sql;
            string result = cmd.ExecuteScalar().ToString();

            con.Close();
            return(result);
        }
        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;
            }
        }
        public string ChangePassword(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sql = "";

            if (objDTO.UserType == "Admin")
            {
                sql = string.Format("update adminmaster set Password={0} where AdminId={1}", objDTO.Password, objDTO.UserId);
            }
            else if (objDTO.UserType == "Receptionist")
            {
                sql = string.Format("update hospitalmaster set Password={0} where HospitalId={1}", objDTO.Password, objDTO.UserId);
            }
            else if (objDTO.UserType == "Doctor")
            {
                sql = string.Format("update doctormaster set Password={0} where DoctorId={1}", objDTO.Password, objDTO.UserId);
            }
            else if (objDTO.UserType == "Patient")
            {
                sql = string.Format("update patientmaster set Password={0} where PatientId={1}", objDTO.Password, objDTO.UserId);
            }
            cmd.CommandText = sql;
            string result = cmd.ExecuteNonQuery().ToString();

            con.Close();
            return(result);
        }
        public int UploadMedicalRecord(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sqlchk = string.Format("Select count(*) from recordmaster where RecordName='{0}'", objDTO.RecordName);

            cmd.CommandText = sqlchk;
            int cnt = int.Parse(cmd.ExecuteScalar().ToString());
            int res = 0;

            if (cnt == 0)
            {
                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(objDTO.RecordData, key.ToString());
                string sql         = string.Format("insert into recordmaster(DeptId,RecordName,AccessType,RecordData,DataKey)values({0},'{1}','{2}','{3}','{4}')", objDTO.DeptId, objDTO.RecordName, objDTO.AccessType, Encryptdata, attributedata);
                cmd.CommandText = sql;
                res             = cmd.ExecuteNonQuery();
            }
            else
            {
                res = 2;
            }
            con.Close();
            return(res);
        }
        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;
            }
        }
Esempio n. 16
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
            { }
        }
        public int DoctorReq_RDA_Approve(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            int    res = 0;
            string sql = string.Format("Update recordrequest set AccessKey='{0}',Status='Accept' where ReqId={1}", objDTO.AccessKey, objDTO.ReqId);

            cmd.CommandText = sql;
            res             = cmd.ExecuteNonQuery();
            con.Close();
            return(res);
        }
        public string CreatePatient(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string result = "";
            string sql    = string.Format("insert into patientmaster(PatientId,Name,Password,Gender,Age,Reason,MobileNo,Address) Values({0},'{1}','{2}','{3}',{4},'{5}','{6}','{7}')", objDTO.PatientId, objDTO.PatientName, objDTO.Password, objDTO.Gender, objDTO.Age, objDTO.Reason, objDTO.MobileNo, objDTO.Address);

            cmd.CommandText = sql;
            result          = cmd.ExecuteNonQuery().ToString();
            con.Close();
            return(result);
        }
        public string PatientTreatment(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string result = "";
            string sql    = string.Format("insert into patienttreatment(PatientId,DoctorId,ProblemTitle,TDate,TData,DataKey) Values({0},{1},'{2}','{3}','{4}','{5}')", objDTO.PatientId, objDTO.DoctorId, objDTO.ProblemTitle, DateTime.Now.ToString("dd/MM/yyyy"), objDTO.PastData, objDTO.DataKey);

            cmd.CommandText = sql;
            result          = cmd.ExecuteNonQuery().ToString();
            con.Close();
            return(result);
        }
        public int DoctorReq_DoctorMData(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            int    res = 0;
            string sql = string.Format("insert into requestdocdata(DRecordId,DoctorId,Status)values({0},{1},'Pending')", objDTO.DRecordId, objDTO.DoctorId);

            cmd.CommandText = sql;
            res             = cmd.ExecuteNonQuery();
            con.Close();
            return(res);
        }
        public int Reject_DoctorData(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            int    res = 0;
            string sql = string.Format("Update requestdocdata set AccessKey='{0}',Status='Reject' where RDDId={1}", objDTO.AccessKey, objDTO.RDDId);

            cmd.CommandText = sql;
            res             = cmd.ExecuteNonQuery();
            con.Close();
            return(res);
        }
        public int PatientPostComments(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            int    res = 0;
            string sql = string.Format("insert into postcomments(PatientId,DoctorId,PostDate,Comments,Ratings)values({0},{1},'{2}','{3}',{4})", objDTO.PatientId, objDTO.DoctorId, DateTime.Now.ToString("dd/MM/yyyy"), objDTO.Comments, objDTO.PRate);

            cmd.CommandText = sql;
            res             = cmd.ExecuteNonQuery();
            con.Close();
            return(res);
        }
        public int AddDoctor(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            int    res = 0;
            string sql = string.Format("insert into doctormaster(DoctorId,DeptId,DoctorName,Password,Type,MobileNo,EmailId,Address,Status)values({0},{1},'{2}','{3}','{4}','{5}','{6}','{7}','Active')", objDTO.DoctorId, objDTO.DeptId, objDTO.DoctorName, objDTO.Password, "Normal", objDTO.MobileNo, objDTO.EmailId, objDTO.Address);

            cmd.CommandText = sql;
            res             = cmd.ExecuteNonQuery();
            con.Close();
            return(res);
        }
        public DataTable GetDoctorRating_DId(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sql = string.Format("select doctormaster.DoctorName,hospitalmaster.HospitalName,postcomments.Ratings from doctormaster inner join mapdoctorhospital on doctormaster.DoctorId=mapdoctorhospital.DoctorId inner join hospitalmaster on mapdoctorhospital.HospitalId=hospitalmaster.HospitalId inner join postcomments on doctormaster.DoctorId=postcomments.DoctorId where doctormaster.DeptId={0}", objDTO.DeptId);

            cmd.CommandText = sql;
            adp             = new MySqlDataAdapter(cmd);
            DataTable buffer = new DataTable();

            adp.Fill(buffer);
            con.Close();
            return(buffer);
        }
        public DataTable GetMedicalRecordA_ViewData(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sql = string.Format("select recordmaster.RecordName,recordrequest.AccessKey,recordmaster.RecordData,recordmaster.DataKey from recordmaster Inner Join recordrequest on recordmaster.RecordId=recordrequest.RecordId where recordrequest.DoctorId={0} and recordrequest.Status='Accept'", objDTO.DoctorId);

            cmd.CommandText = sql;
            adp             = new MySqlDataAdapter(cmd);
            DataTable buffer = new DataTable();

            adp.Fill(buffer);
            con.Close();
            return(buffer);
        }
        public DataTable GetPatient_PHD(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sql = string.Format("select * from patientclinicalmaster where PatientId={0}", objDTO.PatientId);

            cmd.CommandText = sql;
            adp             = new MySqlDataAdapter(cmd);
            DataTable buffer = new DataTable();

            adp.Fill(buffer);
            con.Close();
            return(buffer);
        }
        public DataTable Approve_DoctorData(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string rdsql = string.Format("Select doctormaster.DoctorName,doctormaster.EmailId,drecordmaster.DRecordName,requestdocdata.RDDId from requestdocdata Inner Join drecordmaster on requestdocdata.DRecordId=drecordmaster.DRecordId Inner Join doctormaster on doctormaster.DoctorId=requestdocdata.DoctorId where drecordmaster.DoctorId={0} and requestdocdata.Status='Pending'", objDTO.DoctorId);

            cmd.CommandText = rdsql;
            adp             = new MySqlDataAdapter(cmd);
            DataTable buffer = new DataTable();

            adp.Fill(buffer);
            con.Close();
            return(buffer);
        }
Esempio n. 28
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)
            {
            }
        }
        public DataTable GetDoctorData_Approved(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sql = string.Format("select drecordmaster.DRecordName,drecordmaster.DataRecord,drecordmaster.DataKey,requestdocdata.AccessKey from drecordmaster Inner Join requestdocdata on drecordmaster.DRecordId=requestdocdata.DRecordId where requestdocdata.DoctorId={0} and requestdocdata.Status='Accept'", objDTO.DoctorId);

            cmd.CommandText = sql;
            adp             = new MySqlDataAdapter(cmd);
            DataTable buffer = new DataTable();

            adp.Fill(buffer);
            con.Close();
            return(buffer);
        }
        public DataTable GetDoctorId_PId(SecureMedicalRecord.DTO.SecureMedicalRecordDTO objDTO)
        {
            cmd            = new MySqlCommand();
            cmd.Connection = con;
            string sql = string.Format("select doctormaster.DoctorName,doctormaster.DoctorId from doctormaster inner join patienttreatment on doctormaster.DoctorId=patienttreatment.DoctorId where patienttreatment.PatientId={0}", objDTO.PatientId);

            cmd.CommandText = sql;
            adp             = new MySqlDataAdapter(cmd);
            DataTable buffer = new DataTable();

            adp.Fill(buffer);
            con.Close();
            return(buffer);
        }