コード例 #1
0
ファイル: Issuer.cs プロジェクト: sekaiamber/javlibspider
 public bool Save()
 {
     using (SekaiAVDataDataContext db = new SekaiAVDataDataContext())
     {
         if (this.JL_Id != null && this.Name != null && this.JL_Id != "" && this.Name != "")
         {
             var q = (from m in db.t_issuer
                      where m.f_javlib_id == JL_Id
                      select m).Count();
             t_issuer entry;
             if (q == 0)
             {
                 entry = new t_issuer()
                 {
                     f_javlib_id = this.JL_Id,
                     f_name = this.Name,
                     f_create = DateTime.Now,
                     f_update = DateTime.Now
                 };
                 db.t_issuer.InsertOnSubmit(entry);
                 db.SubmitChanges();
                 this.Id = entry.id;
             }
             else
             {
                 entry = (from m in db.t_issuer
                          where m.f_javlib_id == JL_Id
                          select m).First();
                 entry.f_javlib_id = JL_Id;
                 entry.f_name = Name;
                 entry.f_update = DateTime.Now;
                 db.SubmitChanges();
                 this.Id = entry.id;
             }
         }
     }
     return true;
 }
コード例 #2
0
 partial void Deletet_issuer(t_issuer instance);
コード例 #3
0
 partial void Updatet_issuer(t_issuer instance);
コード例 #4
0
 partial void Insertt_issuer(t_issuer instance);