Esempio n. 1
0
        private void button6_Click(object sender, EventArgs e)
        {
            string  key     = "";
            keyword keyword = new keyword();

            if (textBox4.Text == null)
            {
                MessageBox.Show("Please Empty values not allowed");
                return;
            }

            key = textBox4.Text;
            keyword.keywords = key;

            if (fbEntities.keywords.Any(c => c.keywords.Trim().ToLower() == key.ToLower().Trim()))
            {
                MessageBox.Show("This Keyword already exist !");
                return;
            }

            fbEntities.keywords.Add(keyword);
            if (fbEntities.SaveChanges() == 1)
            {
                MessageBox.Show("Added Sucessfully ");
            }
        }
Esempio n. 2
0
        public void AddKeyword(string keyword, int criteriaId)
        {
            keyword akeyword = new keyword();

            akeyword.keywords = keyword;

            akeyword.cirteriaId = criteriaId;
            fbEntities.keywords.Add(akeyword);
            fbEntities.SaveChanges();
            // if (fbEntities.SaveChanges() == 1)
            //  MessageBox.Show("Added Sucessfully ");
        }
Esempio n. 3
0
        //Add Keyword
        private void button6_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please choose  criteria");
                return;
            }
            string key        = "";
            int    criteriaId = int.Parse(listView1.SelectedItems[0].SubItems[0].Text);



            keyword keyword = new keyword();

            if (textBox4.Text == null)
            {
                MessageBox.Show("Please Empty values not allowed");
                return;
            }

            key = textBox4.Text;
            keyword.keywords   = key;
            keyword.cirteriaId = criteriaId;

            if (fbEntities.keywords.Any(c => c.keywords.Trim().ToLower() == key.ToLower().Trim()))
            {
                MessageBox.Show("This Keyword already exist !");
                return;
            }

            fbEntities.keywords.Add(keyword);
            if (fbEntities.SaveChanges() == 1)
            {
                MessageBox.Show("Added Sucessfully ");
            }
        }