示例#1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string Del   = "Do you want to delete : ";
            string Title = "Delete Confirm!";
            string Op    = (this.Owner as ToolMenu).btnOption.Text;

            if (Op == "    ជម្រើស")
            {
                Del   = "តើអ្នកចង់លុបសិស្សឈ្មោះ  ";
                Title = "លុប";
            }
            Database.Open();
            SL_List s = new SL_List();

            student = s.GetSelected();
            if (student != null)
            {
                var result = MessageBox.Show(Del + student.Name, Title, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    StudentListDB.Delete(student.Id);
                    Database.Close();
                    this.btnList_Click(sender, e);
                }
            }
            else
            {
                MessageBox.Show("Please Select Student First!!!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
示例#2
0
        private void StudentList_Load(object sender, EventArgs e)
        {
            //SL_Add Add = new SL_Add();
            //Add.Owner = this;
            SL_List List = new SL_List();

            List.TopLevel   = false;
            List.AutoScroll = true;
            pnSList.Controls.Add(List);
            List.Show();
        }
示例#3
0
        private void StudentList_Load(object sender, EventArgs e)
        {
            ChangeLanguages();
            SL_List List = new SL_List();

            List.Owner      = this;
            List.TopLevel   = false;
            List.AutoScroll = true;
            pnSList.Controls.Add(List);
            List.Show();
        }
示例#4
0
        public void btnList_Click(object sender, EventArgs e)
        {
            btnEdit.Enabled   = true;
            btnDelete.Enabled = true;
            ///////////////Open Form StudentList/////////////////////////////
            DetectColorButton(1);
            pnSList.Controls.Clear();
            SL_List List = new SL_List();

            List.TopLevel   = false;
            List.AutoScroll = true;
            pnSList.Controls.Add(List);
            List.Show();
            //pnUnder.BackColor = Color.FromArgb(192, 64, 0);
        }
示例#5
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            Database.Open();
            SL_List s = new SL_List();

            student = s.GetSelected();
            if (student != null)
            {
                var result = MessageBox.Show("Do you want to delete: " + student.Name, "Delete Confirm!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    StudentListDB.Delete(student.Id);
                    Database.Close();
                    this.btnList_Click(sender, e);
                }
            }
            else
            {
                MessageBox.Show("Please Select Student First!!!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
示例#6
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            SL_List s = new SL_List();

            student = s.GetSelected();
            if (student != null)
            {
                DetectColorButton(3);
                pnSList.Controls.Clear();
                SL_Edit Edit = new SL_Edit(student);
                Edit.Owner      = this;
                Edit.TopLevel   = false;
                Edit.AutoScroll = true;
                pnSList.Controls.Add(Edit);
                btnDelete.Enabled = false;
                Edit.Show();
            }

            else
            {
                MessageBox.Show("Please Select Student First!!!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }