Пример #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            String uName = userName.Text.ToString();
            String uPwd  = userPassword.Text.ToString();

            clsdb obj = new clsdb();

            DataTable dt = new DataTable();


            dt = obj.getUserTable(uName, uPwd);

            if (dt.Rows.Count > 0 && dt.Rows[0][3].ToString() == "su_admin")
            {
                Addpatients frm = new Addpatients();

                frm.Show();

                this.Hide();
            }

            else if (dt.Rows.Count > 0 && dt.Rows[0][3].ToString() == "staff")
            {
                Addpatients frm = new Addpatients();
                frm.Show();
            }

            else
            {
                MessageBox.Show("Username or password is incorrect!");
            }
        }
Пример #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            String onco = oncologistTxt.Text;

            if (String.IsNullOrEmpty(onco))
            {
                MessageBox.Show("Enter Oncologist Name Please,before delete.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            clsdb obj = new clsdb();

            DataTable dt = new DataTable();



            try
            {
                int id = obj.addOncologists(onco);
                if (id > 0)
                {
                    MessageBox.Show("Successfully Enterd data");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
            oncologistTxt.Clear();
        }
Пример #3
0
        private void Addpatients_Load(object sender, EventArgs e)
        {
            clsdb obj = new clsdb();

            DataTable dt = new DataTable();

            ComboBox combo = poncolgstTxt;

            dt = obj.bindData(combo);
        }
Пример #4
0
        private void btnDisplay_Click(object sender, EventArgs e)
        {
            clsdb obj = new clsdb();

            DataTable dt = new DataTable();


            dt = obj.getAllStaffDetails();

            dataGridView2.DataSource = dt;
        }
Пример #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            String sid    = sidTxt.Text;
            String sfname = sfnameTxt.Text;
            String slname = slnameTxt.Text;
            String semail = semailtxt.Text;
            String suname = sunameTxt.Text;
            String spw    = spwd.Text;
            String onco   = oncologistTxt.Text;

            if (String.IsNullOrEmpty(sid))
            {
                MessageBox.Show("Enter Staff ID Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            clsdb obj = new clsdb();

            try
            {
                int id = obj.setStaff(sid, sfname, slname, semail, suname, spw);

                if (id > 0)
                {
                    MessageBox.Show("Successfully saved data");
                }
                else if (id == 0)
                {
                    MessageBox.Show("Unsuccessfull ,No data found!");
                }
                else
                {
                    MessageBox.Show("error. please fill the every fields!");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }

            sidTxt.Clear();
            sfnameTxt.Clear();
            slnameTxt.Clear();
            semailtxt.Clear();
            sunameTxt.Clear();
            spwd.Clear();
            oncologistTxt.Clear();
        }
Пример #6
0
        public void fillgrid()

        {
            String srchkey = srchTxt.Text;



            clsdb obj = new clsdb();

            DataTable dt = new DataTable();


            dt = obj.searchBykey(srchkey);

            dataGridView1.DataSource = dt;

            if (dt.Rows.Count > 0)

            {
                dataGridView1.DataSource = dt;
            }
        }
Пример #7
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            String sid = sidTxt.Text;

            if (String.IsNullOrEmpty(sid))
            {
                MessageBox.Show("Please Enter Only the Staff ID ,before delete.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            clsdb obj = new clsdb();


            try
            {
                int id = obj.deleteStaff(sid);
                if (id > 0)
                {
                    MessageBox.Show("Successfully deleted data");
                }
                else if (id == 0)
                {
                    MessageBox.Show("Unsuccessfull ,No data found!");
                }
                else
                {
                    MessageBox.Show("error. please fill the required fields!");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }

            sidTxt.Clear();
        }
Пример #8
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            String pid         = pidTxt.Text;
            String pclinicno   = pclincnoTxt.Text;
            String prtno       = prtnoTxt.Text;
            String pfname      = pfnameTxt.Text;
            String plname      = plnameTxt.Text;
            String page        = pageTxt.Text;
            String paddress    = paddressTxt.Text;
            String pdiadnosis  = pdiagnosisTxt.Text;
            String psite       = psiteTxt.Text;
            String pcontact    = pcontactnoTxt.Text;
            String poncologist = poncolgstTxt.Text;

            String pgender;

            if (String.IsNullOrEmpty(pid))
            {
                MessageBox.Show("Enter Patient ID Please.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }



            if (maleRbtn.Checked)
            {
                pgender = maleRbtn.Text;
            }
            else if (femaleRbtn.Checked)
            {
                pgender = femaleRbtn.Text;
            }
            else
            {
                pgender = "Something else";
            }


            clsdb obj = new clsdb();



            try
            {
                int id = obj.setPatients(pid, pclinicno, prtno, pfname, plname, page, paddress, pdiadnosis, psite, pcontact, poncologist, pgender);
                if (id > 0)
                {
                    MessageBox.Show("Successfully saved data");
                }
                else if (id == 0)
                {
                    MessageBox.Show("Unsuccessfull ,No data found!");
                }
                else
                {
                    MessageBox.Show("error. please fill the empty fields!");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }



            pidTxt.Clear();
            pclincnoTxt.Clear();
            prtnoTxt.Clear();
            pfnameTxt.Clear();
            plnameTxt.Clear();
            pageTxt.Clear();
            paddressTxt.Clear();
            pdiagnosisTxt.Clear();
            pcontactnoTxt.Clear();
        }