private string getMaxID()
        {
            string _STR_MAX = GarenaViewModel.returnMaxCode(_Student.lstStudentID());

            if (_STR_MAX == "1")
            {
                return("SV" + _STR_MAX);
            }
            return(_STR_MAX);
        }
Ejemplo n.º 2
0
        private string getMaxID()
        {
            string _STR_MAX = GarenaViewModel.returnMaxCode(_WL.lstID());

            if (_STR_MAX == "1")
            {
                return(_STR_MAX);
            }
            return(_STR_MAX);
        }
 private void gvStudentList_CustomColumnSort(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnSortEventArgs e)
 {
     if (e.Column.FieldName == "StrStudentID")
     {
         e.Handled = true;
         int num1 = GarenaViewModel._seperateNumber((string)e.Value1);
         int num2 = GarenaViewModel._seperateNumber((string)e.Value2);
         e.Result = num1.CompareTo(num2);
     }
 }
Ejemplo n.º 4
0
        private string getMaxID()
        {
            string _STR_MAX = GarenaViewModel.returnMaxCode(_Lan.lstLanguageID());

            if (_STR_MAX == "1")
            {
                return("NN" + _STR_MAX);
            }
            return(_STR_MAX);
        }
Ejemplo n.º 5
0
        private string getMaxID()
        {
            string _STR_MAX = GarenaViewModel.returnMaxCode(_Class.lstClassID());

            if (_STR_MAX == "1")
            {
                return("LH" + _STR_MAX);
            }
            return(_STR_MAX);
        }
Ejemplo n.º 6
0
        private string getMaxID()
        {
            string _STR_MAX = GarenaViewModel.returnMaxCode(_Staff.lstStaffID());

            if (_STR_MAX == "1")
            {
                return("NL" + _STR_MAX);
            }
            return(_STR_MAX);
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtFullName.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập tên Sinh viên", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtFullName.Focus();
            }
            else if (dteBirthday.EditValue == null)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Ngày sinh", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (dteStartYear.EditValue == null)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Ngày bắt đầu", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtPhoneNumber.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Số điện thoại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtEmail.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Email", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtIDCard.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Chứng minh nhân dân", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtAddress.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Địa chỉ", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (!(radNam.Checked) && !(radNu.Checked))
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Giới tính", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (!(radAvailable.Checked) && !(radUnavailable.Checked))
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Trạng thái", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (lkeClass.EditValue == null)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Lớp học", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (lkeFaculty.EditValue == null)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Khoa", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                _getData();
                if (GarenaViewModel.checkPhoneNumber(_StudentModelNow.StrPhone) == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("Số Điện Thoại Phải 10 Số!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (GarenaViewModel.checkIDCard(_StudentModelNow.StrCardID) == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("CMND Phải Trên 8 Số!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (GarenaViewModel.checkEmail(_StudentModelNow.StrEmail) == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("Email không đúng định dạng !", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (CheckBirthday() == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("Sinh viên chưa đủ 18 tuổi", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (CheckStartDay() == true)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("Kiểm tra dữ liệu Lớp học và Ngày bắt đầu");
                    DevExpress.XtraEditors.XtraMessageBox.Show("Hai số đầu Mã lớp tương đương với hai số cuối Ngày bắt đầu", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    _getData();
                    bool bresult = false;
                    if (_IStatusForm == 1)
                    {
                        bresult = _Student.addNewStudent(_StudentModelNow);
                    }
                    else
                    {
                        bresult = _Student.updateCurrentStudent(_StudentModelNow);
                    }

                    if (!bresult)
                    {
                        DevExpress.XtraEditors.XtraMessageBox.Show("Lưu Thất Bại!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        _lstLoadListStudent();
                        _IStatusForm = 0;
                        _setStatusForm();
                        DevExpress.XtraEditors.XtraMessageBox.Show("Lưu Thành Công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtFullName.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập tên Giảng viên", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtIDCard.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Chứng minh nhân dân", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            //else if (_Staff.checkStaffID(txtID.Text) == true)
            //{
            //    DevExpress.XtraEditors.XtraMessageBox.Show("Mã số nhân viên bị trùng", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //}
            else if (_Staff.checkCardID(txtID.Text) == true)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("CMND bị trùng", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (dteBirthday.EditValue == null)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Ngày sinh", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtAddress.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Địa chỉ", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtPhoneNumber.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Số điện thoại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtEmail.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Email", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (lkeFaculty.EditValue == null)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Khoa", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (!(radNam.Checked) && !(radNu.Checked))
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Giới tính", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (!(radAvailable.Checked) && !(radUnavailable.Checked))
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa chọn Trạng thái", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                _getData();
                if (GarenaViewModel.checkPhoneNumber(_LecturerModelNow.StrPhone) == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("Số Điện Thoại Phải 10 Số!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (GarenaViewModel.checkIDCard(_LecturerModelNow.StrCardID) == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("CMND Phải Trên 8 Số!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (GarenaViewModel.checkEmail(_LecturerModelNow.StrEmail) == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("Email không đúng định dạng !", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (CheckBirthday() == false)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show("Nhân viên phải trên 18 tuổi", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    _getData();
                    bool bresult = false;
                    if (_IStatusForm == 1)
                    {
                        bresult = _Staff.addNewStaff(_LecturerModelNow);
                    }
                    else
                    {
                        bresult = _Staff.updateCurrentStaff(_LecturerModelNow);
                    }

                    if (!bresult)
                    {
                        DevExpress.XtraEditors.XtraMessageBox.Show("Lưu Thất Bại!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        _lstLoadListLecturer();
                        _IStatusForm = 0;
                        _setStatusForm();
                        DevExpress.XtraEditors.XtraMessageBox.Show("Lưu Thành Công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }