Exemplo n.º 1
0
        /// <summary>
        /// Функция за добавяне на запис
        /// </summary>
        /// <param name="f">Записът, който ще добавяме</param>
        /// <returns>Връща true ако записът е добавен успешно</returns>
        public bool insertRow(SeriesLibrary f)
        {
            if (!libraryTable.Insert("SERIES_LIBRARY", f))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(f);
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Enters a row into the DB
        /// </summary>
        /// <param name="c">The structure that needs to be inserted</param>
        /// <returns>Returns true if the data is selected successfully, and false if occured an error</returns>
        public bool insertRow(Cities c)
        {
            if (!checkDuplicateRecord(c))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!citiesTable.Insert("CITIES", c))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(c);
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Функция за добавяне на запис
        /// </summary>
        /// <param name="e">Записът, който ще добавяме</param>
        /// <returns>Връща true ако записът е добавен успешно</returns>
        public bool insertRow(Positions e)
        {
            if (!checkDuplicateRecord(e))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!posTable.Insert("POSITIONS", e))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(e);
            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Функция за добавяне на запис
        /// </summary>
        /// <param name="s">Записът, който ще добавяме</param>
        /// <returns>Връща true ако записът е добавен успешно</returns>
        public bool insertRow(ServicesNames s)
        {
            if (!checkDuplicateRecord(s))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!servicesTable.Insert("SERVICES", s))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(s);
            return(true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Функция за добавяне на запис
        /// </summary>
        /// <param name="f">Записът, който ще добавяме</param>
        /// <returns>Връща true ако записът е добавен успешно</returns>
        public bool insertRow(Subscriptions s)
        {
            if (checkIfInside(s))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!subscriptionTable.Insert("SUBSCRIPTIONS", s))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(s);
            return(true);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Enters a row into the DB
        /// </summary>
        /// <param name="f">The structure that needs to be inserted</param>
        /// <returns>Returns true if the data is selected successfully, and false if occured an error</returns>
        public bool insertRow(Types t)
        {
            if (!checkDuplicateRecord(t))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!typesTable.Insert("TYPES", t))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(t);
            return(true);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Добавя запис в буферния масив и в базата данни
        /// </summary>
        /// <param name="g">Записът, който ще добавяме/param>
        /// <returns>Връща true ако успешно се запише в назата данни</returns>
        public bool insertRow(Genres g)
        {
            if (!checkDuplicateRecord(g))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!genresTable.Insert("GENRES", g))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(g);
            return(true);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Enters a row into the DB
        /// </summary>
        /// <param name="f">The structure that needs to be inserted</param>
        /// <returns>Returns true if the data is selected successfully, and false if occured an error</returns>
        public bool insertRow(Films f)
        {
            if (!checkDuplicateRecord(f))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!filmsTable.Insert("FILMS", f))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(f);
            return(true);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Функция за добавяне на запис
        /// </summary>
        /// <param name="e">Записът, който ще добавяме</param>
        /// <returns>Връща true ако записът е добавен успешно</returns>
        public bool insertRow(Employees e)
        {
            if (!checkDuplicateRecord(e))
            {
                MessageBox.Show("Този служител вече съществува.");
                return(false);
            }

            if (!employeesTable.Insert("EMPLOYEES", e))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(e);
            return(true);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Функция за добавяне на запис
        /// </summary>
        /// <param name="u">Записът, който ще добавяме</param>
        /// <returns>Връща true ако записът е добавен успешно</returns>
        public bool insertRow(Users u)
        {
            if (!checkDuplicateRecord(u))
            {
                MessageBox.Show("Този град вече съществува.");
                return(false);
            }

            if (!usersTable.Insert("USERS", u))
            {
                MessageBox.Show("Неуспешен опит за извършване на операцията. ");
                return(false);
            }

            addNewRecord(u);
            return(true);
        }