public ActionResult RegisterTercuman(RegisterViewModelTranslator model) { if (ModelState.IsValid) { BusinessLayerResult <Tercuman> res = tercumanManager.RegisterTercuman(model); DilTercumen dt = new DilTercumen(); //burada ana dil ekle string ana_dil = model.AnaDil; BusinessLayerResult <Dil> dil = dilManager.GetLanguageById(ana_dil); dt.Dil_isimler = dil.Result.Id; dt.Tercumanlar = res.Result.Id; BusinessLayerResult <DilTercumen> res2 = dilTercumenManager.RegisterTercuman(dt); if (res.Errors.Count > 0) { res.Errors.ForEach(x => ModelState.AddModelError("", x.Message)); return(View(model)); } OkViewModel notifyObj = new OkViewModel() { Title = "Kayıt Başarılı", RedirectingUrl = "/Home/Login", }; notifyObj.Items.Add("Lütfen e-posta adresinize gönderdiğimiz aktivasyon link'ine tıklayarak hesabınızı aktive ediniz. Hesabınızı aktive etmeden not ekleyemez ve beğenme yapamazsınız."); return(View("Ok", notifyObj)); } return(View(model)); }
public JsonResult SaveList(string ItemList) { DilTercumen dl = new DilTercumen(); string[] arr = ItemList.Split(','); for (int i = 0; i < arr.Length; i++) { dl.Tercumanlar = CurrentSessionsTercuman.User.Id; dl.Dil_isimler = Convert.ToInt32(arr[i]); diltercumenManager.Insert(dl); } return(Json("", JsonRequestBehavior.AllowGet)); }