Ejemplo n.º 1
0
        public virtual int Delete(int ID = 0)
        {
            var sql = "DELETE FROM student ";

            if (ID == 0)
            {
                return(MysqlManager <student> .Execute(sql));
            }
            sql += " WHERE ID=@ID ";
            return(MysqlManager <student> .Execute(sql, new { ID = ID }));
        }
Ejemplo n.º 2
0
        public virtual int Update(int ID, string NAME, int GENDER, string ADDRESS)
        {
            var sql = "UPDATE student SET NAME=@NAME,GENDER=@GENDER,ADDRESS=@ADDRESS WHERE ID=@ID";

            return(MysqlManager <student> .Execute(sql, new { ID = ID, NAME = NAME, GENDER = GENDER, ADDRESS = ADDRESS }));
        }
Ejemplo n.º 3
0
        public virtual int UpdateColumn(int ID, string COLUMN, string VALUE)
        {
            var sql = string.Format(@"UPDATE student SET {0}=@VALUE WHERE ID=@ID", COLUMN);

            return(MysqlManager <student> .Execute(sql, new { ID = ID, VALUE = VALUE }));
        }
Ejemplo n.º 4
0
        public virtual int Insert(string NAME, int GENDER, string ADDRESS)
        {
            var sql = "INSERT INTO student(NAME,GENDER,ADDRESS) VALUES(@NAME,@GENDER,@ADDRESS)";

            return(MysqlManager <student> .Execute(sql, new { NAME = NAME, GENDER = GENDER, ADDRESS = ADDRESS }));
        }