public ActionResult DeleteConfirmed(int id)
        {
            PGLanguage pglanguage = db.PGLanguages.Find(id);

            db.PGLanguages.Remove(pglanguage);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /PGLanguage/Delete/5

        public ActionResult Delete(int id = 0)
        {
            PGLanguage pglanguage = db.PGLanguages.Find(id);

            if (pglanguage == null)
            {
                return(HttpNotFound());
            }
            return(View(pglanguage));
        }
 public ActionResult Edit(PGLanguage pglanguage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pglanguage).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pglanguage));
 }
        public ActionResult Create(PGLanguage pglanguage)
        {
            if (ModelState.IsValid)
            {
                db.PGLanguages.Add(pglanguage);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pglanguage));
        }
 public AddTextKeyWindow(PGLanguage selectedLanguage, ObservableTranslationData translationEnglish, ObservableTranslationData translationGerman, ObservableTranslationData translationFrench, ObservableTranslationData translationItalian, ObservableTranslationData translationSpanish)
 {
     InitializeComponent();
     FormData = new AddTextKeyWindowData()
     {
         SelectedLanguage = selectedLanguage, TranslationEnglish = translationEnglish, TranslationGerman = translationGerman, TranslationFrench = translationFrench, TranslationItalian = translationItalian, TranslationSpanish = translationSpanish
     };
     DataContext            = FormData;
     FormData.IsKeyEditable = true;
     FormData.IsValidKey    = false;
     FormData.IsBoltVisible = Visibility.Visible;
 }
示例#6
0
 public EditTextKeyWindow(PGLanguage selectedLanguage, ObservableTranslationData translationEnglish, ObservableTranslationData translationGerman, ObservableTranslationData translationFrench, ObservableTranslationData translationItalian, ObservableTranslationData translationSpanish)
 {
     InitializeComponent();
     FormData = new EditTextKeyWindowData()
     {
         SelectedLanguage = selectedLanguage, TranslationEnglish = translationEnglish, TranslationGerman = translationGerman, TranslationFrench = translationFrench, TranslationItalian = translationItalian, TranslationSpanish = translationSpanish
     };
     if (FormData.Key == string.Empty && (FormData.EnglishText == string.Empty || FormData.SpanishText == string.Empty || FormData.FrenchText == string.Empty || FormData.GermanText == string.Empty || FormData.ItalianText == string.Empty))
     {
         FormData.IsKeyEditable = true;
         FormData.IsValidKey    = false;
     }
     DataContext = FormData;
 }