Ejemplo n.º 1
0
 public static void INSERT_DANG_NHAP_GHI_CHEP(string string_0, string string_1, string string_2, string string_3)
 {
     if (World.DANG_NHAP_GHI_CHEP == 1)
     {
         string         str = string.Format("INSERT INTO DANG_NHAP_GHI_CHEP (UserId,UserName,UserIp,Loai_hinh) VALUES (@UserId,@UserName,@UserIp,@Loai_hinh)", new object[0]);
         SqlParameter[] sqlParameterArray = new SqlParameter[] { SqlDBA.MakeInParam("@UserId", SqlDbType.VarChar, 30, string_0), SqlDBA.MakeInParam("@UserName", SqlDbType.VarChar, 30, string_1), SqlDBA.MakeInParam("@UserIp", SqlDbType.VarChar, 30, string_2), SqlDBA.MakeInParam("@Loai_hinh", SqlDbType.VarChar, 30, string_3) };
         DbPool_Class   dbPoolClass       = new DbPool_Class()
         {
             Conn  = DBA.smethod_3(null),
             Prams = sqlParameterArray,
             Sql   = str,
             Type  = 1
         };
         World.queue_1.Enqueue(dbPoolClass);
     }
 }
Ejemplo n.º 2
0
    public static DataSet GetNewList(string 表名, int 每页显示数, int 当前页, string 查询条件, string 表的主键, string 排序字段, int 排序方法, out int 总页数, out int 记录数)
    {
        DataSet       dataSet       = null;
        SqlConnection sqlConnection = new SqlConnection(DBA.strConnection);

        总页数 = 0;
        记录数 = 0;
        try
        {
            SqlParameter[] sqlParameterArray  = new SqlParameter[] { SqlDBA.MakeInParam("@tblName", SqlDbType.NVarChar, 200, 表名), SqlDBA.MakeInParam("@pageSize", SqlDbType.Int, 10, 每页显示数), SqlDBA.MakeInParam("@page", SqlDbType.Int, 10, 当前页), SqlDBA.MakeInParam("@strCondition", SqlDbType.NVarChar, 1000, 查询条件), SqlDBA.MakeInParam("@ID", SqlDbType.NVarChar, 150, 表的主键), SqlDBA.MakeInParam("@fldSort", SqlDbType.NVarChar, 200, 排序字段), SqlDBA.MakeInParam("@Sort", SqlDbType.Bit, 10, 排序方法), SqlDBA.MakeOutParam("@pageCount", SqlDbType.Int, 4), SqlDBA.MakeOutParam("@Counts", SqlDbType.Int, 4) };
            SqlParameter[] sqlParameterArray1 = sqlParameterArray;
            SqlDBA.RunProc(sqlConnection, "proc_ListPageInt", sqlParameterArray1, out dataSet);
            总页数 = Convert.ToInt32(sqlParameterArray1[7].Value);
            记录数 = Convert.ToInt32(sqlParameterArray1[8].Value);
        }
        catch (Exception exception1)
        {
            Exception exception = exception1;
            WebFun.ScriptMessage(string.Concat("SqlDBA发生错误,信息为:", exception.Message), true);
        }
        return(dataSet);
    }
Ejemplo n.º 3
0
    public static DataSet GetNewList(string 表名, int 每页显示数, int 当前页, string 查询条件, string 表的主键, string 排序字段, int 排序方法, out int 总页数, out int 记录数)
    {
        DataSet       dataReader = null;
        SqlConnection conn       = new SqlConnection(getstrConnection());

        总页数 = 0;
        记录数 = 0;
        try
        {
            SqlParameter[] prams = new SqlParameter[] { SqlDBA.MakeInParam("@tblName", SqlDbType.NVarChar, 200, 表名), SqlDBA.MakeInParam("@pageSize", SqlDbType.Int, 10, 每页显示数), SqlDBA.MakeInParam("@page", SqlDbType.Int, 10, 当前页), SqlDBA.MakeInParam("@strCondition", SqlDbType.NVarChar, 0x3e8, 查询条件), SqlDBA.MakeInParam("@ID", SqlDbType.NVarChar, 150, 表的主键), SqlDBA.MakeInParam("@fldSort", SqlDbType.NVarChar, 200, 排序字段), SqlDBA.MakeInParam("@Sort", SqlDbType.Bit, 10, 排序方法), SqlDBA.MakeOutParam("@pageCount", SqlDbType.Int, 4), SqlDBA.MakeOutParam("@Counts", SqlDbType.Int, 4) };
            SqlDBA.RunProc(conn, "proc_ListPageInt", prams, out dataReader);
            总页数 = Convert.ToInt32(prams[7].Value);
            记录数 = Convert.ToInt32(prams[8].Value);
        }
        catch (Exception exception)
        {
            throw new ArgumentException("SqlDBA发生错误,信息为:" + exception.Message);
        }
        return(dataReader);
    }
Ejemplo n.º 4
0
    public static DataSet GetList(string TBName, int PageSize, int CurPage, string KeyField, string Condition, string Order)
    {
        DataSet       dataReader = null;
        SqlConnection conn       = new SqlConnection(getstrConnection());

        try
        {
            SqlParameter[] prams = new SqlParameter[] { SqlDBA.MakeInParam("@TBName", SqlDbType.NVarChar, 100, TBName), SqlDBA.MakeInParam("@PageSize", SqlDbType.Int, 10, PageSize), SqlDBA.MakeInParam("@CurPage", SqlDbType.Int, 10, CurPage), SqlDBA.MakeInParam("@KeyField", SqlDbType.NVarChar, 100, KeyField), SqlDBA.MakeInParam("@Condition", SqlDbType.NVarChar, 200, Condition), SqlDBA.MakeInParam("@Order", SqlDbType.NVarChar, 200, Order) };
            SqlDBA.RunProc(conn, "XW_PublicTurnPageWebSite", prams, out dataReader);
        }
        catch (Exception)
        {
        }
        return(dataReader);
    }
Ejemplo n.º 5
0
    public static DataSet GetList(string TBName, int PageSize, int CurPage, string KeyField, string Condition, string Order)
    {
        DataSet       dataSet       = null;
        SqlConnection sqlConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnString"]);

        try
        {
            SqlParameter[] sqlParameterArray = new SqlParameter[] { SqlDBA.MakeInParam("@TBName", SqlDbType.NVarChar, 100, TBName), SqlDBA.MakeInParam("@PageSize", SqlDbType.Int, 10, PageSize), SqlDBA.MakeInParam("@CurPage", SqlDbType.Int, 10, CurPage), SqlDBA.MakeInParam("@KeyField", SqlDbType.NVarChar, 100, KeyField), SqlDBA.MakeInParam("@Condition", SqlDbType.NVarChar, 200, Condition), SqlDBA.MakeInParam("@Order", SqlDbType.NVarChar, 200, Order) };
            SqlDBA.RunProc(sqlConnection, "XW_PublicTurnPageWebSite", sqlParameterArray, out dataSet);
        }
        catch (Exception exception1)
        {
            Exception exception = exception1;
            WebFun.ScriptMessage(string.Concat("SqlDBA发生错误,信息为:", exception.Message), true);
        }
        return(dataSet);
    }
Ejemplo n.º 6
0
    public static bool GetUser(string id, string pwd)
    {
        string sqlCommand = string.Format("select id from Admin where name=@UserId and pwd=@UserPwd", new object[0]);

        SqlParameter[] prams         = new SqlParameter[] { SqlDBA.MakeInParam("@UserId", SqlDbType.VarChar, 10, id), SqlDBA.MakeInParam("@UserPwd", SqlDbType.VarChar, 10, pwd) };
        DataTable      dBToDataTable = DBAi.GetDBToDataTable(sqlCommand, prams);

        if (dBToDataTable == null)
        {
            return(false);
        }
        if (dBToDataTable.Rows.Count == 0)
        {
            return(false);
        }
        return(true);
    }