Exemple #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (flx.Rows.Count > 1)
                {
                    if (Box.questionBox("Are you sure you want to delete this room?", "DELETE?"))
                    {
                        int id = Convert.ToInt32(flx[flx.RowSel, "roomID"]);

                        Helper.deleteData("rooms", "roomID", id);
                        Box.infoBox("Room successfully deleted.");
                        LoadData();
                    }
                }
                else
                {
                    Box.infoBox("No data found.");
                }
            }
            catch (Exception er)
            {
                Box.errBox(er.Message);
                //  throw;
            }
        }
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (flx.Rows.Count > 1)
     {
         if (Box.questionBox("Are you sure you want to remove this student?", "REMOVE?"))
         {
             try
             {
                 int id = Convert.ToInt32(flx[flx.RowSel, "ayStudentID"]);
                 if (removeStudent(id))
                 {
                     Box.infoBox("Student successfully removed.");
                     loaddata();
                 }
                 else
                 {
                     Box.warnBox("Something went wrong. Please contact system administrator.");
                 }
             }
             catch (Exception er)
             {
                 Box.errBox(er.Message);
                 // throw;
             }
         }
     }
     else
     {
         Box.warnBox("No data found.");
     }
 }
Exemple #3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (flx.Rows.Count < 2)
                {
                    Box.warnBox("Please select a row.");
                    return;
                }

                if (Box.questionBox("Are you sure you want to delete this row?", "DELETE?"))
                {
                    // con = Connection.con();
                    int id = (int)flx[flx.RowSel, "sectionID"];
                    con = Connection.con();
                    con.Open();
                    section.delete(con, id);
                    Box.infoBox("Data deleted successfully.");
                    loadData();
                }
            }
            catch (Exception er)
            {
                Box.errBox(er.Message);
            }
        }
Exemple #4
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (flx.Rows.Count > 1)
     {
         int id = Convert.ToInt32(flx[flx.RowSel, "userID"]);
         if (Box.questionBox("Are you sure you want to delete this row?", "DELETE?"))
         {
             con = Connection.con();
             con.Open();
             if (delete(id) > 0)
             {
                 con.Close();
                 con.Dispose();
                 Box.infoBox("Data deleted successfully");
                 loadData();
             }
             else
             {
                 con.Close();
                 con.Dispose();
                 Box.errBox("Something went wrong. Please contact System Administrator.");
             }
         }
     }
     else
     {
         Box.warnBox("Please select a row.");
     }
 }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (Box.questionBox("Are you sure you want to delete this data?", "DELETE?"))
            {
                con = Connection.con();
                con.Open();

                std.delete(con, Convert.ToInt32(flx[flx.RowSel, "id"]));
                con.Close();
                con.Dispose();
                Box.infoBox("Row successfully deleted.");
                loaddata();
            }
        }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (flx.Rows.Count > 1)
     {
         if (Box.questionBox("Are you sure you want to delete this row?", "DELETE?"))
         {
             int id = Convert.ToInt32(flx[flx.RowSel, "phonebookID"]);
             Helper.deleteData("phonebook", "phonebookID", id);
             loaddata();
             Box.infoBox("Row deleted.");
         }
     }
     else
     {
         Box.warnBox("No data found.");
     }
 }
Exemple #7
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (flx.Rows.Count > 1)
     {
         int id = Convert.ToInt32(flx[flx.RowSel, "academicyearID"]);
         if (Box.questionBox("Are you sure you want to delete this row?", "DELETE!"))
         {
             Helper.deleteData("academicyear", "academicyearID", id);
             Box.infoBox("Row successfully deleted.");
             loaddata();
         }
     }
     else
     {
         Box.warnBox("No data selected.");
     }
 }
Exemple #8
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (flx.Rows.Count < 2)
            {
                Box.warnBox("Please select a row.");
                return;
            }

            if (Box.questionBox("Are you sure you want to delete this row?", "DELETE?"))
            {
                con = Connection.con();
                con.Open();
                cGrade.delete(con, Convert.ToInt32(flx[flx.RowSel, "gradeID"]));
                con.Close();
                con.Dispose();
                Box.infoBox("Data deleted.");
                loadData();
            }
        }
        public virtual void btnSave_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtRFID.Text))
            {
                if (!Box.questionBox("No RFID inputted. Do you want to continue?", "NO RFID!"))
                {
                    txtRFID.Focus();
                    return;
                }
            }

            if (String.IsNullOrEmpty(txtStudentID.Text))
            {
                Box.warnBox("Please input Student ID.");
                txtStudentID.Focus();
                return;
            }


            if (String.IsNullOrEmpty(txtlname.Text))
            {
                Box.warnBox("Please input Lastname.");
                txtlname.Focus();
                return;
            }

            if (String.IsNullOrEmpty(txtfname.Text))
            {
                Box.warnBox("Please input Firstname.");
                txtfname.Focus();
                return;
            }

            if (String.IsNullOrEmpty(txtguardian.Text))
            {
                Box.warnBox("Please input guardian/parent.");
                txtguardian.Focus();
                return;
            }


            //if (String.IsNullOrEmpty(cmbGrade.Text) && String.IsNullOrEmpty(cmbProgram.Text))
            //{
            //    Box.warnBox("Please input Grade or Program.");
            //   // cmbGrade.Focus();
            //    return;
            //}

            if (!txtContact.MaskFull)
            {
                Box.warnBox("Please input contact no.");
                return;
            }

            if (!txtParentsContact.MaskFull)
            {
                Box.warnBox("Please input parent contact no.");
                return;
            }


            if (txtContact.Text == txtParentsContact.Text)
            {
                Box.warnBox("Student mobile number cannot be the same with parents mobile no.");
                return;
            }

            if (id == 0)
            {
                if (Helper.isExist("student", "rfid", txtRFID.Text.Trim()))
                {
                    Box.warnBox("RFID already in used.");
                    return;
                }

                if (Helper.isExist("student", "mobileNo", txtContact.Text.Trim()) || Helper.isExist("users", "mobileNo", txtContact.Text.Trim()))
                {
                    Box.warnBox("Mobile Number already in used.");
                    return;
                }
            }

            if (id > 0)
            {
                if (tempRFID != txtRFID.Text)
                {
                    if (Helper.isExist("student", "rfid", txtRFID.Text.Trim()))
                    {
                        Box.warnBox("RFID already in used.");
                        return;
                    }
                }

                if (tempMobile != txtContact.Text)
                {
                    if (Helper.isExist("student", "mobileNo", txtContact.Text.Trim()) || Helper.isExist("users", "mobileNo", txtContact.Text.Trim()))
                    {
                        Box.warnBox("Mobile Number already in used.");
                        return;
                    }
                }

                if (tempParentMobile != txtParentsContact.Text)
                {
                    if (Helper.isExist("student", "pMobileNo", txtContact.Text.Trim()) || Helper.isExist("users", "mobileNo", txtContact.Text.Trim()))
                    {
                        Box.warnBox("Mobile Number already in used.");
                        return;
                    }
                }
            }


            try
            {
                processSave();

                if (_frm.GetType() == typeof(StudentMainform))
                {
                    _frm.loaddata();
                }


                //if (_frm.GetType() == typeof(StudentList))
                //    stdListForm.LoadData();
            }
            catch (Exception er)
            {
                // throw;
                Box.errBox(er.Message);
            }
        }