Пример #1
0
 public bool Save(string version)
 {
     using (SekaiAVDataDataContext db = new SekaiAVDataDataContext())
     {
         var count = (from m in db.t_actress
                      where m.f_javlib_id == this.JL_Id
                      select m).Count();
         t_actress entry;
         if (count == 0)
         {
             entry = new t_actress()
             {
                 f_javlib_id = this.JL_Id,
                 f_name = this.Name,
                 f_update = DateTime.Now,
                 f_version = version,
                 f_create = DateTime.Now
             };
             db.t_actress.InsertOnSubmit(entry);
             db.SubmitChanges();
         }
         else
         {
             entry = (from m in db.t_actress
                      where m.f_javlib_id == this.JL_Id
                      select m).First();
             entry.f_name = this.Name;
             entry.f_prefix = this.Prefix;
             entry.f_update = DateTime.Now;
             entry.f_version = version;
             db.SubmitChanges();
         }
     }
     return true;
 }
 partial void Updatet_actress(t_actress instance);
 partial void Deletet_actress(t_actress instance);
 partial void Insertt_actress(t_actress instance);