Beispiel #1
0
        public SupplierCounter GetSupplierCounter(int objectID, int countType, DateTime countDate)
        {
            String sql        = "SELECT * FROM [SupplierCounter](NOLOCK) WHERE ObjectID=@ObjectID AND CountType=@CountType AND CountDate=@CountDate";
            var    db         = DbSFO2ORead;
            var    parameters = db.CreateParameterCollection();

            parameters.Append("ObjectID", objectID);
            parameters.Append("CountType", countType);
            parameters.Append("CountDate", countDate);
            var ds = db.ExecuteSqlDataSet(sql, parameters);

            return(DataMapHelper.DataSetToObject <SupplierCounter>(ds));;
        }
Beispiel #2
0
        public FindPasswordToken GetFindPasswordToken(int supplierID)
        {
            var db         = DbSFO2ORead;
            var parameters = db.CreateParameterCollection();

            string strsql = @"SELECT [Token],[ExpiredTime]
FROM [SupplierToken](NOLOCK) WHERE ObjectID=@SupplierID AND [TokenType]=1 AND [Status]=1 AND [ExpiredTime]>GetDate()";

            parameters.Append("SupplierID", supplierID);
            DataSet ds2   = db.ExecuteSqlDataSet(strsql, parameters);
            var     token = DataMapHelper.DataSetToObject <FindPasswordToken>(ds2);

            return(token);
        }
Beispiel #3
0
        public FindPasswordToken VerifyFindPasswordToken(string token)
        {
            var db         = DbSFO2ORead;
            var parameters = db.CreateParameterCollection();

            string strsql = @"SELECT s.[SupplierID],[UserName],[CompanyName],st.[Token],st.[ExpiredTime]
FROM [Supplier](NOLOCK) s
INNER JOIN [SupplierToken](NOLOCK) st ON s.SupplierID = st.ObjectID AND st.[TokenType]=1
WHERE st.[ExpiredTime]>GetDate() AND st.[Status]=1 AND st.[Token]=@Token";

            parameters.Append("Token", token);

            DataSet ds = db.ExecuteSqlDataSet(strsql, parameters);

            return(DataMapHelper.DataSetToObject <FindPasswordToken>(ds));
        }