Ejemplo n.º 1
0
        private void btnEditPrice_Click(object sender, EventArgs e)
        {
            var price  = _prices.Where(m => m.Id.Equals(Int32.Parse(gridPrice.SelectedRows[0].Cells[0].Value.ToString()))).First();
            var dialog = new PriceDialog(_unitOfWork, price, _prices, _priceModified, _nextPriceId, _tour == null? "": _tour.Name);
            var check  = dialog.ShowDialog();

            if (check.Equals(DialogResult.OK))
            {
                MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadPrices(_selectedIndex);
            }
            dialog.Dispose();
        }
Ejemplo n.º 2
0
        private void btnAddPrice_Click(object sender, EventArgs e)
        {
            var dialog = new PriceDialog(_unitOfWork, null, _prices, _priceModified, _nextPriceId, _tour == null?"":_tour.Name);
            var check  = dialog.ShowDialog();

            if (check.Equals(DialogResult.OK))
            {
                _nextPriceId++;
                MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadPrices();
            }
            dialog.Dispose();
        }