Esempio n. 1
0
        /// <summary>
        /// 清空第一次导入数据库数据
        /// </summary>
        /// <returns></returns>
        public static bool ClearExcel()
        {
            bool clearTabTeachers, clearTabOtherTeachers, clearTabCalendar, clearTabAllCourses;//记录删除成果

            clearTabTeachers      = ConnHelper.ExecuteNoneQueryOperation("truncate table TabAllCourses");
            clearTabOtherTeachers = ConnHelper.ExecuteNoneQueryOperation("truncate table TabTeachers");
            clearTabCalendar      = ConnHelper.ExecuteNoneQueryOperation("truncate table TabCalendar");
            clearTabAllCourses    = ConnHelper.ExecuteNoneQueryOperation("truncate table TabOtherTeachers");

            ConnHelper.ExecuteNoneQueryOperation("delete from TabAllCourses");//可找回但速度慢
            return(clearTabTeachers && clearTabOtherTeachers && clearTabCalendar && clearTabAllCourses);
        }
        public static bool UpdateTabTeachers(string TableName, string UserPWD, string UserID)
        {
            string strSQL = BuildSQLUpdateString(TableName, UserPWD, UserID);

            return(ConnHelper.ExecuteNoneQueryOperation(strSQL));
        }
Esempio n. 3
0
        /// <summary>
        /// 删除表内的数据,有一个约束条件
        /// </summary>
        /// <param name="v1">表名</param>
        /// <param name="v2">约束字段</param>
        /// <param name="v3">约束值</param>
        public static bool DeleteRows(string v1, string v2, string v3)
        {
            string strSQL = SQLFactory.BuildSQLDeleteString(v1, v2, v3);

            return(ConnHelper.ExecuteNoneQueryOperation(strSQL));
        }
Esempio n. 4
0
        /// <summary>
        /// 发布通知
        /// </summary>
        /// <param name="text">数据</param>
        /// <param name="v2">权限</param>
        public static bool InsertMsgRow(string text, string v2)
        {
            string strSQL = "insert into TabMessage(message,role) values('" + text + "','" + v2 + "')";

            return(ConnHelper.ExecuteNoneQueryOperation(strSQL));
        }
Esempio n. 5
0
        /// <summary>
        /// 更新数据表
        /// 更新一个字段,有一个条件
        /// </summary>
        /// <param name="v1">表名</param>
        /// <param name="v2">更新的字段</param>
        /// <param name="v3">更新后的值</param>
        /// <param name="v4">约束名1</param>
        /// <param name="v5">约束名2</param>
        /// <param name="v6">约束名3</param>
        /// <param name="v7">约束名4</param>
        /// <param name="v8">约束名5</param>
        /// <param name="c4">约束值1</param>
        /// <param name="c5">约束值2</param>
        /// <param name="c6">约束值3</param>
        /// <param name="c7">约束值4</param>
        /// <param name="c8">约束值5</param>
        public static bool UpdateRows(string v1, string v2, string v3, string v4, string v5, string v6, string v7, string v8, string c4, string c5, string c6, string c7, string c8)
        {
            string strSQL = "update " + v1 + " set " + v2 + "='" + v3 + "' where " + v4 + "='" + c4 + "' and " + v5 + "='" + c5 + "' and " + v6 + "='" + c6 + "' and " + v7 + "='" + c7 + "' and " + v8 + "='" + c8 + "'";

            return(ConnHelper.ExecuteNoneQueryOperation(strSQL));
        }
Esempio n. 6
0
        public static bool DeleteTab(string TName)
        {
            string strSQL = SQLFactory.BuildSQLDeleteString(TName);

            return(ConnHelper.ExecuteNoneQueryOperation(strSQL));
        }
Esempio n. 7
0
        /// <summary>
        /// 更新数据表
        /// 更新一个字段,有一个条件
        /// </summary>
        /// <param name="v1">表名</param>
        /// <param name="v2">更新的字段</param>
        /// <param name="v3">更新后的值</param>
        /// <param name="v4">约束名</param>
        /// <param name="v5">约束值</param>
        /// <returns></returns>
        public static bool UpdateRows(string v1, string v2, string v3, string v4, string v5)
        {
            string strSQL = SQLFactory.BuildSQLUpdate(v1, v2, v3, v4, v5);

            return(ConnHelper.ExecuteNoneQueryOperation(strSQL));
        }
Esempio n. 8
0
 /// <summary>
 /// 执行插入命令
 /// </summary>
 /// <param name="strSql">insert into 语句</param>
 /// <returns></returns>
 public static bool InsertData(string strSql)
 {
     return(ConnHelper.ExecuteNoneQueryOperation(strSql));
 }
Esempio n. 9
0
        public static bool DeleteTabTeachers(string tableName)
        {
            string strSql = "DELETE FROM " + tableName + " WHERE 1=1";

            return(ConnHelper.ExecuteNoneQueryOperation(strSql));
        }