Exemplo n.º 1
0
        private void deletePubButton_Click(object sender, EventArgs e)
        {
            Yayin y = new Yayin();

            y.setYayKod(pubCodeTextBox.Text);
            DAO.DeletePublication(y);
            RefreshPublicationsList();
        }
Exemplo n.º 2
0
        //TUŞ METODLARI

        private void addPubButton_Click(object sender, EventArgs e)
        {
            errorProvider.Clear();
            if (pubCodeTextBox.Text.Length != 4 || pubNameTextBox.Text.Length < 1 || pubFreqComboBox.Text.Length < 1 || pubTypeComboBox.Text.Length < 1)
            {
                if (pubCodeTextBox.Text.Length != 4)
                {
                    errorProvider.SetError(pubCodeTextBox, "Yayın kodu 4 karakterli ve özgün olmalıdır!");
                }
                else if (pubNameTextBox.Text.Length < 1)
                {
                    errorProvider.SetError(pubNameTextBox, "Lütfen yayın adını giriniz!");
                }
                else if (pubFreqComboBox.Text.Length < 1)
                {
                    errorProvider.SetError(pubFreqComboBox, "Lütfen yayın sıklığını seçiniz!");
                }
                else if (pubTypeComboBox.Text.Length < 1)
                {
                    errorProvider.SetError(pubTypeComboBox, "Lütfen yayın tipi seçiniz!");
                }
            }
            else
            {
                Yayin y = new Yayin();
                y.setYayKod(pubCodeTextBox.Text);
                y.setYayAdi(pubNameTextBox.Text);
                y.setYayAra(pubFreqComboBox.Text);
                y.setYayTur(pubTypeComboBox.Text);

                DAO.AddPublication(y);
                foreach (Control item in Controls)
                {
                    if (item is TextBox)
                    {
                        item.Text = "";
                    }
                }
                foreach (Control item in Controls)
                {
                    if (item is ComboBox)
                    {
                        item.Text = "";
                    }
                }
                RefreshPublicationsList();
            }
        }