public JsonResult saveWord(string wordText, string SurahID, string AyatID) { int surat = Convert.ToInt32(SurahID); int ayat = Convert.ToInt32(AyatID); NounVerb new_word = new NounVerb() { NounVerbText = wordText, }; NounVerb saved_word = db.NounVerbs.Add(new_word); db.SaveChanges(); WordRefrence word_ref = new WordRefrence() { NounVerbID = saved_word.ID, RefrenceSuraID = (Byte)surat, RefrenceVerseID = (short)ayat }; db.WordRefrences.Add(word_ref); db.SaveChanges(); return(Json("Word Added")); }
public JsonResult DeleteWord(string id) { int id_dlt = Convert.ToInt32(id); WordRefrence ref_dlt = db.WordRefrences.Find(id_dlt); if (ref_dlt == null) { return(Json("Not Found")); } else { db.WordRefrences.Remove(ref_dlt); db.SaveChanges(); return(Json("Ok")); } }
public JsonResult addWordRefrence(string main_word_id, string word_id) { long word = Convert.ToInt64(word_id); long main_word = Convert.ToInt64(main_word_id); WordRefrence word_ref = new WordRefrence() { NounVerbID = main_word, NounVerbRefrenceID = word }; db.WordRefrences.Add(word_ref); db.SaveChanges(); return(Json("Refrence Added")); }
public JsonResult addVerseRefrence(string word_id, string surahID, string AyahID) { int surat = Convert.ToInt32(surahID); int ayat = Convert.ToInt32(AyahID); long word = Convert.ToInt64(word_id); WordRefrence word_ref = new WordRefrence() { NounVerbID = word, RefrenceSuraID = (Byte)surat, RefrenceVerseID = (short)ayat }; db.WordRefrences.Add(word_ref); db.SaveChanges(); return(Json("Refrence Added")); }