Ejemplo n.º 1
0
 private static void SetOtherNames(Database db, Language language, string[] names, string languageIn, Action <OtherName> onSaved = null, Action <OtherName> onExists = null)
 {
     names.Rest(1, (langName) =>
     {
         OtherName name = OtherName.OneWhere(o => o.LanguageId == language.Id && o.LanguageName == languageIn && o.Value == langName, db);
         if (name == null)
         {
             name              = new OtherName();
             name.Uuid         = Guid.NewGuid().ToString();
             name.LanguageId   = language.Id;
             name.LanguageName = languageIn;
             name.Value        = langName;
             name.Save(db);
             if (onSaved != null)
             {
                 onSaved(name);
             }
         }
         else
         {
             if (onExists != null)
             {
                 onExists(name);
             }
         }
     });
 }
Ejemplo n.º 2
0
        private static OtherName CreateFromFilter(IQueryFilter filter, Database database = null)
        {
            Database db  = database ?? Db.For <OtherName>();
            var      dao = new OtherName();

            filter.Parameters.Each(p =>
            {
                dao.Property(p.ColumnName, p.Value);
            });
            dao.Save(db);
            return(dao);
        }
Ejemplo n.º 3
0
 public ActionResult Update(Bam.Net.Translation.OtherName dao)
 {
     try
     {
         dao.Save();
         return(Json(new { Success = true, Message = "", Dao = dao.ToJsonSafe() }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }