コード例 #1
0
        // GET: Language
        public ActionResult AddWords()
        {
            LanguageCardDTO      languageCardDTO = new LanguageCardDTO();
            IEnumerable <string> categories      = ADORepo.GetAllCategories();

            languageCardDTO.categoriesForDropdown = GetAllCategoriesSelectList(categories);
            return(View(languageCardDTO));
        }
コード例 #2
0
        public int SaveLanguagePair(LanguageCardDTO languagePair)
        {
            int           count = 0;
            SqlConnection conn  = new SqlConnection();

            conn.ConnectionString = ConfigurationManager.ConnectionStrings["GearHost"].ConnectionString;
            string sqlGet = "spAddWords";

            SqlCommand command = new SqlCommand(sqlGet, conn);

            command.CommandType = System.Data.CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@category", languagePair.WordCategory);
            command.Parameters.AddWithValue("@hindiWord", languagePair.HindiText);
            command.Parameters.AddWithValue("@kannadaWord", languagePair.KannadaText);

            conn.Open();
            count = command.ExecuteNonQuery();
            return(count);
        }
コード例 #3
0
        public ActionResult SaveLanguagePair(LanguageCardDTO languageCardDTO)
        {
            int isInserted = ADORepo.SaveLanguagePair(languageCardDTO);

            return(PartialView());
        }