コード例 #1
0
 public static void save(link l)
 {
     if (!l.id.HasValue)
     {
         int id = dl.add_link(l.utente.id, l.id_path, l.title, l.url);
         l.id = id;
     }
     else
     {
         int cc = dal.exec($@"update l set l.id_path = p.id_path, [title] = {fld.str_qry(l.title)}, [link] = {fld.str_qry(l.url)}
   from links l
   join paths p with(nolock) on p.id_path = {l.id_path}
   where l.id_link = {l.id} and l.id_utente = {l.utente.id}");
         if (cc == 0)
         {
             throw new Exception("problemi nell'aggiornamento della key!");
         }
     }
 }