Exemplo n.º 1
0
 private void My_Patients_Load(object sender, EventArgs e)
 {
     select_bday.MaxDate = DateTime.Today.AddDays(+0);
     rb_pfname.Checked   = true;
     db.Populate(ptnt_view, @"SELECT * FROM clinic.tbl_patient WHERE 1");
     btn_cancel.Visible    = false;
     btn_add.Visible       = false;
     select_bday.Visible   = false;
     select_gender.Visible = false;
 }
Exemplo n.º 2
0
 private void Update_Services_Load(object sender, EventArgs e)
 {
     CompleteServices();
     db.Populate(update_service, @"SELECT * FROM clinic.tbl_services");
     txt_sname.ReadOnly      = true;
     txt_sdetails.ReadOnly   = true;
     txt_sprice.ReadOnly     = true;
     btn_save.Visible        = false;
     btn_cancel.Visible      = false;
     btnCancelAdd.Visible    = false;
     btn_saveService.Visible = false;
     btn_update.Enabled      = false;
 }
Exemplo n.º 3
0
        private void btn_MedAdd_Click(object sender, EventArgs e)
        {
            dbProvider db       = new dbProvider();
            int        b        = 0;
            int        idMed    = b;
            int        idemp    = Convert.ToInt32(dsp_id.Text);
            string     tongue   = txt_tongue.Text;
            string     palate   = txt_palate.Text;
            string     tonsil   = txt_tonsil.Text;
            string     lips     = txt_lips.Text;
            string     floor    = txt_floorOfMouth.Text;
            string     cheeks   = txt_cheeks.Text;
            string     allergy  = txt_allergy.Text;
            string     heart    = txt_HeartDisease.Text;
            string     blood    = txt_BloodDyscracia.Text;
            string     diabetes = txt_Diabetes.Text;
            string     kidney   = txt_kidney.Text;
            string     liver    = txt_liver.Text;
            string     hygiene  = txt_hygiene.Text;
            string     others   = txt_others.Text;


            db.addMed(idMed, idemp, tongue, palate, tonsil, lips, floor, cheeks, allergy, heart, blood, diabetes, kidney, liver, hygiene, others);
            MessageBox.Show("Sucessfuly Updated!");
            db.Populate(ptnt_view, @"SELECT * FROM clinic.tbl_patient WHERE 1");
            goBack();
        }
Exemplo n.º 4
0
 private void btn_block_Click(object sender, EventArgs e)
 {
     if (emp_view.SelectedItems.Count == 0)
     {
         MessageBox.Show("Please select employee to block!");
     }
     else if (emp_view.SelectedItems.Count == 1)
     {
         SystemSounds.Exclamation.Play();
         DialogResult dialog = MessageBox.Show("Are you sure to block user?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dialog == DialogResult.No)
         {
         }
         else if (dialog == DialogResult.Yes)
         {
             if (emp_view.SelectedItems.Count == 1)
             {
                 string command = "UPDATE clinic.users SET active ='N' where user_id = '" + this.dsp_id.Text + "' AND acctype = 'Employee' ";
                 con = new MySqlConnection(conString());
                 cmd = new MySqlCommand(command, con);
                 try
                 {
                     con.Open();
                     reader = cmd.ExecuteReader();
                     while (reader.Read())
                     {
                     }
                     MessageBox.Show("User has been blocked!");
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message);
                 }
             }
             else
             {
                 MessageBox.Show("Select from list to update");
             }
             emp_view.Items.Clear();
             db.Populate(emp_view, @"SELECT user_id,fname,lname,username,gender,position,status,number,active FROM clinic.users WHERE active = 'Y'  AND acctype = 'Employee'");
         }
     }
 }
Exemplo n.º 5
0
        private void Update_Account_Load(object sender, EventArgs e)
        {
            db.Populate(update_user, @"SELECT fname,lname,acctype,username,position,user_id FROM clinic.users WHERE active = 'Y'  AND acctype = 'Employee'");
            rb_fname.Checked = true;

            txt_fname.Enabled       = false;
            txt_lname.Enabled       = false;
            txt_uname.Enabled       = false;
            txt_repass.Enabled      = false;
            txt_AccountType.Enabled = false;
            txt_position.Enabled    = false;
            btn_update.Enabled      = false;
        }
Exemplo n.º 6
0
        private void btn_BasicUpdate_Click(object sender, EventArgs e)
        {
            dbProvider db = new dbProvider();

            SystemSounds.Exclamation.Play();
            DialogResult dialog = MessageBox.Show("You are sure to update patients information?", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (dialog == DialogResult.Cancel)
            {
            }
            else if (dialog == DialogResult.OK)
            {
                string fname   = dsp_fname.Text;
                string lname   = dsp_lname.Text;
                string mi      = dsp_mi.Text;
                string bday    = select_bday.Text.ToString();
                string gender  = select_gender.Text.ToString();
                string addCrnt = dsp_currAdd.Text;
                string addPer  = dsp_perAdd.Text;
                string Wnum    = dsp_wnum.Text;
                string Hnum    = dsp_hnum.Text;
                string Mnum    = dsp_mnum.Text;


                if (fname == "" || lname == "" || mi == "" || bday == "" || gender == "" || addCrnt == "" || Mnum == "")
                {
                    MessageBox.Show("Please complete the form!");
                }
                else if (fname != "" || lname != "" || mi != "" || bday != "" || gender != "" || addCrnt != "" || Mnum != "")
                {
                    string command = "UPDATE clinic.tbl_patient SET Ptnt_Fname='" + fname + "', Ptnt_Minitial='" + mi + "', Ptnt_Lname='" + lname + "', Ptnt_bday='" + bday + "', Ptnt_CurntAdd='" + addCrnt + "', Ptnt_pmntAdd='" + addPer + "', Ptnt_HomeNum='" + Hnum + "', Ptnt_WorkNum='" + Wnum + "', Ptnt_MobileNum='" + Mnum + "' where Ptnt_id ='" + this.dsp_id.Text + "'";
                    con = new MySqlConnection(conString());
                    cmd = new MySqlCommand(command, con);
                    try
                    {
                        con.Open();
                        reader = cmd.ExecuteReader();
                        MessageBox.Show("Succesfully Updated!");
                        while (reader.Read())
                        {
                        }
                        db.Populate(ptnt_view, @"SELECT * FROM clinic.tbl_patient WHERE 1");
                        goBack();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }