Exemplo n.º 1
0
        public bool DeleteRecord(MediaDTO record)
        {
            IDictionary <string, object> conditions = new Dictionary <string, object>();

            conditions["MediaID"] = record.MediaID;

            return(CrudFunctions.Delete(table, conditions) > 0);
        }
Exemplo n.º 2
0
        public bool ChangeRecord(MediaDTO record, string Field, object Value)
        {
            IDictionary <string, object> conditions = new Dictionary <string, object>();

            conditions["MediaID"] = record.MediaID;

            CrudFunctions.UpdateField(table, Field, Value, conditions);
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// INSERT INTO TabReserved (UID, MediaID, ReservedDate) Values ( 1, 1, '2019-06-22 12:12:12.000')
        /// </summary>
        /// <param name="record"></param>
        /// <returns></returns>

        public MediaDTO AddRecord(MediaDTO record)
        {
            IDictionary <string, object> values = new Dictionary <string, object>();

            values["Title"]       = record.Title;
            values["Genre"]       = record.Genre.GID;
            values["Director"]    = record.Director.DID;
            values["Language"]    = record.Language.LID;
            values["PublishYear"] = record.Year;
            values["Budget"]      = record.Budget;

            record.MediaID = CrudFunctions.Create("MediaID", values, table);
            return(record);
        }