Exemplo n.º 1
0
 private void txtAdmitDate_Click(object sender, EventArgs e)
 {
     DateTimePickerAdmitDate.Show();
     txtAdmitDate.Hide();
 }
Exemplo n.º 2
0
        private void patient_profile_Edit_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt_doc = this.cntrl.get_all_doctorname();
                cmbDoctorName.ValueMember   = "id";
                cmbDoctorName.DisplayMember = "doctor_name";
                cmbDoctorName.DataSource    = dt_doc;
                DateTimePickerDob.MaxDate   = DateTime.Now.Date;
                if (doctor_id != "1")
                {
                    string id;
                    id = this.cntrl.privillage_E(doctor_id);
                    if (int.Parse(id) > 0)
                    {
                        btnSavePatient.Enabled = false;
                    }
                    else
                    {
                        btnSavePatient.Enabled = true;
                    }
                    id = this.cntrl.privillage_D(doctor_id);
                    if (int.Parse(id) > 0)
                    {
                        btnDelete.Enabled = false;
                    }
                    else
                    {
                        btnDelete.Enabled = true;
                    }
                }
                //DataGridViewCheckBoxColumn check = new DataGridViewCheckBoxColumn()
                //{
                //    Name = "Check"
                //};
                //grmedical.Columns.Add(check);
                //check.Width = 100;
                //check.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                //DataTable dt8 = this.cntrl.get_medicalId(patient_id);
                //if (dt8.Rows.Count>0)
                //{
                //    string mht = this.cntrl.patient_medical(patient_id, dt8.Rows[0][0].ToString());
                //    if (mht != "")
                //    {
                //        grmedical.Rows.Add(dt8);
                //    }
                //}
                //DataGridViewCheckBoxColumn checkgroup = new DataGridViewCheckBoxColumn()
                //{
                //    Name = "Check"
                //};
                //dgvgroup.Columns.Add(checkgroup);
                //checkgroup.Width = 100;
                //checkgroup.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                //string dt9 = this.cntrl.groupname();
                //if (dt9 != "")
                //{
                //    string gt = this.cntrl.patient_group(patient_id, dt9);
                //    if (gt != "")
                //    {
                //        dgvgroup.Rows.Add(dt9);
                //    }
                //}

                this.MinimumSize  = new System.Drawing.Size(570, 650);
                this.AutoSize     = true;
                this.AutoSizeMode = AutoSizeMode.GrowAndShrink;

                DataGridViewCheckBoxColumn checkgroup = new DataGridViewCheckBoxColumn()
                {
                    Name = "Check"
                };
                dgvgroup.Columns.Add(checkgroup);
                checkgroup.Width = 100;
                checkgroup.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                DataTable group = this.cntrl.get_groupid(patient_id);
                for (int j = 0; j < group.Rows.Count; j++)
                {
                    dgvgroup.Rows.Add(group.Rows[j][0].ToString());
                    dgvgroup.Rows[j].Cells[1].Value           = true;
                    dgvgroup.Rows[j].Cells[0].Style.BackColor = Color.FromArgb(62, 165, 195);
                    dgvgroup.Rows[j].Cells[1].Style.BackColor = Color.FromArgb(62, 165, 195);
                }
                DataTable dt9 = this.cntrl.groupname();
                for (int k = 0; k < dt9.Rows.Count; k++)
                {
                    string gt = this.cntrl.patient_group(patient_id, dt9.Rows[k]["name"].ToString());
                    if (gt == "0")
                    {
                        dgvgroup.Rows.Add(dt9.Rows[k]["name"].ToString());
                    }
                }
                DataGridViewCheckBoxColumn check = new DataGridViewCheckBoxColumn()
                {
                    Name = "Check"
                };
                grmedical.Columns.Add(check);
                check.Width = 100;
                check.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                DataTable dt8 = this.cntrl.get_medicalId(patient_id);
                for (int j = 0; j < dt8.Rows.Count; j++)
                {
                    grmedical.Rows.Add(dt8.Rows[j][0].ToString());
                    grmedical.Rows[j].Cells[1].Value           = true;
                    grmedical.Rows[j].Cells[0].Style.BackColor = Color.FromArgb(62, 165, 195);
                    grmedical.Rows[j].Cells[1].Style.BackColor = Color.FromArgb(62, 165, 195);
                }
                DataTable dt35 = this.cntrl.Get_medicalname();
                for (int j = 0; j < dt35.Rows.Count; j++)
                {
                    string mht = this.cntrl.patient_medical(patient_id, dt35.Rows[j][0].ToString());
                    if (mht == "0")
                    {
                        grmedical.Rows.Add(dt35.Rows[j][0].ToString());
                    }
                }
                ///
                DataTable dt7 = this.cntrl.Get_Patient_Details(patient_id);
                txtPatientName.Text    = dt7.Rows[0]["pt_name"].ToString();
                txtPatientId.Text      = dt7.Rows[0]["pt_id"].ToString();
                txtPatientId.BackColor = Color.White;
                txtAdhaarId.Text       = dt7.Rows[0]["aadhar_id"].ToString();
                if (dt7.Rows[0]["gender"].ToString() == "Male")
                {
                    RBtnMale.Checked = true;
                }
                else
                {
                    RBtnFemale.Checked = true;
                }
                string aa = dt7.Rows[0]["date_of_birth"].ToString();
                if (dt7.Rows[0]["date_of_birth"].ToString() != "")
                {
                    DateTimePickerDob.Show();
                    txtDob.Hide();
                    DateTimePickerDob.Value = DateTime.Parse(DateTime.Parse(dt7.Rows[0]["date_of_birth"].ToString()).ToString("yyyy-MM-dd"));
                }
                else
                {
                    txtDob.Show();
                    DateTimePickerDob.Hide();
                    txtDob.Text = "click here to choose a date";
                }
                if (dt7.Rows[0]["age"].ToString() != "0")
                {
                    txtAge.Text = dt7.Rows[0]["age"].ToString();
                }
                else
                {
                    txtAge.Text = "";
                }
                cmbBloodGroup.Text      = dt7.Rows[0]["blood_group"].ToString();
                txtAccompaniedBy.Text   = dt7.Rows[0]["family"].ToString();
                txtOccupation.Text      = dt7.Rows[0]["Occupation"].ToString();
                txtPrimaryMobNbr.Text   = dt7.Rows[0]["primary_mobile_number"].ToString();
                txtSecondaryMobNbr.Text = dt7.Rows[0]["secondary_mobile_number"].ToString();
                txtLandLineNbr.Text     = dt7.Rows[0]["landline_number"].ToString();
                txtEmail.Text           = dt7.Rows[0]["email_address"].ToString();
                txtStreetAddress.Text   = dt7.Rows[0]["street_address"].ToString();
                txtLocality.Text        = dt7.Rows[0]["locality"].ToString();
                txtCity.Text            = dt7.Rows[0]["city"].ToString();
                txtPin.Text             = dt7.Rows[0]["pincode"].ToString();
                txtnationality.Text     = dt7.Rows[0]["nationality"].ToString();
                txtpassport.Text        = dt7.Rows[0]["passport_no"].ToString();
                txtReferredBy.Text      = dt7.Rows[0]["refferedby"].ToString();
                txtFileNo.Text          = dt7.Rows[0]["Opticket"].ToString();
                string bb = dt7.Rows[0]["Visited"].ToString();
                if (dt7.Rows[0]["Visited"].ToString() != "")
                {
                    DateTimePickerAdmitDate.Show();
                    txtAdmitDate.Hide();
                    DateTimePickerAdmitDate.Value = DateTime.Parse(DateTime.Parse(dt7.Rows[0]["Visited"].ToString()).ToString("yyyy-MM-dd"));
                }
                else
                {
                    DateTimePickerAdmitDate.Hide();
                    txtAdmitDate.Text = "click here to choose a date";
                }
                cmbDoctorName.Text = dt7.Rows[0]["doctorname"].ToString();
                try
                {
                    string curFile = this.cntrl.getserver() + "\\Pappyjoe_utilities\\patient_image\\" + patient_id;
                    if (System.IO.File.Exists(curFile))
                    {
                        pictureBox_PatientPhoto.Image = Image.FromFile(curFile);
                    }
                    else
                    {
                        pictureBox_PatientPhoto.Image = PappyjoeMVC.Properties.Resources.nophoto;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }