Exemplo n.º 1
0
        /// <summary>
        /// Inserts the information to the database
        /// </summary>
        /// <returns>Whether the operation was successful</returns>
        public static bool Insert(string firstName, string lastName, string iDNum, string email, int birthYear, string cellPhoneAreaCode, string cellPhoneNumber, int city, bool male)
        {
            //Building the SQL command
            string str = "INSERT INTO " + tableName
                         + "("
                         + "[FirstName]"
                         + ",[LastName]"
                         + ",[ID_Num]"
                         + ",[Email]"
                         + ",[BirthYear]"
                         + ",[CellAreaCode]"
                         + ",[CellPhoneNumber]"
                         + ",[City]"
                         + ",[Male]"
                         + ")"

                         + " VALUES "
                         + "("
                         + "N'" + firstName.Replace("'", "$") + "'"
                         + "," + "N'" + lastName.Replace("'", "$") + "'"
                         + "," + "'" + iDNum + "'"
                         + "," + "'" + email + "'"
                         + "," + "" + birthYear + ""
                         + "," + "'" + cellPhoneAreaCode + "'"
                         + "," + "'" + cellPhoneNumber + "'"
                         + "," + "" + city + ""
                         + "," + "" + (male ? 1 : 0) + ""
                         + ")";

            //Running the SQL command by using the ExecuteSql method from the Dal class and return if the command succeeded
            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Delete the nominee from the DataBase
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool Delete(int id)
        {
            //מוחקת את הלקוח ממסד הנתונים
            string str = "DELETE FROM " + tableName
                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה
            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 3
0
        public static bool Update(int id, string scoreType, int positionId)
        {
            string str = "UPDATE " + tableName + " SET"
                         + " " + "[Name] = " + "N'" + scoreType + "'"
                         + "," + "[Position] = " + "" + positionId + ""

                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה

            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 4
0
        public static bool ChangeDisabled(int id, bool disable)
        {
            //מעדכנת את הלקוח במסד הנתונים

            string str = "UPDATE " + tableName + " SET"
                         + " " + "[Disabled] = " + "" + (disable ? 1 : 0) + ""

                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה

            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 5
0
        public static bool Update(int id, string cityName)
        {
            //מעדכנת את הלקוח במסד הנתונים

            string str = "UPDATE " + tableName + " SET"
                         + " " + "[Name] = " + "N'" + cityName + "'"

                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה

            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 6
0
        public static bool Update(int id, int positionId, int nomineeDBId)
        {
            //מעדכנת את הלקוח במסד הנתונים

            string str = "UPDATE " + tableName + " SET"
                         + " " + "[Position] = " + "" + positionId + ""
                         + "," + "[Nominee] = " + "" + nomineeDBId + ""
                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה

            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 7
0
        public static bool Update(int id, int nomineeDBId, DateTime dateTime, string entry)
        {
            //מעדכנת את הלקוח במסד הנתונים

            string str = "UPDATE " + tableName + " SET"
                         + " " + "[Nominee] = " + "" + nomineeDBId + ""
                         + "," + "[DateTime] = " + "'" + dateTime.ToString("yyyy-MM-dd HH:mm:ss") + "'"
                         + "," + "[Entry] = " + "N'" + entry + "'"

                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה

            return(Dal.ExecuteSql(str));
        }
        public static bool Update(int id, int InterviewerId, int nomineeDBId, int scoreType, int score, DateTime dateTime)
        {
            //מעדכנת את הלקוח במסד הנתונים

            string str = "UPDATE " + tableName + " SET"
                         + " " + "[Interviewer] = " + "" + InterviewerId + ""
                         + "," + "[Nominee] = " + "" + nomineeDBId + ""
                         + "," + "[ScoreType] = " + "" + scoreType + ""
                         + "," + "[Score] = " + "" + score + ""
                         + "," + "[DateTime] = " + "'" + dateTime.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'"
                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה

            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Inserts the information to the database
        /// </summary>
        /// <returns>Whether the operation was successful</returns>
        public static bool Insert(string cityName)
        {
            //Building the SQL command
            string str = "INSERT INTO " + tableName
                         + "("
                         + "[Name]"
                         + ")"

                         + " VALUES "
                         + "("
                         + "N'" + cityName + "'"
                         + ")";

            //Running the SQL command by using the ExecuteSql method from the Dal class and return if the command succeeded
            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Inserts the information to the database
        /// </summary>
        /// <returns>Whether the operation was successful</returns>
        public static bool Insert(string userName, string password)
        {
            //Building the SQL command
            string str = "INSERT INTO " + tableName
                         + "("
                         + "[UserName]"
                         + ",[Password]"
                         + ")"

                         + " VALUES "
                         + "("
                         + "N'" + userName + "'"
                         + "," + "N'" + password + "'"
                         + ")";

            //Running the SQL command by using the ExecuteSql method from the Dal class and return if the command succeeded
            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 11
0
        /// <summary>
        /// Inserts the information to the database
        /// </summary>
        /// <returns>Whether the operation was successful</returns>
        public static bool Insert(int positionId, int nomineeDBId)
        {
            //Building the SQL command
            string str = "INSERT INTO " + tableName
                         + "("
                         + "[Position]"
                         + ",[Nominee]"
                         + ")"

                         + " VALUES "
                         + "("
                         + "" + positionId + ""
                         + "," + "" + nomineeDBId + ""
                         + ")";

            //Running the SQL command by using the ExecuteSql method from the Dal class and return if the command succeeded
            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 12
0
        /// <summary>
        /// Inserts the information to the database
        /// </summary>
        /// <returns>Whether the operation was successful</returns>
        public static bool Insert(int nomineeDBId, DateTime dateTime, string entry)
        {
            //Building the SQL command
            string str = "INSERT INTO " + tableName
                         + "("
                         + "[Nominee]"
                         + ",[DateTime]"
                         + ",[Entry]"
                         + ")"

                         + " VALUES "
                         + "("
                         + "" + nomineeDBId + ""
                         + "," + "'" + dateTime.ToString("yyyy-MM-dd HH:mm:ss") + "'"
                         + "," + "N'" + entry.Replace("'", "$") + "'"
                         + ")";

            //Running the SQL command by using the ExecuteSql method from the Dal class and return if the command succeeded
            return(Dal.ExecuteSql(str));
        }
Exemplo n.º 13
0
        public static bool Update(int id, string firstName, string lastName, string iDNum, string email, int birthYear, string cellPhoneAreaCode, string cellPhoneNumber, int city, bool male)
        {
            //מעדכנת את הלקוח במסד הנתונים

            string str = "UPDATE " + tableName + " SET"
                         + " " + "[FirstName] = " + "N'" + firstName.Replace("'", "$") + "'"
                         + "," + "[LastName] = " + "N'" + lastName.Replace("'", "$") + "'"
                         + "," + "[ID_Num] = " + "'" + iDNum + "'"
                         + "," + "[Email] = " + "'" + email + "'"
                         + "," + "[BirthYear] = " + "" + birthYear + ""
                         + "," + "[CellAreaCode] = " + "'" + cellPhoneAreaCode + "'"
                         + "," + "[CellPhoneNumber] = " + "'" + cellPhoneNumber + "'"
                         + "," + "[City] = " + "" + city + ""
                         + "," + "[Male] = " + "" + (male ? 1 : 0) + ""

                         + " WHERE ID = " + id;

            //הפעלת פעולת הSQL -תוך שימוש בפעולה המוכנה ExecuteSql במחלקה Dal והחזרה האם הפעולה הצליחה

            return(Dal.ExecuteSql(str));
        }
        /// <summary>
        /// Inserts the information to the database
        /// </summary>
        /// <returns>Whether the operation was successful</returns>
        public static bool Insert(int InterviewerId, int nomineeDBId, int scoreTypeId, int score, DateTime dateTime)
        {
            //Building the SQL command
            string str = "INSERT INTO " + tableName
                         + "("
                         + "[Interviewer]"
                         + ",[Nominee]"
                         + ",[ScoreType]"
                         + ",[Score]"
                         + ",[DateTime]"
                         + ")"

                         + " VALUES "
                         + "("
                         + "" + InterviewerId + ""
                         + "," + "" + nomineeDBId + ""
                         + "," + "" + scoreTypeId + ""
                         + "," + "" + score + ""
                         + "," + "'" + dateTime.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'"
                         + ")";

            //Running the SQL command by using the ExecuteSql method from the Dal class and return if the command succeeded
            return(Dal.ExecuteSql(str));
        }