Ejemplo n.º 1
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("INSERT INTO tbServices" +
                              "(ServiceID,ServiceName,cost,Info) VALUES " +
                              "('" + txtServiceID.Text + "'," +
                              "'" + txtName.Text + "'," +
                              "'" + txtCost.Text + "'," +
                              "'" + txtInfo.Text + "'" +
                              ")");
         ServiceModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbServices Set " +
                              " ServiceName='" + txtName.Text + "'," +
                              " cost='" + txtCost.Text + "'," +
                              " Info='" + txtInfo.Text + "'" +
                              " Where ServiceID ='" + txtServiceID.Text + "'");
         ServiceModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
 }
Ejemplo n.º 2
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Insert Into tbMedicine(MeID,MeName,MeType,StockQty,MeCategoryID,Cost) " +
                              "VALUES (" +
                              "'" + txtMeID.Text + "'," +
                              "'" + txtName.Text + "'," +
                              "'" + cmbCategory.Text + "'," +
                              "'" + txtStockqty.Text + "'," +
                              "'" + txtCategoryID.Text + "'," +
                              "'" + txtCost.Text + "'" +
                              ")");
         MedicineModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbMedicine Set " +
                              " MeName='" + txtName.Text + "'," +
                              " MeType='" + cmbCategory.Text + "'," +
                              " StockQty='" + txtStockqty.Text + "'," +
                              " Cost='" + txtCost.Text + "'," +
                              " MeCategoryID='" + txtCategoryID.Text + "'" +
                              " Where MeID  ='" + txtMeID.Text + "'");
         MedicineModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
 }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 4
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("INSERT INTO tbRoomType" +
                              "(RTypeID,RType,NumofBed,Price) VALUES " +
                              "('" + txtRTID.Text + "'," +
                              "'" + cmbType.Text + "'," +
                              "'" + txtNumofBed.Text + "'," +
                              "'" + txtPrice.Text + "'" +
                              ")");
         RoomType_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbRoomType Set " +
                              " RType='" + cmbType.Text + "'," +
                              " NumofBed='" + txtNumofBed.Text + "'," +
                              " Price='" + txtPrice.Text + "'" +
                              " Where RTypeID ='" + txtRTID.Text + "'");
         RoomType_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
 }
Ejemplo n.º 5
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("INSERT INTO tbRoom(RoomNo,Availablebed,Building,Rfloor,RtypeID) " +
                              "VALUES (" +
                              "'" + txtRoomNo.Text + "'," +
                              "'" + txtAvaliable.Text + "'," +
                              "'" + cmbBuiding.Text + "'," +
                              "'" + txtFloor.Text + "'," +
                              "'" + cmbRoomTID.Text + "'" +
                              ")");
         RoomModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbRoom Set " +
                              " Availablebed='" + txtAvaliable.Text + "'," +
                              " Building='" + cmbBuiding.Text + "'," +
                              " Rfloor='" + txtFloor.Text + "', " +
                              " RtypeID='" + cmbRoomTID.Text + "'" +
                              " Where RoomNo  ='" + txtRoomNo.Text + "'");
         RoomModule_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
 }
Ejemplo n.º 6
0
 private void btSave_Click(object sender, EventArgs e)
 {
     if (btclick == 1)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("INSERT INTO tbMeCategory" +
                              "(MeCategoryID,Category,Country,Usage) VALUES " +
                              "('" + txtcategoryID.Text + "'," +
                              "'" + txtCategoryName.Text + "'," +
                              "'" + cmbCountry.Text + "'," +
                              "'" + txtUsage.Text + "'" +
                              ")");
         MecCategory_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
     if (btclick == 2)
     {
         dbConnection dbcon = new dbConnection();
         dbcon.OpenConection();
         dbcon.ExecuteQueries("Update tbMeCategorySet " +
                              " Category='" + txtCategoryName.Text + "'," +
                              " Country='" + cmbCountry.Text + "'," +
                              " Usage='" + txtUsage.Text + "'" +
                              " Where  MeCategoryID='" + txtcategoryID.Text + "'");
         MecCategory_Load(this, null);
         ClearControl cn = new ClearControl();
         cn.ClearTextBoxes(this);
     }
 }
Ejemplo n.º 7
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;
 }
Ejemplo n.º 8
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);
            }
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 10
0
        private void btNew_Click(object sender, EventArgs e)
        {
            ClearControl cls = new ClearControl();

            cls.ClearTextBoxes(this);
            AutoID ID = new AutoID();
            int    x;

            x = ID.getID("Select StaffID from tbStaff", "StaffID");
            string TID = x.ToString();

            txtStaffID.Text = TID;
            btclick         = 1;
        }
Ejemplo n.º 11
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);
     }
 }
Ejemplo n.º 12
0
        private void btNew_Click(object sender, EventArgs e)
        {
            ClearControl cls = new ClearControl();

            cls.ClearTextBoxes(this);
            AutoID ID = new AutoID();
            int    x;

            x = ID.getID("Select PID from tbPatient", "PID");
            string TID = x.ToString();

            txtID.Text     = TID;
            btSave.Enabled = true;
            txtName.Focus();
            btclick = 1;
        }
Ejemplo n.º 13
0
        private void btNew_Click(object sender, EventArgs e)
        {
            ClearControl cls = new ClearControl();

            cls.ClearTextBoxes(this);
            AutoID ID = new AutoID();
            int    x;

            x = ID.getID("Select SupplierID from tbSupplier", "SupplierID");
            string TID = x.ToString();

            txtSupplierID.Text = TID;
            btclick            = 1;
            btSave.Enabled     = true;
            btEdit.Enabled     = false;
        }