Beispiel #1
0
        public void SetCardMedia(int id, int cardid, MLifter.DAL.Interfaces.Side side, MLifter.DAL.Interfaces.WordType type, bool isDefault, MLifter.DAL.Interfaces.EMedia mediatype)
        {
            using (SqlCeCommand cmd = MSSQLCEConn.CreateCommand(Parent.CurrentUser))
            {
                SqlCeTransaction tran = cmd.Connection.BeginTransaction();

                ClearCardMedia(cardid, side, type, mediatype);

                cmd.CommandText = "INSERT INTO \"Cards_MediaContent\" (media_id, cards_id, side, type, is_default) " +
                                  "VALUES (@mediaid, @cardid, @side, @type, @isdefault);";
                cmd.Parameters.Add("@mediaid", id);
                cmd.Parameters.Add("@cardid", cardid);
                cmd.Parameters.Add("@side", side.ToString());
                cmd.Parameters.Add("@type", type.ToString());
                cmd.Parameters.Add("@isdefault", isDefault);
                MSSQLCEConn.ExecuteNonQuery(cmd);

                tran.Commit();
            }

            Parent.CurrentUser.Cache.Uncache(ObjectLifetimeIdentifier.GetIdentifier(CacheObject.CardMedia, cardid));
        }
Beispiel #2
0
 public IList <int> GetCardMedia(int cardid, MLifter.DAL.Interfaces.Side side, MLifter.DAL.Interfaces.WordType type)
 {
     return(GetCardMedia(cardid, side, type));
 }