Beispiel #1
0
        public List <VSalesRecord> getListByCustomerID(int PlatformID, string CustomerID)
        {
            List <VSalesRecord> list = new List <VSalesRecord>();

            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@PlatformID", SqlDbType.Int), new SqlParameter("@CustomerID", SqlDbType.NVarChar) };
            parameters[0].Value = PlatformID;
            parameters[1].Value = CustomerID;
            SqlDataReader reader = SQLHelper.RunProcedure("p_SalesRecord_getListByCustomerID", parameters);

            while (reader.Read())
            {
                VSalesRecord item = new VSalesRecord();
                item.ID           = reader.GetInt32(reader.GetOrdinal("ID"));
                item.SalesOrderID = reader.GetString(reader.GetOrdinal("SalesOrderID"));
                item.PlatformID   = reader.GetInt32(reader.GetOrdinal("PlatformID"));
                item.CustomerID   = reader.GetString(reader.GetOrdinal("CustomerID"));
                item.PlatformName = reader.GetString(reader.GetOrdinal("PlatformName"));
                item.Description  = reader.GetString(reader.GetOrdinal("Description"));
                item.UserName     = reader.GetString(reader.GetOrdinal("UserName"));
                item.CreateDate   = reader.GetString(reader.GetOrdinal("CreateDate"));
                list.Add(item);
            }
            reader.Close();
            return(list);
        }
Beispiel #2
0
        public List <VSalesRecord> getAll()
        {
            List <VSalesRecord> list   = new List <VSalesRecord>();
            SqlDataReader       reader = SQLHelper.RunProcedure("p_SalesRecord_getAll", null);

            while (reader.Read())
            {
                VSalesRecord item = new VSalesRecord();
                item.PlatformID   = reader.GetInt32(reader.GetOrdinal("PlatformID"));
                item.ID           = reader.GetInt32(reader.GetOrdinal("ID"));
                item.SalesOrderID = reader.GetString(reader.GetOrdinal("SalesOrderID"));
                item.CustomerID   = reader.GetString(reader.GetOrdinal("CustomerID"));
                item.Description  = reader.GetString(reader.GetOrdinal("Description"));
                item.PlatformName = reader.GetString(reader.GetOrdinal("PlatformName"));
                item.UserName     = reader.GetString(reader.GetOrdinal("UserName"));
                item.CreateDate   = reader.GetString(reader.GetOrdinal("CreateDate"));
                list.Add(item);
            }
            reader.Close();
            return(list);
        }
Beispiel #3
0
        public VSalesRecord getBySalesOrderID(string SalesOrderID)
        {
            bool         flag   = false;
            VSalesRecord record = new VSalesRecord();

            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@SalesOrderID", SqlDbType.NVarChar) };
            parameters[0].Value = SalesOrderID;
            SqlDataReader reader = SQLHelper.RunProcedure("p_SalesRecord_getBySalesOrderID", parameters);

            if (reader.Read())
            {
                record.ID           = reader.GetInt32(reader.GetOrdinal("ID"));
                record.SalesOrderID = reader.GetString(reader.GetOrdinal("SalesOrderID"));
                record.PlatformID   = reader.GetInt32(reader.GetOrdinal("PlatformID"));
                record.CustomerID   = reader.GetString(reader.GetOrdinal("CustomerID"));
                record.PlatformName = reader.GetString(reader.GetOrdinal("PlatformName"));
                record.Description  = reader.GetString(reader.GetOrdinal("Description"));
                record.UserName     = reader.GetString(reader.GetOrdinal("UserName"));
                record.CreateDate   = reader.GetString(reader.GetOrdinal("CreateDate"));
                flag = true;
            }
            reader.Close();
            return(flag ? record : null);
        }