Esempio n. 1
0
        public int AddGenre(string name)
        {
            IDictionary <string, object> conditions = new Dictionary <string, object>();

            conditions["GenreName"] = name;
            return(CrudFunctions.Create("GID", conditions, genre));
        }
Esempio n. 2
0
        public int AddLanguage(string name)
        {
            IDictionary <string, object> conditions = new Dictionary <string, object>();

            conditions["LanguageName"] = name;
            return(CrudFunctions.Create("LID", conditions, language));
        }
Esempio n. 3
0
        public int AddDirector(string name)
        {
            IDictionary <string, object> conditions = new Dictionary <string, object>();

            conditions["DirectorName"] = name;
            return(CrudFunctions.Create("DID", conditions, director));
        }
Esempio n. 4
0
        public int AddBorrowed(BorrowDTO record)
        {
            IDictionary <string, object> conditions = new Dictionary <string, object>();

            conditions["UID"]        = record.UID;
            conditions["MediaID"]    = record.MediaID;
            conditions["BorrowDate"] = record.BorrowDate;
            conditions["ReturnDate"] = record.ReturnDate;
            return(CrudFunctions.Create("BID", conditions, borrow));
        }
Esempio n. 5
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);
        }
        public UserDTO RegisterUser(UserDTO userDetales)
        {
            if (UserNameExists(userDetales.UserName))
            {
                throw new Exceptions.ValidationException("Username Already Exists");
            }
            if (EmailExists(userDetales.UserEmail))
            {
                throw new Exceptions.ValidationException("Email Already Exists");
            }

            IDictionary <string, object> values = new Dictionary <string, object>();

            values["Password"]  = userDetales.Password;
            values["UserName"]  = userDetales.UserName;
            values["UserLevel"] = userDetales.UserLevel;
            values["UserEmail"] = userDetales.UserEmail;


            userDetales.UID = CrudFunctions.Create("UID", values, table);

            return(userDetales);
        }