Пример #1
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            ComboBLL comboBLL = new ComboBLL();
            string   pathTemp = comboBLL.pathImage(id);

            try
            {
                comboBLL.DeleteCombo(id);
                MessageBox.Show("Xóa combo thành công", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception)
            {
                MessageBox.Show("Lỗi khi xóa Combo", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            txtComboName.Clear();
            txtTotal.Clear();
            numDiscount.Value  = 0;
            dayStart.Value     = DateTime.Now;
            dayEnd.Value       = DateTime.Now;
            lblNameImage.Text  = "Chưa có ảnh";
            previewImage.Image = null;
            btnSua.Enabled     = false;
            btnXoa.Enabled     = false;
            LoadListView();
        }
Пример #2
0
        private void LoadPreviewImage(int id)
        {
            ComboBLL comboBLL = new ComboBLL();

            path = comboBLL.pathImage(id);
            previewImage.Image    = Image.FromFile(DBConnection.folder_combo + path);
            previewImage.SizeMode = PictureBoxSizeMode.StretchImage;
            lblNameImage.Text     = path;
        }
Пример #3
0
        private void btnXoa_Click_1(object sender, EventArgs e)
        {
            ComboBLL comboBLL = new ComboBLL();
            string   pathTemp = comboBLL.pathImage(id);

            comboBLL.DeleteCombo(id);
            txtComboName.Clear();
            txtTotal.Clear();
            numDiscount.Value  = 0;
            dayStart.Value     = DateTime.Now;
            dayEnd.Value       = DateTime.Now;
            lblNameImage.Text  = "Chưa có ảnh";
            previewImage.Image = null;
            btnSua.Enabled     = false;
            btnXoa.Enabled     = false;
            LoadListView();
        }