Example #1
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("INSERT INTO tbSupplier (SupplierID, SupplierName, SupplierPhone,country) " +
                              "VALUES ('" + txtSupplierID.Text + "','" + txtName.Text + "','" + txtPhone.Text + "','" + txtAdress.Text + "')");
         SupplierModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
         listViewShow lst = new listViewShow();
         lst.ShowData("Select SupplierName from tbSupplier", "SupplierName", lstView);
         btNew_Click(this, null);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbSupplier Set SupplierID='" + txtSupplierID.Text + "', SupplierName='" + txtName.Text + "', SupplierPhone='" + txtPhone.Text + "', Country='" + txtAdress.Text + "' Where SupplierID='" + txtSupplierID.Text + "'");
         SupplierModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
         listViewShow lst = new listViewShow();
         lst.ShowData("Select SupplierName from tbSupplier", "SupplierName", lstView);
         btNew_Click(this, null);
         MessageBox.Show("Record was Updated!!");
     }
     btSave.Enabled = false;
 }
Example #2
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("INSERT INTO tbUser (UserID, UserName, UserPassword, AccountType, RegisterDate, StaffID) " +
                              "VALUES ('" + txtUserID.Text + "','" + txtUserName.Text + "','" + txtPassword.Text + "','" + cmbAccType.Text + "','"
                              + txtRegisterDate.Text + "','" + cmbStaff.Text + "')");
         UserModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
         listViewShow lst = new listViewShow();
         lst.ShowData("Select UserName from tbUser", "UserName", lstView);
         btNew_Click(this, null);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbUser Set UserID='" + txtUserID.Text + "', UserName='******', UserPassword='******', AccountType='" + cmbAccType.Text + "', RegisterDate='" + txtRegisterDate.Text + "', StaffID='" + cmbStaff.Text + "' Where UserID='" + txtUserID.Text + "'");
         UserModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
         listViewShow lst = new listViewShow();
         lst.ShowData("Select UserName from tbUser", "UserName", lstView);
     }
     btSave.Enabled = false;
     btEdit.Enabled = true;
     btNew.Enabled  = true;
 }
Example #3
0
        private void UserModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("Select UserName from tbUser", "UserName", lstView);
            btSave.Enabled = false;
            btNew.Enabled  = true;
        }
Example #4
0
        private void btSave_Click(object sender, EventArgs e)
        {
            if (btclick == 1)
            {
                dbConnection dbcon = new dbConnection();
                dbcon.OpenConection();
                dbcon.ExecuteQueries("INSERT INTO tbStaff (staffID, Staffname, Gender,Birthdate,Position,salary,Phone,Email,SAddress,Hireddate,Stopwork) " +
                                     "VALUES (" +
                                     "'" + txtStaffID.Text + "'," +
                                     "'" + txtName.Text + "'," +
                                     "'" + cmbSex.Text + "'," +
                                     "'" + txtBD.Text + "'," +
                                     "'" + cmbPosition.Text + "'," +
                                     "'" + txtSalary.Text + "'," +
                                     "'" + txtphone.Text + "'," +
                                     "'" + txtEmail.Text + "'," +
                                     "'" + txtAddress.Text + "'," +
                                     "'" + txtHD.Text + "'," +

                                     "'" + cmbStopWork.Text + "'" +
                                     ")");
                StaffModule_Load(this, null);
                ClearControl cn = new ClearControl();
                cn.ClearTextBoxes(this);
                listViewShow lst = new listViewShow();
                lst.ShowData("Select StaffName from tbStaff", "StaffName", lstView);
            }
            if (btclick == 2)
            {
                dbConnection dbcon = new dbConnection();
                dbcon.OpenConection();
                dbcon.ExecuteQueries("Update tbStaff Set " +
                                     " staffID='" + txtStaffID.Text + "', " +
                                     " Staffname='" + txtName.Text + "'," +
                                     " Gender='" + cmbSex.Text + "'," +
                                     " Birthdate='" + txtBD.Text + "', " +
                                     " Position='" + cmbPosition.Text + "', " +
                                     " salary='" + txtSalary.Text + "', " +
                                     " Email='" + txtEmail.Text + "', " +
                                     " SAddress='" + txtAddress.Text + "', " +
                                     " Phone='" + txtphone.Text + "', " +
                                     " Hireddate='" + txtHD.Text + "', " +
                                     " Stopwork='" + cmbStopWork.Text + "'" +
                                     " Where StaffID ='" + txtStaffID.Text + "'");
                StaffModule_Load(this, null);
                ClearControl cn = new ClearControl();
                cn.ClearTextBoxes(this);
                listViewShow lst = new listViewShow();
                lst.ShowData("Select StaffName from tbStaff", "StaffName", lstView);
            }
        }
Example #5
0
        private void btSave_Click(object sender, EventArgs e)
        {
            if (btclick == 1)
            {
                dbConnection dbcon = new dbConnection();
                dbcon.OpenConection();
                dbcon.ExecuteQueries("INSERT INTO tbPatient" +
                                     "(PID,PName,Gender,PType,Nation,Birhtdate,PAddress,Phone,illstatus,BloodType,Occupation) VALUES " +
                                     "('" + txtID.Text + "'," +
                                     "'" + txtName.Text + "'," +
                                     "'" + cmbSex.Text + "'," +
                                     "'" + cmbType.Text + "'," +
                                     "'" + txtNation.Text + "'," +
                                     "'" + txtBD.Text + "'," +
                                     "'" + txtAddress.Text + "'," +
                                     "'" + txtPhone.Text + "'," +
                                     "'" + txtIllStatus.Text + "'," +
                                     "'" + cmbBtype.Text + "'," +
                                     "'" + txtOccupation.Text + "'" +
                                     ")");
                if (cmbType.Text == "Inpatient ")
                {
                    MessageBox.Show("go to checkin");
                }
                ClearControl cn = new ClearControl();
                cn.ClearTextBoxes(this);
            }
            if (btclick == 2)
            {
                dbConnection dbcon = new dbConnection();
                dbcon.OpenConection();
                dbcon.ExecuteQueries("Update tbPatient Set " +
                                     " PID='" + txtID.Text + "', " +
                                     " PName='" + txtName.Text + "'," +
                                     " Gender='" + cmbSex.Text + "'," +
                                     " PType='" + cmbType.Text + "', " +
                                     " Nation='" + txtNation.Text + "', " +
                                     " Birhtdate='" + txtBD.Text + "', " +
                                     " PAddress='" + txtAddress.Text + "', " +
                                     " Phone='" + txtPhone.Text + "', " +
                                     " illstatus='" + txtIllStatus.Text + "', " +
                                     " BloodType='" + cmbBtype.Text + "', " +
                                     " Occupation='" + txtOccupation.Text + "'" +
                                     " Where PID ='" + txtID.Text + "'");

                ClearControl cn = new ClearControl();
                cn.ClearTextBoxes(this);
                listViewShow lst = new listViewShow();
                lst.ShowData("Select PName from tbPatient", "PName", lstView);
            }
        }
Example #6
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("INSERT INTO tbDoctor" +
                              "(DocID, Docname, Gender, Birthdate, DAddress, Specialize,Nation,Degree,salary," +
                              "Phone,Email,Contractdate,ExpiredDate,Stopwork) VALUES " +
                              "('" + txtDoctorID.Text + "','" + txtName.Text + "'," +
                              "'" + cmbSex.Text + "','" + txtBD.Text + "','" + txtEmail.Text + "'," +
                              "'" + txtSkill.Text + "','" + txtNation.Text + "','" + txtDegree.Text + "'," +
                              "'" + txtSalary.Text + "','" + txtPhone.Text + "','" + txtEmail.Text + "'," +
                              "'" + txtContractdate.Text + "','" + txtExpireDate.Text + "','" + cmbStopWork.Text + "')");
         DoctorModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
         listViewShow lst = new listViewShow();
         lst.ShowData("Select docname from tbDoctor", "docname", lstView);
         btNew_Click(this, null);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbDoctor Set " +
                              " DocID='" + txtDoctorID.Text + "', " +
                              " Docname='" + txtName.Text + "'," +
                              " Gender='" + cmbSex.Text + "'," +
                              " Birthdate='" + txtBD.Text + "', " +
                              " DAddress='" + txtEmail.Text + "', " +
                              " Specialize='" + txtSkill.Text + "', " +
                              " Nation='" + txtNation.Text + "', " +
                              " Degree='" + txtDegree.Text + "', " +
                              " salary='" + txtSalary.Text + "', " +
                              " Phone='" + txtPhone.Text + "', " +
                              " Email='" + txtEmail.Text + "', " +
                              " Contractdate='" + txtContractdate.Text + "', " +
                              " ExpiredDate='" + txtExpireDate.Text + "', " +
                              " Stopwork='" + cmbStopWork.Text + "'" +
                              " Where DocID ='" + txtDoctorID.Text + "'");
         DoctorModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
         listViewShow lst = new listViewShow();
         lst.ShowData("Select docname from tbDoctor", "docname", lstView);
     }
 }
Example #7
0
        public void RoomModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("select RoomNo from tbRoom", "RoomNo", lstView);

            dbConnection dbcon = new dbConnection();

            dbcon.OpenConection();
            SqlDataReader dr = dbcon.DataReader("select RType from tbRoomType");

            dr.Read();
            if (dr.HasRows)

            {
                cmbRType.Items.Add(dr["RType"]).ToString();
                while (dr.Read())
                {
                    cmbRType.Items.Add(dr["RType"]).ToString();
                }
            }
        }
Example #8
0
        private void StaffModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("select StaffName from tbStaff", "StaffName", lstView);
        }
Example #9
0
        private void MedicineModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("Select MeName from tbMedicine", "MeName", lstView);
        }
Example #10
0
        private void frmRoomType_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("Select RType from tbRoomType", "RType", lstRoomType);
        }
Example #11
0
        private void ServiceModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("select ServiceName from tbServices", "ServiceName", lstView);
        }
Example #12
0
        private void DoctorModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("Select Docname from tbDoctor", "Docname", lstView);
        }
Example #13
0
        private void PatientModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("Select PName from tbPatient", "PName", lstView);
        }
Example #14
0
        private void SupplierModule_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("select SupplierName from tbSupplier", "SupplierName", lstView);
        }
Example #15
0
        private void MecCategory_Load(object sender, EventArgs e)
        {
            listViewShow lst = new listViewShow();

            lst.ShowData("select Category from tbMecategory", "Category", lstView);
        }